v0.15.0
Loading...
Searching...
No Matches
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), 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 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) {}

◆ OpAssembleBasic() [3/3]

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

Definition at line 60 of file EshelbianOperators.hpp.

61 : 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 82 of file EshelbianOperators.hpp.

82 {
84 double *vec_ptr = &*nF.begin();
85 int nb_dofs = data.getIndices().size();
86 int *ind_ptr = &*data.getIndices().begin();
87 CHKERR VecSetValues(this->getTSf(), nb_dofs, ind_ptr, vec_ptr, ADD_VALUES);
89 }
#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 dofs 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 91 of file EshelbianOperators.hpp.

92 {
94 CHKERR assemble(data);
96 }
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 104 of file EshelbianOperators.hpp.

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

140 {
142 if (row_data.getIndices().empty())
144 if (col_data.getIndices().empty())
146 K.resize(row_data.getIndices().size(), col_data.getIndices().size(), false);
147 K.clear();
148 CHKERR integrate(row_data, col_data);
149 CHKERR assemble(row_side, col_side, row_type, col_type, row_data, col_data);
151 }
#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, and OpAssembleVolumeStabilize.

Definition at line 127 of file EshelbianOperators.hpp.

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

◆ integrate() [1/3]

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

◆ integrate() [2/3]

◆ integrate() [3/3]

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

Definition at line 75 of file EshelbianOperators.hpp.

76 {
78 CHKERR integrate(data);
80 }

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

◆ nF

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

local right hand side vector

Definition at line 63 of file EshelbianOperators.hpp.

◆ scaleOff

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

Definition at line 67 of file EshelbianOperators.hpp.

◆ transposeK

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

Definition at line 65 of file EshelbianOperators.hpp.


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