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

#include <src/finite_elements/LinearFormsIntegratorsImpl.hpp>

Inheritance diagram for MoFEM::OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase >:
[legend]
Collaboration diagram for MoFEM::OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase >:
[legend]

Public Member Functions

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

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 

Protected Attributes

ScalarFun betaCoeff
 
boost::shared_ptr< MatrixDoublesourceVec
 
FTensor::Index< 'i', FIELD_DIMi
 

Detailed Description

template<int FIELD_DIM, int S, typename OpBase>
struct MoFEM::OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase >

Definition at line 160 of file LinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpBaseTimesVectorImpl()

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

Definition at line 162 of file LinearFormsIntegratorsImpl.hpp.

164  { return 1; },
165  boost::shared_ptr<Range> ents_ptr = nullptr)
166  : OpBase(field_name, field_name, OpBase::OPROW, ents_ptr), sourceVec(vec),
167  betaCoeff(beta_coeff) {}

Member Function Documentation

◆ iNtegrate()

template<int FIELD_DIM, int S, typename OpBase >
MoFEMErrorCode MoFEM::OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase >::iNtegrate ( EntitiesFieldData::EntData data)
protected

Definition at line 679 of file LinearFormsIntegratorsImpl.hpp.

680  {
682 
683  const size_t nb_base_functions = row_data.getN().size2() / 3;
684  // get element volume
685  const double vol = OpBase::getMeasure();
686  // get integration weights
687  auto t_w = OpBase::getFTensor0IntegrationWeight();
688  // get base function gradient on rows
689  auto t_row_base = row_data.getFTensor1N<3>();
690  // get coords
691  auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
692  // get vector values
693  auto t_vec = getFTensor1FromMat<FIELD_DIM, S>(*sourceVec);
694  // loop over integration points
695  for (int gg = 0; gg != OpBase::nbIntegrationPts; gg++) {
696  // take into account Jacobian
697  const double alpha =
698  t_w * vol * betaCoeff(t_coords(0), t_coords(1), t_coords(2));
699  // loop over rows base functions
700  int rr = 0;
701  for (; rr != OpBase::nbRows; ++rr) {
702  OpBase::locF[rr] += alpha * t_row_base(i) * t_vec(i);
703  ++t_row_base;
704  }
705  for (; rr < nb_base_functions; ++rr)
706  ++t_row_base;
707  ++t_w; // move to another integration weight
708  ++t_vec;
709  ++t_coords;
710  }
712 }

Member Data Documentation

◆ betaCoeff

template<int FIELD_DIM, int S, typename OpBase >
ScalarFun MoFEM::OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase >::betaCoeff
protected

Definition at line 170 of file LinearFormsIntegratorsImpl.hpp.

◆ i

template<int FIELD_DIM, int S, typename OpBase >
FTensor::Index<'i', FIELD_DIM> MoFEM::OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase >::i
protected

Definition at line 172 of file LinearFormsIntegratorsImpl.hpp.

◆ sourceVec

template<int FIELD_DIM, int S, typename OpBase >
boost::shared_ptr<MatrixDouble> MoFEM::OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase >::sourceVec
protected

Definition at line 171 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::OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase >::sourceVec
boost::shared_ptr< MatrixDouble > sourceVec
Definition: LinearFormsIntegratorsImpl.hpp:171
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
MoFEM::OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase >::i
FTensor::Index< 'i', FIELD_DIM > i
Definition: LinearFormsIntegratorsImpl.hpp:172
MoFEM::OpBaseImpl::locF
VectorDouble locF
local entity vector
Definition: FormsIntegrators.hpp:251
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
MoFEM::OpBaseImpl::nbRows
int nbRows
number of dofs on rows
Definition: FormsIntegrators.hpp:236
MoFEM::OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase >::betaCoeff
ScalarFun betaCoeff
Definition: LinearFormsIntegratorsImpl.hpp:170
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