v0.14.0
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MoFEM::OpGradTimesTensorImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase > Struct Template Reference

#include <src/finite_elements/LinearFormsIntegratorsImpl.hpp>

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

Public Member Functions

 OpGradTimesTensorImpl (const std::string field_name, boost::shared_ptr< MatrixDouble > mat_vals, ScalarFun beta_coeff=[](double, double, double) constexpr { return 1;}, boost::shared_ptr< Range > ents_ptr=nullptr)
 

Public Attributes

FTensor::Index< 'i', SPACE_DIMi
 summit Index More...
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 

Protected Attributes

boost::shared_ptr< MatrixDoublematVals
 
ScalarFun betaCoeff
 

Detailed Description

template<int SPACE_DIM, int S, typename OpBase>
struct MoFEM::OpGradTimesTensorImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >

Definition at line 181 of file LinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpGradTimesTensorImpl()

template<int SPACE_DIM, int S, typename OpBase >
MoFEM::OpGradTimesTensorImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >::OpGradTimesTensorImpl ( const std::string  field_name,
boost::shared_ptr< MatrixDouble mat_vals,
ScalarFun  beta_coeff = [](doubledoubledouble) constexpr { return 1; },
boost::shared_ptr< Range ents_ptr = nullptr 
)
inline

Definition at line 186 of file LinearFormsIntegratorsImpl.hpp.

188  { return 1; },
189  boost::shared_ptr<Range> ents_ptr = nullptr)
190  : OpBase(field_name, field_name, OpBase::OPROW, ents_ptr),
191  matVals(mat_vals), betaCoeff(beta_coeff) {}

Member Function Documentation

◆ iNtegrate()

template<int SPACE_DIM, int S, typename OpBase >
MoFEMErrorCode MoFEM::OpGradTimesTensorImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >::iNtegrate ( EntitiesFieldData::EntData data)
protected

Definition at line 716 of file LinearFormsIntegratorsImpl.hpp.

717  {
719 
720  // get element volume
721  const double vol = OpBase::getMeasure();
722  // get integration weights
723  auto t_w = OpBase::getFTensor0IntegrationWeight();
724  // get base function gradient on rows
725  auto t_row_grad = row_data.getFTensor1DiffN<SPACE_DIM>();
726  // get filed gradient values
727  auto t_val_grad = getFTensor1FromMat<SPACE_DIM, S>(*(matVals));
728  // get coordinate at integration points
729  auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
730  // loop over integration points
731  for (int gg = 0; gg != OpBase::nbIntegrationPts; gg++) {
732  const double beta = vol * betaCoeff(t_coords(0), t_coords(1), t_coords(2));
733  // take into account Jacobian
734  const double alpha = t_w * beta;
735  // loop over rows base functions
736  int rr = 0;
737  for (; rr != OpBase::nbRows; rr++) {
738  // calculate element of local matrix
739  OpBase::locF[rr] += alpha * (t_row_grad(i) * t_val_grad(i));
740  ++t_row_grad; // move to another element of gradient of base
741  // function on row
742  }
743  for (; rr < OpBase::nbRowBaseFunctions; ++rr)
744  ++t_row_grad;
745 
746  ++t_coords;
747  ++t_val_grad;
748  ++t_w; // move to another integration weight
749  }
751 }

Member Data Documentation

◆ betaCoeff

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

Definition at line 196 of file LinearFormsIntegratorsImpl.hpp.

◆ i

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

summit Index

Definition at line 184 of file LinearFormsIntegratorsImpl.hpp.

◆ matVals

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

Definition at line 194 of file LinearFormsIntegratorsImpl.hpp.


The documentation for this struct was generated from the following file:
MoFEM::OpBaseImpl::nbIntegrationPts
int nbIntegrationPts
number of integration points
Definition: FormsIntegrators.hpp:238
MoFEM::OpGradTimesTensorImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >::betaCoeff
ScalarFun betaCoeff
Definition: LinearFormsIntegratorsImpl.hpp:196
MoFEM::OpGradTimesTensorImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >::matVals
boost::shared_ptr< MatrixDouble > matVals
Definition: LinearFormsIntegratorsImpl.hpp:194
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
MoFEM::OpGradTimesTensorImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >::i
FTensor::Index< 'i', SPACE_DIM > i
summit Index
Definition: LinearFormsIntegratorsImpl.hpp:184
MoFEM::OpBaseImpl::locF
VectorDouble locF
local entity vector
Definition: FormsIntegrators.hpp:251
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
MoFEM::OpBaseImpl::nbRowBaseFunctions
int nbRowBaseFunctions
number or row base functions
Definition: FormsIntegrators.hpp:239
MoFEM::OpBaseImpl::nbRows
int nbRows
number of dofs on rows
Definition: FormsIntegrators.hpp:236
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359