v0.14.0
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 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)
 
virtual size_t getNbOfBaseFunctions (EntitiesFieldData::EntData &data)
 Get number of base functions. More...
 

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
 
using MatSetValuesHook = boost::function< MoFEMErrorCode(ForcesAndSourcesCore::UserDataOperator *op_ptr, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, MatrixDouble &m)>
 
- Static Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
static MatSetValuesHook matSetValuesHook
 

Detailed Description

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

Definition at line 198 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 201 of file BiLinearFormsIntegrators.hpp.

205  : OpBase(row_field_name, col_field_name, OpBase::OPROWCOL, ents_ptr),
206  matD(mat_D) {
207  if (row_field_name == col_field_name)
208  this->sYmm = true;
209  }

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 987 of file BiLinearFormsIntegrators.hpp.

989  {
991 
993 
998 
999  auto &row_hessian = row_data.getN(BaseDerivatives::SecondDerivative);
1000  auto &col_hessian = col_data.getN(BaseDerivatives::SecondDerivative);
1001 
1002 #ifndef NDEBUG
1003  if (row_hessian.size1() != OpBase::nbIntegrationPts) {
1004  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1005  "Wrong number of integration pts (%d != %d)",
1006  row_hessian.size1(), OpBase::nbIntegrationPts);
1007  }
1008  if (row_hessian.size2() !=
1010  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1011  "Wrong number of base functions (%d != %d)",
1012  row_hessian.size2() / (SPACE_DIM * SPACE_DIM),
1014  }
1015  if (row_hessian.size2() < OpBase::nbRows * SPACE_DIM * SPACE_DIM) {
1016  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1017  "Wrong number of base functions (%d < %d)", row_hessian.size2(),
1019  }
1020  if (col_hessian.size1() != OpBase::nbIntegrationPts) {
1021  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1022  "Wrong number of integration pts (%d != %d)",
1023  col_hessian.size1(), OpBase::nbIntegrationPts);
1024  }
1025  if (col_hessian.size2() < OpBase::nbCols * SPACE_DIM * SPACE_DIM) {
1026  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1027  "Wrong number of base functions (%d < %d)", col_hessian.size2(),
1029  }
1030 #endif
1031 
1032  // get element volume
1033  double vol = OpBase::getMeasure();
1034 
1035  // get intergrayion weights
1036  auto t_w = OpBase::getFTensor0IntegrationWeight();
1037 
1038  auto t_row_diff2 = getFTensor2SymmetricLowerFromPtr<SPACE_DIM>(
1039  &*row_hessian.data().begin());
1040 
1041  // Elastic stiffness tensor (4th rank tensor with minor and major
1042  // symmetry)
1043  auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, S>(*matD);
1044 
1045  // iterate over integration points
1046  for (int gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
1047 
1048  // calculate scalar weight times element volume
1049  double a = t_w * vol;
1050 
1051  // get sub matrix for the row
1052  auto m_ptr = &*OpBase::locMat.data().begin();
1053 
1054  // iterate over row base functions
1055  int rr = 0;
1056  for (; rr != OpBase::nbRows; ++rr) {
1057 
1059  t_rowD(k, l) = t_D(i, j, k, l) * (a * t_row_diff2(i, j));
1060 
1061  // get derivatives of base functions for columns
1062  auto t_col_diff2 =
1063  getFTensor2SymmetricLowerFromPtr<SPACE_DIM>(&col_hessian(gg, 0));
1064 
1065  // iterate column base functions
1066  for (int cc = 0; cc != OpBase::nbCols; ++cc) {
1067 
1068  // integrate block local stiffens matrix
1069  *m_ptr += t_rowD(i, j) * t_col_diff2(i, j);
1070 
1071  // move to next column base function
1072  ++t_col_diff2;
1073 
1074  // move to next block of local stiffens matrix
1075  ++m_ptr;
1076  }
1077 
1078  // move to next row base function
1079  ++t_row_diff2;
1080  }
1081 
1082  for (; rr < OpBase::nbRowBaseFunctions; ++rr)
1083  ++t_row_diff2;
1084 
1085  // move to next integration weight
1086  ++t_w;
1087  ++t_D;
1088  }
1089  }
1090 
1092 }

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 200 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 212 of file BiLinearFormsIntegrators.hpp.


The documentation for this struct was generated from the following file:
MoFEM::OpBaseImpl::nbIntegrationPts
int nbIntegrationPts
number of integration points
Definition: FormsIntegrators.hpp:228
MoFEM::OpBaseImpl::locMat
MatrixDouble locMat
local entity block matrix
Definition: FormsIntegrators.hpp:239
MoFEM::OpGradGradSymTensorGradGradImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >::i
FTensor::Index< 'i', SPACE_DIM > i
summit Index
Definition: BiLinearFormsIntegrators.hpp:200
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::Index< 'i', SPACE_DIM >
MoFEM::OpBaseImpl::nbRowBaseFunctions
int nbRowBaseFunctions
number or row base functions
Definition: FormsIntegrators.hpp:229
MoFEM::OpBaseImpl::nbCols
int nbCols
number if dof on column
Definition: FormsIntegrators.hpp:227
MoFEM::OpBaseImpl::nbRows
int nbRows
number of dofs on rows
Definition: FormsIntegrators.hpp:226
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEM::OpGradGradSymTensorGradGradImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >::matD
boost::shared_ptr< MatrixDouble > matD
Definition: BiLinearFormsIntegrators.hpp:212
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21