v0.16.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 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/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 48 of file EshelbianOperators.hpp.

51 : T(field_name, type), assembleSymmetry(false), dataAtPts(data_ptr) {}
std::string type
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 53 of file EshelbianOperators.hpp.

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

◆ OpAssembleBasic() [3/3]

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

Definition at line 61 of file EshelbianOperators.hpp.

62 : 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 83 of file EshelbianOperators.hpp.

83 {
85 double *vec_ptr = nF.data().data();
86 int nb_dofs = data.getIndices().size();
87 int *ind_ptr = data.getIndices().data().data();
88 CHKERR VecSetValues(this->getTSf(), nb_dofs, ind_ptr, vec_ptr, ADD_VALUES);
90 }
#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 92 of file EshelbianOperators.hpp.

93 {
95 CHKERR assemble(data);
97 }
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 105 of file EshelbianOperators.hpp.

107 {
109
110 if (assembleSymmetry) {
111 const auto row_nb_dofs = row_data.getIndices().size();
112 const auto col_nb_dofs = col_data.getIndices().size();
113 transposeK.resize(col_nb_dofs, row_nb_dofs, false);
114 noalias(transposeK) = trans(K);
115 transposeK *= scaleOff();
116 }
117
118 CHKERR MatSetValues<AssemblyTypeSelector<A>>(this->getTSB(), row_data,
119 col_data, K, ADD_VALUES);
120 if (assembleSymmetry) {
121 CHKERR MatSetValues<AssemblyTypeSelector<A>>(
122 this->getTSB(), col_data, row_data, transposeK, ADD_VALUES);
123 }
124
126 }
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 139 of file EshelbianOperators.hpp.

141 {
143 if (row_data.getIndices().empty())
145 if (col_data.getIndices().empty())
147 K.resize(row_data.getIndices().size(), col_data.getIndices().size(), false);
148 K.clear();
149 CHKERR integrate(row_data, col_data);
150 CHKERR assemble(row_side, col_side, row_type, col_type, row_data, col_data);
152 }
#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 128 of file EshelbianOperators.hpp.

128 {
130 if (data.getIndices().empty())
132 nF.resize(data.getIndices().size(), false);
133 nF.clear();
134 CHKERR integrate(side, type, data);
135 CHKERR assemble(side, type, data);
137 }

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

77 {
79 CHKERR integrate(data);
81 }

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

◆ nF

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

local right hand side vector

Definition at line 64 of file EshelbianOperators.hpp.

◆ scaleOff

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

Definition at line 68 of file EshelbianOperators.hpp.

◆ transposeK

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

Definition at line 66 of file EshelbianOperators.hpp.


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