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

#include "src/finite_elements/BiLinearFormsIntegratorsImpl.hpp"

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

Public Member Functions

 OpGradGradTensorGradGradImpl (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::OpGradGradTensorGradGradImpl< 1, FIELD_DIM, SPACE_DIM, S, GAUSS, OpBase >

Definition at line 279 of file BiLinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpGradGradTensorGradGradImpl()

template<int FIELD_DIM, int SPACE_DIM, int S, typename OpBase >
MoFEM::OpGradGradTensorGradGradImpl< 1, FIELD_DIM, SPACE_DIM, S, GAUSS, OpBase >::OpGradGradTensorGradGradImpl ( 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 281 of file BiLinearFormsIntegratorsImpl.hpp.

285 : OpBase(row_field_name, col_field_name, OpBase::OPROWCOL, ents_ptr),
286 matD(mat_D) {
287 if (row_field_name == col_field_name)
288 this->sYmm = true;
289 }
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::OpGradGradTensorGradGradImpl< 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 1143 of file BiLinearFormsIntegratorsImpl.hpp.

1145 {
1147
1149
1156
1157 auto &row_hessian = row_data.getN(BaseDerivatives::SecondDerivative);
1158 auto &col_hessian = col_data.getN(BaseDerivatives::SecondDerivative);
1159
1160#ifndef NDEBUG
1161 if (row_hessian.size1() != OpBase::nbIntegrationPts) {
1162 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1163 "Wrong number of integration pts (%zu != %d)", row_hessian.size1(),
1165 }
1166 if (row_hessian.size2() !=
1168 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1169 "Wrong number of base functions (%zu != %d)",
1170 row_hessian.size2() / (SPACE_DIM * SPACE_DIM),
1172 }
1173 if (row_hessian.size2() < OpBase::nbRows * SPACE_DIM * SPACE_DIM) {
1174 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1175 "Wrong number of base functions (%zu < %d)", row_hessian.size2(),
1177 }
1178 if (col_hessian.size1() != OpBase::nbIntegrationPts) {
1179 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1180 "Wrong number of integration pts (%zu != %d)", col_hessian.size1(),
1182 }
1183 if (col_hessian.size2() < OpBase::nbCols * SPACE_DIM * SPACE_DIM) {
1184 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1185 "Wrong number of base functions (%zu < %d)", col_hessian.size2(),
1187 }
1188#endif
1189
1190 // get element volume
1191 double vol = OpBase::getMeasure();
1192
1193 // get intergrayion weights
1194 auto t_w = OpBase::getFTensor0IntegrationWeight();
1195
1196 auto t_row_diff2 = getFTensor2SymmetricLowerFromPtr<SPACE_DIM>(
1197 &*row_hessian.data().begin());
1198
1199 // Elastic stiffness tensor
1200 using DL = DataLayoutTraits<DataLayout::GaussByCoeffs>;
1201 auto get_D_at_pts = MatrixSizeHelper<
1203 DL>,
1205 auto t_D_at_pts = get_D_at_pts();
1206
1207 constexpr auto t_kd = FTensor::Kronecker_Delta<double>();
1208
1209 // iterate over integration points
1210 for (int gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
1211
1212 // calculate scalar weight times element volume
1213 double a = t_w * vol;
1214
1215 // get sub matrix for the row
1216 auto m_ptr = &*OpBase::locMat.data().begin();
1217
1218 // iterate over row base functions
1219 int rr = 0;
1220 for (; rr != OpBase::nbRows; ++rr) {
1221
1223 t_rowD(k, l) = t_D_at_pts(i, j, k, l) * (a * t_row_diff2(i, j));
1224
1225 // get derivatives of base functions for columns
1226 auto t_col_diff2 =
1227 getFTensor2SymmetricLowerFromPtr<SPACE_DIM>(&col_hessian(gg, 0));
1228
1229 auto t_mat = getFTensor2FromPtr<FIELD_DIM, FIELD_DIM, FIELD_DIM>(
1230 &OpBase::locMat(FIELD_DIM * rr, 0));
1231
1232 // iterate column base functions
1233 for (int cc = 0; cc != OpBase::nbCols; ++cc) {
1234
1235 // integrate block local stiffens matrix
1236 t_mat(I, J) += (t_rowD(i, j) * t_col_diff2(i, j)) * t_kd(I, J);
1237
1238 // move to next column base function
1239 ++t_col_diff2;
1240
1241 // move to next block of local stiffens matrix
1242 ++t_mat;
1243 }
1244
1245 // move to next row base function
1246 ++t_row_diff2;
1247 }
1248
1249 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
1250 ++t_row_diff2;
1251
1252 // move to next integration weight
1253 ++t_w;
1254 ++t_D_at_pts;
1255 }
1256 }
1257
1259}
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
decltype(GetFTensor4FromMatImpl< Tensor_Dim0, Tensor_Dim1, Tensor_Dim2, Tensor_Dim3, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor4FromMatType
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::OpGradGradTensorGradGradImpl< 1, FIELD_DIM, SPACE_DIM, S, GAUSS, OpBase >::matD
protected

Definition at line 292 of file BiLinearFormsIntegratorsImpl.hpp.


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