v0.14.0
Public Types | Public Member Functions | Public Attributes | List of all members
OpAssembleBasic< T > Struct Template Reference

#include <users_modules/eshelbian_plasticit/src/EshelbianOperators.hpp>

Inheritance diagram for OpAssembleBasic< T >:
[legend]
Collaboration diagram for OpAssembleBasic< T >:
[legend]

Public Types

using ScaleOff = boost::function< double()>
 

Public Member Functions

 OpAssembleBasic (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)
 
 OpAssembleBasic (std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type, const bool assemble_symmetry, ScaleOff scale_off=[]() { return 1;})
 
virtual MoFEMErrorCode integrate (EntData &data)
 
virtual MoFEMErrorCode integrate (int row_side, EntityType row_type, EntData &data)
 
virtual MoFEMErrorCode assemble (EntData &data)
 
virtual MoFEMErrorCode assemble (int row_side, EntityType row_type, EntData &data)
 
virtual MoFEMErrorCode integrate (EntData &row_data, EntData &col_data)
 
virtual MoFEMErrorCode assemble (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 

Public Attributes

const bool assembleSymmetry
 
boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts More...
 
VectorDouble nF
 local right hand side vector More...
 
MatrixDouble K
 local tangent matrix More...
 
MatrixDouble transposeK
 
ScaleOff scaleOff
 

Detailed Description

template<typename T>
struct OpAssembleBasic< T >

Definition at line 40 of file EshelbianOperators.hpp.

Member Typedef Documentation

◆ ScaleOff

template<typename T >
using OpAssembleBasic< T >::ScaleOff = boost::function<double()>

Definition at line 42 of file EshelbianOperators.hpp.

Constructor & Destructor Documentation

◆ OpAssembleBasic() [1/2]

template<typename T >
OpAssembleBasic< T >::OpAssembleBasic ( const std::string &  field_name,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
const char  type 
)
inline

Definition at line 48 of file EshelbianOperators.hpp.

51  : T(field_name, type), dataAtPts(data_ptr), assembleSymmetry(false) {}

◆ OpAssembleBasic() [2/2]

template<typename T >
OpAssembleBasic< T >::OpAssembleBasic ( std::string  row_field,
std::string  col_field,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
const char  type,
const bool  assemble_symmetry,
ScaleOff  scale_off = []() { return 1; } 
)
inline

Definition at line 53 of file EshelbianOperators.hpp.

56  { return 1; })
57  : T(row_field, col_field, type, false), dataAtPts(data_ptr),
58  assembleSymmetry(assemble_symmetry), scaleOff(scale_off) {}

Member Function Documentation

◆ assemble() [1/3]

template<typename T >
virtual MoFEMErrorCode OpAssembleBasic< T >::assemble ( EntData data)
inlinevirtual

Definition at line 79 of file EshelbianOperators.hpp.

79  {
81  double *vec_ptr = &*nF.begin();
82  int nb_dofs = data.getIndices().size();
83  int *ind_ptr = &*data.getIndices().begin();
84  CHKERR VecSetValues(this->getTSf(), nb_dofs, ind_ptr, vec_ptr, ADD_VALUES);
86  }

◆ assemble() [2/3]

template<typename T >
virtual MoFEMErrorCode OpAssembleBasic< T >::assemble ( int  row_side,
EntityType  row_type,
EntData data 
)
inlinevirtual

Definition at line 88 of file EshelbianOperators.hpp.

89  {
91  CHKERR assemble(data);
93  }

◆ assemble() [3/3]

template<typename T >
virtual MoFEMErrorCode OpAssembleBasic< T >::assemble ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntData row_data,
EntData col_data 
)
inlinevirtual

Definition at line 101 of file EshelbianOperators.hpp.

103  {
105 
106  if (assembleSymmetry) {
107  const auto row_nb_dofs = row_data.getIndices().size();
108  const auto col_nb_dofs = col_data.getIndices().size();
109  transposeK.resize(col_nb_dofs, row_nb_dofs, false);
110  noalias(transposeK) = trans(K);
111  transposeK *= scaleOff();
112  }
113 
114  CHKERR MatSetValues<AssemblyTypeSelector<A>>(this->getTSB(), row_data,
115  col_data, K, ADD_VALUES);
116  if (assembleSymmetry) {
117  CHKERR MatSetValues<AssemblyTypeSelector<A>>(
118  this->getTSB(), col_data, row_data, transposeK, ADD_VALUES);
119  }
120 
122  }

