v0.16.0
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/BiLinearFormsIntegratorsImpl.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)
 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>
auto 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 &)
 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
 
ScalarFun betaCoeff
 
- 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::OpGradTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >

Definition at line 234 of file BiLinearFormsIntegratorsImpl.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 237 of file BiLinearFormsIntegratorsImpl.hpp.

241 : OpBase(row_field_name, col_field_name, OpBase::OPROWCOL), matD(mat_D),
242 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 ,
EntitiesFieldData::EntData  
)
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 1263 of file BiLinearFormsIntegratorsImpl.hpp.

1265 {
1267
1268 const size_t nb_row_dofs = row_data.getIndices().size();
1269 const size_t nb_col_dofs = col_data.getIndices().size();
1270
1271 if (nb_row_dofs && nb_col_dofs) {
1272
1277
1278 // get element volume
1279 double vol = OpBase::getMeasure();
1280
1281 // get intergrayion weights
1282 auto t_w = OpBase::getFTensor0IntegrationWeight();
1283
1284 // get derivatives of base functions on rows
1285 auto t_row_diff_base = row_data.getFTensor1DiffN<SPACE_DIM>();
1286
1287 // stiffness tensor (4th rank tensor)
1288 using DL = DataLayoutTraits<DataLayout::GaussByCoeffs>;
1289 auto get_D_at_pts = MatrixSizeHelper<
1291 DL>,
1293 auto t_D_at_pts = get_D_at_pts();
1294
1295 // get coordinate at integration points
1296 auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
1297
1298 // iterate over integration points
1299 for (int gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
1300
1301 // calculate scalar weight times element volume
1302 double a = t_w * vol * betaCoeff(t_coords(0), t_coords(1), t_coords(2));
1303
1304 // iterate over row base functions
1305 int rr = 0;
1306 for (; rr != OpBase::nbRows / SPACE_DIM; ++rr) {
1307
1308 // get sub matrix for the row
1309 auto t_m = OpBase::template getLocMat<SPACE_DIM>(SPACE_DIM * rr);
1310
1311 // calculate row
1313 t_row(i, k, l) = t_D_at_pts(i, j, k, l) * (a * t_row_diff_base(j));
1314
1315 // get derivatives of base functions for columns
1316 auto t_col_diff_base = col_data.getFTensor1DiffN<SPACE_DIM>(gg, 0);
1317
1318 // iterate column base functions
1319 for (int cc = 0; cc != OpBase::nbCols / SPACE_DIM; ++cc) {
1320
1321 // integrate block local stiffens matrix
1322 t_m(i, k) += t_row(i, k, l) * t_col_diff_base(l);
1323
1324 // move to next column base function
1325 ++t_col_diff_base;
1326
1327 // move to next block of local stiffens matrix
1328 ++t_m;
1329 }
1330
1331 // move to next row base function
1332 ++t_row_diff_base;
1333 }
1334
1335 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
1336 ++t_row_diff_base;
1337
1338 // move to next integration weight
1339 ++t_w;
1340 ++t_D_at_pts;
1341 ++t_coords;
1342 }
1343 }
1344
1346}
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 ...
#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
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
Definition MatHuHu.hpp:33
decltype(GetFTensor4FromMatImpl< Tensor_Dim0, Tensor_Dim1, Tensor_Dim2, Tensor_Dim3, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor4FromMatType
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 246 of file BiLinearFormsIntegratorsImpl.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 236 of file BiLinearFormsIntegratorsImpl.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 245 of file BiLinearFormsIntegratorsImpl.hpp.


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