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

#include <src/finite_elements/BiLinearFormsIntegrators.hpp>

Inheritance diagram for MoFEM::OpGradGradSymTensorGradGradImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >:
[legend]
Collaboration diagram for MoFEM::OpGradGradSymTensorGradGradImpl< 1, 1, 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)
 
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. More...
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntData &row_data)
 Do calculations for the right hand side. More...
 

Public Attributes

FTensor::Index< 'i', SPACE_DIMi
 summit Index More...
 
- Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
TimeFun timeScalingFun
 assumes that time variable is set More...
 
FEFun feScalingFun
 assumes that time variable is set More...
 
boost::shared_ptr< RangeentsPtr
 Entities on which element is run. More...
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 Integrate grad-grad operator. More...
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
template<int DIM>
FTensor::Tensor1< FTensor::PackPtr< double *, DIM >, DIM > getNf ()
 
template<int DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, DIM >, DIM, DIM > getLocMat (const int rr)
 
virtual MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 Integrate grad-grad operator. More...
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 
virtual MoFEMErrorCode iNtegrate (EntData &data)
 Class dedicated to integrate operator. More...
 
virtual MoFEMErrorCode aSsemble (EntData &data)
 

Protected Attributes

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

Additional Inherited Members

- Public Types inherited from MoFEM::OpBaseImpl< A, EleOp >
using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 

Detailed Description

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

Definition at line 181 of file BiLinearFormsIntegrators.hpp.

Constructor & Destructor Documentation

◆ OpGradGradSymTensorGradGradImpl()

template<int SPACE_DIM, int S, typename OpBase >
MoFEM::OpGradGradSymTensorGradGradImpl< 1, 1, 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 184 of file BiLinearFormsIntegrators.hpp.

188 : OpBase(row_field_name, col_field_name, OpBase::OPROWCOL, ents_ptr),
189 matD(mat_D) {
190 if (row_field_name == col_field_name)
191 this->sYmm = true;
192 }
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29

Member Function Documentation

◆ iNtegrate()

template<int SPACE_DIM, int S, typename OpBase >
MoFEMErrorCode MoFEM::OpGradGradSymTensorGradGradImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >::iNtegrate ( EntitiesFieldData::EntData row_data,
EntitiesFieldData::EntData col_data 
)
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 993 of file BiLinearFormsIntegrators.hpp.

995 {
997
999
1004
1005 auto &row_hessian = row_data.getN(BaseDerivatives::SecondDerivative);
1006 auto &col_hessian = col_data.getN(BaseDerivatives::SecondDerivative);
1007
1008#ifndef NDEBUG
1009 if (row_hessian.size1() != OpBase::nbIntegrationPts) {
1010 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1011 "Wrong number of integration pts (%d != %d)",
1012 row_hessian.size1(), OpBase::nbIntegrationPts);
1013 }
1014 if (row_hessian.size2() !=
1016 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1017 "Wrong number of base functions (%d != %d)",
1018 row_hessian.size2() / (SPACE_DIM * SPACE_DIM),
1020 }
1021 if (row_hessian.size2() < OpBase::nbRows * SPACE_DIM * SPACE_DIM) {
1022 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1023 "Wrong number of base functions (%d < %d)", row_hessian.size2(),
1025 }
1026 if (col_hessian.size1() != OpBase::nbIntegrationPts) {
1027 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1028 "Wrong number of integration pts (%d != %d)",
1029 col_hessian.size1(), OpBase::nbIntegrationPts);
1030 }
1031 if (col_hessian.size2() < OpBase::nbCols * SPACE_DIM * SPACE_DIM) {
1032 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1033 "Wrong number of base functions (%d < %d)", col_hessian.size2(),
1035 }
1036#endif
1037
1038 // get element volume
1039 double vol = OpBase::getMeasure();
1040
1041 // get intergrayion weights
1042 auto t_w = OpBase::getFTensor0IntegrationWeight();
1043
1044 auto t_row_diff2 = getFTensor2SymmetricLowerFromPtr<SPACE_DIM>(
1045 &*row_hessian.data().begin());
1046
1047 // Elastic stiffness tensor (4th rank tensor with minor and major
1048 // symmetry)
1049 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, S>(*matD);
1050
1051 // iterate over integration points
1052 for (int gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
1053
1054 // calculate scalar weight times element volume
1055 double a = t_w * vol;
1056
1057 // get sub matrix for the row
1058 auto m_ptr = &*OpBase::locMat.data().begin();
1059
1060 // iterate over row base functions
1061 int rr = 0;
1062 for (; rr != OpBase::nbRows; ++rr) {
1063
1065 t_rowD(k, l) = t_D(i, j, k, l) * (a * t_row_diff2(i, j));
1066
1067 // get derivatives of base functions for columns
1068 auto t_col_diff2 =
1069 getFTensor2SymmetricLowerFromPtr<SPACE_DIM>(&col_hessian(gg, 0));
1070
1071 // iterate column base functions
1072 for (int cc = 0; cc != OpBase::nbCols; ++cc) {
1073
1074 // integrate block local stiffens matrix
1075 *m_ptr += t_rowD(i, j) * t_col_diff2(i, j);
1076
1077 // move to next column base function
1078 ++t_col_diff2;
1079
1080 // move to next block of local stiffens matrix
1081 ++m_ptr;
1082 }
1083
1084 // move to next row base function
1085 ++t_row_diff2;
1086 }
1087
1088 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
1089 ++t_row_diff2;
1090
1091 // move to next integration weight
1092 ++t_w;
1093 ++t_D;
1094 }
1095 }
1096
1098}
constexpr double a
constexpr int SPACE_DIM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
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

◆ i

template<int SPACE_DIM, int S, typename OpBase >
FTensor::Index<'i', SPACE_DIM> MoFEM::OpGradGradSymTensorGradGradImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >::i

summit Index

Definition at line 183 of file BiLinearFormsIntegrators.hpp.

◆ matD

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

Definition at line 195 of file BiLinearFormsIntegrators.hpp.


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