v0.14.0
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 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
 
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
 
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::OpGradTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >

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

183  : OpBase(row_field_name, col_field_name, OpBase::OPROWCOL), matD(mat_D),
184  betaCoeff(beta) {}

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

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

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 188 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 178 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 187 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
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
FTensor::Tensor3
Definition: Tensor3_value.hpp:12
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
a
constexpr double a
Definition: approx_sphere.cpp:30
MoFEM::OpGradTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >::betaCoeff
ScalarFun betaCoeff
Definition: BiLinearFormsIntegrators.hpp:188
MoFEM::OpGradTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >::i
FTensor::Index< 'i', SPACE_DIM > i
summit Index
Definition: BiLinearFormsIntegrators.hpp:178
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
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
MoFEM::OpGradTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >::matD
boost::shared_ptr< MatrixDouble > matD
Definition: BiLinearFormsIntegrators.hpp:187
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