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/BiLinearFormsIntegratorsImpl.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 234 of file BiLinearFormsIntegratorsImpl.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 237 of file BiLinearFormsIntegratorsImpl.hpp.

241  : OpBase(row_field_name, col_field_name, OpBase::OPROWCOL, ents_ptr),
242  matD(mat_D) {
243  if (row_field_name == col_field_name)
244  this->sYmm = true;
245  }

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 937 of file BiLinearFormsIntegratorsImpl.hpp.

939  {
941 
943 
948 
949  auto &row_hessian = row_data.getN(BaseDerivatives::SecondDerivative);
950  auto &col_hessian = col_data.getN(BaseDerivatives::SecondDerivative);
951 
952 #ifndef NDEBUG
953  if (row_hessian.size1() != OpBase::nbIntegrationPts) {
954  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
955  "Wrong number of integration pts (%d != %d)",
956  row_hessian.size1(), OpBase::nbIntegrationPts);
957  }
958  if (row_hessian.size2() !=
960  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
961  "Wrong number of base functions (%d != %d)",
962  row_hessian.size2() / (SPACE_DIM * SPACE_DIM),
964  }
965  if (row_hessian.size2() < OpBase::nbRows * SPACE_DIM * SPACE_DIM) {
966  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
967  "Wrong number of base functions (%d < %d)", row_hessian.size2(),
969  }
970  if (col_hessian.size1() != OpBase::nbIntegrationPts) {
971  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
972  "Wrong number of integration pts (%d != %d)",
973  col_hessian.size1(), OpBase::nbIntegrationPts);
974  }
975  if (col_hessian.size2() < OpBase::nbCols * SPACE_DIM * SPACE_DIM) {
976  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
977  "Wrong number of base functions (%d < %d)", col_hessian.size2(),
979  }
980 #endif
981 
982  // get element volume
983  double vol = OpBase::getMeasure();
984 
985  // get intergrayion weights
986  auto t_w = OpBase::getFTensor0IntegrationWeight();
987 
988  auto t_row_diff2 = getFTensor2SymmetricLowerFromPtr<SPACE_DIM>(
989  &*row_hessian.data().begin());
990 
991  // Elastic stiffness tensor (4th rank tensor with minor and major
992  // symmetry)
993  auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, S>(*matD);
994 
995  // iterate over integration points
996  for (int gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
997 
998  // calculate scalar weight times element volume
999  double a = t_w * vol;
1000 
1001  // get sub matrix for the row
1002  auto m_ptr = &*OpBase::locMat.data().begin();
1003 
1004  // iterate over row base functions
1005  int rr = 0;
1006  for (; rr != OpBase::nbRows; ++rr) {
1007 
1009  t_rowD(k, l) = t_D(i, j, k, l) * (a * t_row_diff2(i, j));
1010 
1011  // get derivatives of base functions for columns
1012  auto t_col_diff2 =
1013  getFTensor2SymmetricLowerFromPtr<SPACE_DIM>(&col_hessian(gg, 0));
1014 
1015  // iterate column base functions
1016  for (int cc = 0; cc != OpBase::nbCols; ++cc) {
1017 
1018  // integrate block local stiffens matrix
1019  *m_ptr += t_rowD(i, j) * t_col_diff2(i, j);
1020 
1021  // move to next column base function
1022  ++t_col_diff2;
1023 
1024  // move to next block of local stiffens matrix
1025  ++m_ptr;
1026  }
1027 
1028  // move to next row base function
1029  ++t_row_diff2;
1030  }
1031 
1032  for (; rr < OpBase::nbRowBaseFunctions; ++rr)
1033  ++t_row_diff2;
1034 
1035  // move to next integration weight
1036  ++t_w;
1037  ++t_D;
1038  }
1039  }
1040 
1042 }

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 236 of file BiLinearFormsIntegratorsImpl.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 248 of file BiLinearFormsIntegratorsImpl.hpp.


The documentation for this struct was generated from the following file:
MoFEM::OpBaseImpl::nbIntegrationPts
int nbIntegrationPts
number of integration points
Definition: FormsIntegrators.hpp:238
MoFEM::OpBaseImpl::locMat
MatrixDouble locMat
local entity block matrix
Definition: FormsIntegrators.hpp:249
MoFEM::OpGradGradSymTensorGradGradImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >::i
FTensor::Index< 'i', SPACE_DIM > i
summit Index
Definition: BiLinearFormsIntegratorsImpl.hpp:236
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:239
MoFEM::OpBaseImpl::nbCols
int nbCols
number if dof on column
Definition: FormsIntegrators.hpp:237
MoFEM::OpBaseImpl::nbRows
int nbRows
number of dofs on rows
Definition: FormsIntegrators.hpp:236
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: BiLinearFormsIntegratorsImpl.hpp:248
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:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21