Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OpTools< EleOp >::OpGradGrad< DIM > Struct Template Reference

[Source operator] More...

#include <users_modules/basic_finite_elements/lessons/src/BaseOps.hpp>

Inheritance diagram for OpTools< EleOp >::OpGradGrad< DIM >:
Collaboration diagram for OpTools< EleOp >::OpGradGrad< DIM >:

Public Member Functions

 OpGradGrad (const std::string row_field_name, const std::string col_field_name, ScalarFun beta, boost::shared_ptr< std::vector< bool >> boundary_marker=nullptr)
- Public Member Functions inherited from OpTools< EleOp >::OpBase
 OpBase (const std::string row_field_name, const std::string col_field_name, const typename EleOp::OpType type, boost::shared_ptr< std::vector< bool >> boundary_marker=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...

Protected Member Functions

MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 Integrate grad-grad operator. More...
- Protected Member Functions inherited from OpTools< EleOp >::OpBase
MoFEMErrorCode applyBoundaryMarker (EntData &data)
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data)
 Assemble local entity block matrix. More...
virtual MoFEMErrorCode iNtegrate (EntData &data)
 Class dedicated to integrate operator. More...
virtual MoFEMErrorCode aSsemble (EntData &data)
 Class dedicated to assemble operator to global system vector. More...

Protected Attributes

ScalarFun betaCoeff
FTensor::Index< 'i', DIM > i
 summit Index More...
- Protected Attributes inherited from OpTools< EleOp >::OpBase
boost::shared_ptr< std::vector< bool > > boundaryMarker
int nbRows
 number of dofs on rows More...
int nbCols
 number if dof on column More...
int nbIntegrationPts
 number of integration points More...
MatrixDouble locMat
 local entity block matrix More...
VectorDouble locF
 local entity vector More...

Detailed Description

template<typename EleOp>
template<int DIM>
struct OpTools< EleOp >::OpGradGrad< DIM >

[Source operator]

[Grad operator]

lesson3_poisson.cpp, lesson5_helmholtz.cpp, and lesson6_radiation.cpp.

Definition at line 137 of file BaseOps.hpp.

Constructor & Destructor Documentation

◆ OpGradGrad()

template<typename EleOp >
template<int DIM>
OpTools< EleOp >::OpGradGrad< DIM >::OpGradGrad ( const std::string  row_field_name,
const std::string  col_field_name,
ScalarFun  beta,
boost::shared_ptr< std::vector< bool >>  boundary_marker = nullptr 

Definition at line 139 of file BaseOps.hpp.

142  : OpBase(row_field_name, col_field_name, OpBase::OPROWCOL,
143  boundary_marker),
144  betaCoeff(beta) {}
ScalarFun betaCoeff
Definition: BaseOps.hpp:147
OpBase(const std::string row_field_name, const std::string col_field_name, const typename EleOp::OpType type, boost::shared_ptr< std::vector< bool >> boundary_marker=nullptr)
Definition: BaseOps.hpp:22

Member Function Documentation

◆ iNtegrate()

template<typename EleOp >
template<int DIM>
MoFEMErrorCode OpTools< EleOp >::OpGradGrad< DIM >::iNtegrate ( EntData row_data,
EntData col_data 

Integrate grad-grad operator.

row_datarow data (consist base functions on row entity)
col_datacolumn data (consist base functions on column entity)
error code

Reimplemented from OpTools< EleOp >::OpBase.

Definition at line 150 of file BaseOps.hpp.

150  {
152  // get element volume
153  const double vol = OpBase::getMeasure();
154  // get integration weights
155  auto t_w = OpBase::getFTensor0IntegrationWeight();
156  // get base function gradient on rows
157  auto t_row_grad = row_data.getFTensor1DiffN<DIM>();
158  // get coordinate at integration points
159  auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
161  // loop over integration points
162  for (int gg = 0; gg != OpBase::nbIntegrationPts; gg++) {
163  const double beta =
164  vol * betaCoeff(t_coords(0), t_coords(1), t_coords(2));
165  // take into account Jacobean
166  const double alpha = t_w * beta;
167  // loop over rows base functions
168  for (int rr = 0; rr != OpBase::nbRows; rr++) {
169  // get column base functions gradient at gauss point gg
170  auto t_col_grad = col_data.getFTensor1DiffN<DIM>(gg, 0);
171  // loop over columns
172  for (int cc = 0; cc != OpBase::nbCols; cc++) {
173  // calculate element of local matrix
174  OpBase::locMat(rr, cc) += alpha * (t_row_grad(i) * t_col_grad(i));
175  ++t_col_grad; // move to another gradient of base function on column
176  }
177  ++t_row_grad; // move to another element of gradient of base function
178  // on row
179  }
180  ++t_coords;
181  ++t_w; // move to another integration weight
182  }
184  }
FTensor::Index< 'i', DIM > i
summit Index
Definition: BaseOps.hpp:148
ScalarFun betaCoeff
Definition: BaseOps.hpp:147
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
int nbCols
number if dof on column
Definition: BaseOps.hpp:57
FTensor::Tensor1< double *, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
MatrixDouble locMat
local entity block matrix
Definition: BaseOps.hpp:60
int nbIntegrationPts
number of integration points
Definition: BaseOps.hpp:58
int nbRows
number of dofs on rows
Definition: BaseOps.hpp:56
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

Member Data Documentation

◆ betaCoeff

template<typename EleOp >
template<int DIM>
ScalarFun OpTools< EleOp >::OpGradGrad< DIM >::betaCoeff

Definition at line 147 of file BaseOps.hpp.

◆ i

template<typename EleOp >
template<int DIM>
FTensor::Index<'i', DIM> OpTools< EleOp >::OpGradGrad< DIM >::i

summit Index

Definition at line 148 of file BaseOps.hpp.

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