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

#include <src/finite_elements/LinearFormsIntegratorsImpl.hpp>

Inheritance diagram for MoFEM::OpGradTimesTensorImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >:
[legend]
Collaboration diagram for MoFEM::OpGradTimesTensorImpl< 1, SPACE_DIM, 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...
 
FTensor::Index< 'j', SPACE_DIMj
 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, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >

Definition at line 200 of file LinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpGradTimesTensorImpl()

template<int SPACE_DIM, int S, typename OpBase >
MoFEM::OpGradTimesTensorImpl< 1, SPACE_DIM, 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 206 of file LinearFormsIntegratorsImpl.hpp.

208  { return 1; },
209  boost::shared_ptr<Range> ents_ptr = nullptr)
210  : OpBase(field_name, field_name, OpBase::OPROW, ents_ptr),
211  matVals(mat_vals), betaCoeff(beta_coeff) {}

Member Function Documentation

◆ iNtegrate()

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

Definition at line 755 of file LinearFormsIntegratorsImpl.hpp.

756  {
758 
759  // get element volume
760  const double vol = OpBase::getMeasure();
761  // get integration weights
762  auto t_w = OpBase::getFTensor0IntegrationWeight();
763  // get base function gradient on rows
764  auto t_row_grad = row_data.getFTensor1DiffN<SPACE_DIM>();
765  // get filed gradient values
766  auto t_val_grad = getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(*(matVals));
767  // get coordinate at integration points
768  auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
769  // loop over integration points
770  for (int gg = 0; gg != OpBase::nbIntegrationPts; gg++) {
771  // take into account Jacobian
772  const double alpha =
773  t_w * vol * betaCoeff(t_coords(0), t_coords(1), t_coords(2));
774  // get rhs vector
775  auto t_nf = OpBase::template getNf<SPACE_DIM>();
776  // loop over rows base functions
777  int rr = 0;
778  for (; rr != OpBase::nbRows / SPACE_DIM; rr++) {
779  // calculate element of local matrix
780  t_nf(i) += alpha * (t_row_grad(j) * t_val_grad(i, j));
781  ++t_row_grad; // move to another element of gradient of base
782  // function on row
783  ++t_nf;
784  }
785  for (; rr < OpBase::nbRowBaseFunctions; ++rr)
786  ++t_row_grad;
787 
788  ++t_coords;
789  ++t_val_grad;
790  ++t_w; // move to another integration weight
791  }
793 }

Member Data Documentation

◆ betaCoeff

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

Definition at line 216 of file LinearFormsIntegratorsImpl.hpp.

◆ i

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

summit Index

Definition at line 203 of file LinearFormsIntegratorsImpl.hpp.

◆ j

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

summit Index

Definition at line 204 of file LinearFormsIntegratorsImpl.hpp.

◆ matVals

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

Definition at line 214 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
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
MoFEM::OpGradTimesTensorImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >::i
FTensor::Index< 'i', SPACE_DIM > i
summit Index
Definition: LinearFormsIntegratorsImpl.hpp:203
MoFEM::OpGradTimesTensorImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >::betaCoeff
ScalarFun betaCoeff
Definition: LinearFormsIntegratorsImpl.hpp:216
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
MoFEM::OpGradTimesTensorImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >::j
FTensor::Index< 'j', SPACE_DIM > j
summit Index
Definition: LinearFormsIntegratorsImpl.hpp:204
MoFEM::OpGradTimesTensorImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >::matVals
boost::shared_ptr< MatrixDouble > matVals
Definition: LinearFormsIntegratorsImpl.hpp:214
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