v0.15.5
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/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)
 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.
 

Public Attributes

FTensor::Index< 'i', SPACE_DIMi
 summit Index
 
- 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.
 

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>
FTensor::Tensor1< FTensor::PackPtr< double *, DIM >, DIM > 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 &data)
 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)>
 
- 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 240 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 243 of file BiLinearFormsIntegratorsImpl.hpp.

247 : OpBase(row_field_name, col_field_name, OpBase::OPROWCOL, ents_ptr),
248 matD(mat_D) {
249 if (row_field_name == col_field_name)
250 this->sYmm = true;
251 }
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 943 of file BiLinearFormsIntegratorsImpl.hpp.

945 {
947
949
954
955 auto &row_hessian = row_data.getN(BaseDerivatives::SecondDerivative);
956 auto &col_hessian = col_data.getN(BaseDerivatives::SecondDerivative);
957
958#ifndef NDEBUG
959 if (row_hessian.size1() != OpBase::nbIntegrationPts) {
960 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
961 "Wrong number of integration pts (%d != %d)",
962 row_hessian.size1(), OpBase::nbIntegrationPts);
963 }
964 if (row_hessian.size2() !=
966 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
967 "Wrong number of base functions (%d != %d)",
968 row_hessian.size2() / (SPACE_DIM * SPACE_DIM),
970 }
971 if (row_hessian.size2() < OpBase::nbRows * SPACE_DIM * SPACE_DIM) {
972 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
973 "Wrong number of base functions (%d < %d)", row_hessian.size2(),
975 }
976 if (col_hessian.size1() != OpBase::nbIntegrationPts) {
977 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
978 "Wrong number of integration pts (%d != %d)",
979 col_hessian.size1(), OpBase::nbIntegrationPts);
980 }
981 if (col_hessian.size2() < OpBase::nbCols * SPACE_DIM * SPACE_DIM) {
982 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
983 "Wrong number of base functions (%d < %d)", col_hessian.size2(),
985 }
986#endif
987
988 // get element volume
989 double vol = OpBase::getMeasure();
990
991 // get intergrayion weights
992 auto t_w = OpBase::getFTensor0IntegrationWeight();
993
994 auto t_row_diff2 = getFTensor2SymmetricLowerFromPtr<SPACE_DIM>(
995 &*row_hessian.data().begin());
996
997 // Elastic stiffness tensor (4th rank tensor with minor and major
998 // symmetry)
999 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, S>(*matD);
1000
1001 // iterate over integration points
1002 for (int gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
1003
1004 // calculate scalar weight times element volume
1005 double a = t_w * vol;
1006
1007 // get sub matrix for the row
1008 auto m_ptr = &*OpBase::locMat.data().begin();
1009
1010 // iterate over row base functions
1011 int rr = 0;
1012 for (; rr != OpBase::nbRows; ++rr) {
1013
1015 t_rowD(k, l) = t_D(i, j, k, l) * (a * t_row_diff2(i, j));
1016
1017 // get derivatives of base functions for columns
1018 auto t_col_diff2 =
1019 getFTensor2SymmetricLowerFromPtr<SPACE_DIM>(&col_hessian(gg, 0));
1020
1021 // iterate column base functions
1022 for (int cc = 0; cc != OpBase::nbCols; ++cc) {
1023
1024 // integrate block local stiffens matrix
1025 *m_ptr += t_rowD(i, j) * t_col_diff2(i, j);
1026
1027 // move to next column base function
1028 ++t_col_diff2;
1029
1030 // move to next block of local stiffens matrix
1031 ++m_ptr;
1032 }
1033
1034 // move to next row base function
1035 ++t_row_diff2;
1036 }
1037
1038 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
1039 ++t_row_diff2;
1040
1041 // move to next integration weight
1042 ++t_w;
1043 ++t_D;
1044 }
1045 }
1046
1048}
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 ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
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 242 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 254 of file BiLinearFormsIntegratorsImpl.hpp.


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