v0.15.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
OpAssembleBasic< T > Struct Template Reference

#include "users_modules/eshelbian_plasticity/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;})
 
 OpAssembleBasic (const FieldSpace space)
 
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
 
VectorDouble nF
 local right hand side vector
 
MatrixDouble K
 local tangent matrix
 
MatrixDouble transposeK
 
ScaleOff scaleOff
 

Detailed Description

template<typename T>
struct OpAssembleBasic< T >

Definition at line 38 of file EshelbianOperators.hpp.

Member Typedef Documentation

◆ ScaleOff

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

Definition at line 40 of file EshelbianOperators.hpp.

Constructor & Destructor Documentation

◆ OpAssembleBasic() [1/3]

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

Definition at line 46 of file EshelbianOperators.hpp.

49 : T(field_name, type), dataAtPts(data_ptr), assembleSymmetry(false) {}
constexpr auto field_name
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts

◆ OpAssembleBasic() [2/3]

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 51 of file EshelbianOperators.hpp.

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

◆ OpAssembleBasic() [3/3]

template<typename T >
OpAssembleBasic< T >::OpAssembleBasic ( const FieldSpace  space)
inline

Definition at line 58 of file EshelbianOperators.hpp.

59 : T(space, T::OPSPACE), assembleSymmetry(false) {}

Member Function Documentation

◆ assemble() [1/3]

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

Definition at line 80 of file EshelbianOperators.hpp.

80 {
82 double *vec_ptr = &*nF.begin();
83 int nb_dofs = data.getIndices().size();
84 int *ind_ptr = &*data.getIndices().begin();
85 CHKERR VecSetValues(this->getTSf(), nb_dofs, ind_ptr, vec_ptr, ADD_VALUES);
87 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
const VectorInt & getIndices() const
Get global indices of degrees of freedom on entity.
VectorDouble nF
local right hand side vector

◆ assemble() [2/3]

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

Definition at line 89 of file EshelbianOperators.hpp.

90 {
92 CHKERR assemble(data);
94 }
virtual MoFEMErrorCode assemble(EntData &data)

◆ 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

Reimplemented in OpAssembleVolume.

Definition at line 102 of file EshelbianOperators.hpp.

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

◆ 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

Reimplemented in OpAssembleVolumePositiveDefine.

Definition at line 136 of file EshelbianOperators.hpp.

138 {
140 if (row_data.getIndices().empty())
142 if (col_data.getIndices().empty())
144 K.resize(row_data.getIndices().size(), col_data.getIndices().size(), false);
145 K.clear();
146 CHKERR integrate(row_data, col_data);
147 CHKERR assemble(row_side, col_side, row_type, col_type, row_data, col_data);
149 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
virtual MoFEMErrorCode integrate(EntData &data)

◆ doWork() [2/2]

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

Reimplemented in OpAssembleVolumePositiveDefine.

Definition at line 125 of file EshelbianOperators.hpp.

125 {
127 if (data.getIndices().empty())
129 nF.resize(data.getIndices().size(), false);
130 nF.clear();
131 CHKERR integrate(side, type, data);
132 CHKERR assemble(side, type, data);
134 }

◆ 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 73 of file EshelbianOperators.hpp.

74 {
76 CHKERR integrate(data);
78 }

Member Data Documentation

◆ assembleSymmetry

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

Definition at line 41 of file EshelbianOperators.hpp.

◆ dataAtPts

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

data at integration pts

Definition at line 44 of file EshelbianOperators.hpp.

◆ K

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

local tangent matrix

Definition at line 62 of file EshelbianOperators.hpp.

◆ nF

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

local right hand side vector

Definition at line 61 of file EshelbianOperators.hpp.

◆ scaleOff

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

Definition at line 65 of file EshelbianOperators.hpp.

◆ transposeK

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

Definition at line 63 of file EshelbianOperators.hpp.


The documentation for this struct was generated from the following file: