v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MoFEM::OpGradGradSymTensorGradGradImpl< 1, FIELD_DIM, SPACE_DIM, S, GAUSS, OpBase > Struct Template Reference

#include "src/finite_elements/BiLinearFormsIntegratorsImpl.hpp"

Inheritance diagram for MoFEM::OpGradGradSymTensorGradGradImpl< 1, FIELD_DIM, SPACE_DIM, S, GAUSS, OpBase >:
[legend]
Collaboration diagram for MoFEM::OpGradGradSymTensorGradGradImpl< 1, FIELD_DIM, SPACE_DIM, S, GAUSS, OpBase >:
[legend]

Public Member Functions

 OpGradGradSymTensorGradGradImpl (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< MatrixDouble > mat_D, boost::shared_ptr< Range > ents_ptr=nullptr)
 
- Public Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
 OpBaseImpl (const std::string row_field_name, const std::string col_field_name, const OpType type, boost::shared_ptr< Range > ents_ptr=nullptr)
 Constructor for base operator implementation.
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 Do calculations for the left hand side.
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntData &row_data)
 Do calculations for the right hand side.
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 Integrate grad-grad operator.
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
template<int DIM>
auto getNf ()
 Get local vector tensor for assembly.
 
template<int DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, DIM >, DIM, DIM > getLocMat (const int rr)
 Get local matrix tensor for assembly.
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 Assemble local matrix into global matrix.
 
virtual MoFEMErrorCode iNtegrate (EntData &)
 Class dedicated to integrate operator.
 
virtual MoFEMErrorCode aSsemble (EntData &data)
 Assemble local vector into global vector.
 
virtual size_t getNbOfBaseFunctions (EntitiesFieldData::EntData &data)
 Get number of base functions.
 

Protected Attributes

boost::shared_ptr< MatrixDoublematD
 
- Protected Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
int nbRows
 number of dofs on rows
 
int nbCols
 number if dof on column
 
int nbIntegrationPts
 number of integration points
 
int nbRowBaseFunctions
 number or row base functions
 
int rowSide
 row side number
 
int colSide
 column side number
 
EntityType rowType
 row type
 
EntityType colType
 column type
 
bool assembleTranspose
 
bool onlyTranspose
 
MatrixDouble locMat
 local entity block matrix
 
MatrixDouble locMatTranspose
 local entity block matrix
 
VectorDouble locF
 local entity vector
 

Additional Inherited Members

- Public Types inherited from MoFEM::OpBaseImpl< A, EleOp >
using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 
using MatSetValuesHook = boost::function< MoFEMErrorCode(ForcesAndSourcesCore::UserDataOperator *op_ptr, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, MatrixDouble &m)>
 
- Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
TimeFun timeScalingFun
 assumes that time variable is set
 
FEFun feScalingFun
 set by fe entity handle
 
boost::shared_ptr< RangeentsPtr
 Entities on which element is run.
 
- Static Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
static MatSetValuesHook matSetValuesHook
 

Detailed Description

template<int FIELD_DIM, int SPACE_DIM, int S, typename OpBase>
struct MoFEM::OpGradGradSymTensorGradGradImpl< 1, FIELD_DIM, SPACE_DIM, S, GAUSS, OpBase >

Definition at line 256 of file BiLinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpGradGradSymTensorGradGradImpl()

template<int FIELD_DIM, int SPACE_DIM, int S, typename OpBase >
MoFEM::OpGradGradSymTensorGradGradImpl< 1, FIELD_DIM, SPACE_DIM, S, GAUSS, OpBase >::OpGradGradSymTensorGradGradImpl ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< MatrixDouble mat_D,
boost::shared_ptr< Range ents_ptr = nullptr 
)
inline

Definition at line 258 of file BiLinearFormsIntegratorsImpl.hpp.

262 : OpBase(row_field_name, col_field_name, OpBase::OPROWCOL, ents_ptr),
263 matD(mat_D) {
264 if (row_field_name == col_field_name)
265 this->sYmm = true;
266 }
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition radiation.cpp:29

Member Function Documentation

◆ iNtegrate()

template<int FIELD_DIM, int SPACE_DIM, int S, typename OpBase >
MoFEMErrorCode MoFEM::OpGradGradSymTensorGradGradImpl< 1, FIELD_DIM, SPACE_DIM, S, GAUSS, OpBase >::iNtegrate ( EntitiesFieldData::EntData ,
EntitiesFieldData::EntData  
)
protectedvirtual

Integrate grad-grad operator.

Parameters
row_datarow data (consist base functions on row entity)
col_datacolumn data (consist base functions on column entity)
Returns
error code

