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

#include <src/finite_elements/BiLinearFormsIntegrators.hpp>

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

Public Member Functions

 OpGradTensorGradImpl (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< MatrixDouble > mat_D, ScalarFun beta=scalar_fun_one)
 
- 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
 
ScalarFun betaCoeff
 
- 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::OpGradTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >

Definition at line 159 of file BiLinearFormsIntegrators.hpp.

Constructor & Destructor Documentation

◆ OpGradTensorGradImpl()

template<int SPACE_DIM, int S, typename OpBase >
MoFEM::OpGradTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >::OpGradTensorGradImpl ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< MatrixDouble mat_D,
ScalarFun  beta = scalar_fun_one 
)
inline

Definition at line 162 of file BiLinearFormsIntegrators.hpp.

166 : OpBase(row_field_name, col_field_name, OpBase::OPROWCOL), matD(mat_D),
167 betaCoeff(beta) {}
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29

Member Function Documentation

◆ iNtegrate()

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

1104 {
1106
1107 const size_t nb_row_dofs = row_data.getIndices().size();
1108 const size_t nb_col_dofs = col_data.getIndices().size();
1109
1110 if (nb_row_dofs && nb_col_dofs) {
1111
1116
1117 // get element volume
1118 double vol = OpBase::getMeasure();
1119
1120 // get intergrayion weights
1121 auto t_w = OpBase::getFTensor0IntegrationWeight();
1122
1123 // get derivatives of base functions on rows
1124 auto t_row_diff_base = row_data.getFTensor1DiffN<SPACE_DIM>();
1125
1126 // stiffness tensor (4th rank tensor)
1127 auto t_D =
1128 getFTensor4FromMat<SPACE_DIM, SPACE_DIM, SPACE_DIM, SPACE_DIM, S>(
1129 *matD);
1130
1131 // get coordinate at integration points
1132 auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
1133
1134 // iterate over integration points
1135 for (int gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
1136
1137 // calculate scalar weight times element volume
1138 double a = t_w * vol * betaCoeff(t_coords(0), t_coords(1), t_coords(2));
1139
1140 // iterate over row base functions
1141 int rr = 0;
1142 for (; rr != OpBase::nbRows / SPACE_DIM; ++rr) {
1143
1144 // get sub matrix for the row
1145 auto t_m = OpBase::template getLocMat<SPACE_DIM>(SPACE_DIM * rr);
1146
1147 // get derivatives of base functions for columns
1148 auto t_col_diff_base = col_data.getFTensor1DiffN<SPACE_DIM>(gg, 0);
1149
1150 // iterate column base functions
1151 for (int cc = 0; cc != OpBase::nbCols / SPACE_DIM; ++cc) {
1152
1153 // integrate block local stiffens matrix
1154 t_m(i, k) +=
1155 a * (t_D(i, j, k, l) * (t_row_diff_base(j) * t_col_diff_base(l)));
1156
1157 // move to next column base function
1158 ++t_col_diff_base;
1159
1160 // move to next block of local stiffens matrix
1161 ++t_m;
1162 }
1163
1164 // move to next row base function
1165 ++t_row_diff_base;
1166 }
1167
1168 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
1169 ++t_row_diff_base;
1170
1171 // move to next integration weight
1172 ++t_w;
1173 ++t_D;
1174 ++t_coords;
1175 }
1176 }
1177
1179}
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
#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
int nbCols
number if dof on column
int nbRowBaseFunctions
number or row base functions

Member Data Documentation

◆ betaCoeff

template<int SPACE_DIM, int S, typename OpBase >
ScalarFun MoFEM::OpGradTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >::betaCoeff
protected

Definition at line 171 of file BiLinearFormsIntegrators.hpp.

◆ i

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

summit Index

Definition at line 161 of file BiLinearFormsIntegrators.hpp.

◆ matD

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

Definition at line 170 of file BiLinearFormsIntegrators.hpp.


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