◆ doWork() [1/2]

template<typename T >
MoFEMErrorCode OpAssembleBasic< T >::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntData row_data,
EntData col_data 
)
inline

Definition at line 135 of file EshelbianOperators.hpp.

137  {
139  if (row_data.getIndices().empty())
141  if (col_data.getIndices().empty())
143  K.resize(row_data.getIndices().size(), col_data.getIndices().size(), false);
144  K.clear();
145  CHKERR integrate(row_data, col_data);
146  CHKERR assemble(row_side, col_side, row_type, col_type, row_data, col_data);
148  }

◆ doWork() [2/2]

template<typename T >
MoFEMErrorCode OpAssembleBasic< T >::doWork ( int  side,
EntityType  type,
EntData data 
)
inline

Definition at line 124 of file EshelbianOperators.hpp.

124  {
126  if (data.getIndices().empty())
128  nF.resize(data.getIndices().size(), false);
129  nF.clear();
130  CHKERR integrate(side, type, data);
131  CHKERR assemble(side, type, data);
133  }

◆ integrate() [1/3]

template<typename T >
virtual MoFEMErrorCode OpAssembleBasic< T >::integrate ( EntData data)
inlinevirtual

◆ integrate() [2/3]

template<typename T >
virtual MoFEMErrorCode OpAssembleBasic< T >::integrate ( EntData row_data,
EntData col_data 
)
inlinevirtual

◆ integrate() [3/3]

template<typename T >
virtual MoFEMErrorCode OpAssembleBasic< T >::integrate ( int  row_side,
EntityType  row_type,
EntData data 
)
inlinevirtual

Definition at line 72 of file EshelbianOperators.hpp.

73  {
75  CHKERR integrate(data);
77  }

Member Data Documentation

◆ assembleSymmetry

template<typename T >
const bool OpAssembleBasic< T >::assembleSymmetry

Definition at line 43 of file EshelbianOperators.hpp.

◆ dataAtPts

template<typename T >
boost::shared_ptr<DataAtIntegrationPts> OpAssembleBasic< T >::dataAtPts

data at integration pts

Definition at line 46 of file EshelbianOperators.hpp.

◆ K

template<typename T >
MatrixDouble OpAssembleBasic< T >::K

local tangent matrix

Definition at line 61 of file EshelbianOperators.hpp.

◆ nF

template<typename T >
VectorDouble OpAssembleBasic< T >::nF

local right hand side vector

Definition at line 60 of file EshelbianOperators.hpp.

◆ scaleOff

template<typename T >
ScaleOff OpAssembleBasic< T >::scaleOff

Definition at line 64 of file EshelbianOperators.hpp.

◆ transposeK

template<typename T >
MatrixDouble OpAssembleBasic< T >::transposeK

Definition at line 62 of file EshelbianOperators.hpp.


The documentation for this struct was generated from the following file:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
OpAssembleBasic::K
MatrixDouble K
local tangent matrix
Definition: EshelbianOperators.hpp:61
OpAssembleBasic::assembleSymmetry
const bool assembleSymmetry
Definition: EshelbianOperators.hpp:43
OpAssembleBasic::dataAtPts
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
Definition: EshelbianOperators.hpp:46
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1589
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
OpAssembleBasic::transposeK
MatrixDouble transposeK
Definition: EshelbianOperators.hpp:62
convert.type
type
Definition: convert.py:64
MoFEM::EntitiesFieldData::EntData::getIndices
const VectorInt & getIndices() const
Get global indices of dofs on entity.
Definition: EntitiesFieldData.hpp:1214
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
OpAssembleBasic::nF
VectorDouble nF
local right hand side vector
Definition: EshelbianOperators.hpp:60
OpAssembleBasic::assemble
virtual MoFEMErrorCode assemble(EntData &data)
Definition: EshelbianOperators.hpp:79
OpAssembleBasic::scaleOff
ScaleOff scaleOff
Definition: EshelbianOperators.hpp:64
OpAssembleBasic::integrate
virtual MoFEMErrorCode integrate(EntData &data)
Definition: EshelbianOperators.hpp:66
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359