Reimplemented from MoFEM::OpBaseImpl< A, EleOp >.

Definition at line 1027 of file BiLinearFormsIntegratorsImpl.hpp.

1029 {
1031
1033
1040
1041 auto &row_hessian = row_data.getN(BaseDerivatives::SecondDerivative);
1042 auto &col_hessian = col_data.getN(BaseDerivatives::SecondDerivative);
1043
1044#ifndef NDEBUG
1045 if (row_hessian.size1() != OpBase::nbIntegrationPts) {
1046 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1047 "Wrong number of integration pts (%zu != %d)", row_hessian.size1(),
1049 }
1050 if (row_hessian.size2() !=
1052 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1053 "Wrong number of base functions (%zu != %d)",
1054 row_hessian.size2() / (SPACE_DIM * SPACE_DIM),
1056 }
1057 if (row_hessian.size2() < OpBase::nbRows * SPACE_DIM * SPACE_DIM) {
1058 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1059 "Wrong number of base functions (%zu < %d)", row_hessian.size2(),
1061 }
1062 if (col_hessian.size1() != OpBase::nbIntegrationPts) {
1063 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1064 "Wrong number of integration pts (%zu != %d)", col_hessian.size1(),
1066 }
1067 if (col_hessian.size2() < OpBase::nbCols * SPACE_DIM * SPACE_DIM) {
1068 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1069 "Wrong number of base functions (%zu < %d)", col_hessian.size2(),
1071 }
1072#endif
1073
1074 // get element volume
1075 double vol = OpBase::getMeasure();
1076
1077 // get intergrayion weights
1078 auto t_w = OpBase::getFTensor0IntegrationWeight();
1079
1080 auto t_row_diff2 = getFTensor2SymmetricLowerFromPtr<SPACE_DIM>(
1081 &*row_hessian.data().begin());
1082
1083 // Elastic stiffness tensor (4th rank tensor with minor and major
1084 // symmetry)
1085 using DL = DataLayoutTraits<DataLayout::GaussByCoeffs>;
1086 auto get_D_at_pts =
1087 MatrixSizeHelper<GetFTensor4DdgFromMatType<SPACE_DIM, SPACE_DIM, S, DL>,
1089 auto t_D_at_pts = get_D_at_pts();
1091
1092 // iterate over integration points
1093 for (int gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
1094
1095 // calculate scalar weight times element volume
1096 double a = t_w * vol;
1097
1098 // iterate over row base functions
1099 int rr = 0;
1100 for (; rr != OpBase::nbRows; ++rr) {
1101
1102 auto t_mat = getFTensor2FromPtr<FIELD_DIM, FIELD_DIM, FIELD_DIM>(
1103 &OpBase::locMat(rr, 0));
1104
1106 t_rowD(k, l) = t_D_at_pts(i, j, k, l) * (a * t_row_diff2(i, j));
1107
1108 // get derivatives of base functions for columns
1109 auto t_col_diff2 =
1110 getFTensor2SymmetricLowerFromPtr<SPACE_DIM>(&col_hessian(gg, 0));
1111
1112 // iterate column base functions
1113 for (int cc = 0; cc != OpBase::nbCols; ++cc) {
1114
1115 // integrate block local stiffens matrix
1116 t_mat(I, J) += (t_rowD(i, j) * t_col_diff2(i, j)) * t_kd(I, J);
1117
1118 // move to next column base function
1119 ++t_col_diff2;
1120
1121 // move to next block of local stiffens matrix
1122 ++t_mat;
1123 }
1124
1125 // move to next row base function
1126 ++t_row_diff2;
1127 }
1128
1129 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
1130 ++t_row_diff2;
1131
1132 // move to next integration weight
1133 ++t_w;
1134 ++t_D_at_pts;
1135 }
1136 }
1137
1139}
constexpr double a
constexpr int SPACE_DIM
constexpr int FIELD_DIM
Kronecker Delta class.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
constexpr auto t_kd
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
Definition MatHuHu.hpp:33
constexpr IntegrationType I
int nbRows
number of dofs on rows
int nbIntegrationPts
number of integration points
MatrixDouble locMat
local entity block matrix
int nbCols
number if dof on column
int nbRowBaseFunctions
number or row base functions

Member Data Documentation

◆ matD

template<int FIELD_DIM, int SPACE_DIM, int S, typename OpBase >
boost::shared_ptr<MatrixDouble> MoFEM::OpGradGradSymTensorGradGradImpl< 1, FIELD_DIM, SPACE_DIM, S, GAUSS, OpBase >::matD
protected

Definition at line 269 of file BiLinearFormsIntegratorsImpl.hpp.


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