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

#include <src/finite_elements/LinearFormsIntegratorsImpl.hpp>

Inheritance diagram for MoFEM::OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase, CoordSys >:
[legend]
Collaboration diagram for MoFEM::OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase, CoordSys >:
[legend]

Public Member Functions

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

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 

Protected Attributes

ScalarFun betaConst
 
boost::shared_ptr< MatrixDoublematVals
 
FTensor::Index< 'i', FIELD_DIMi
 
FTensor::Index< 'j', SPACE_DIMj
 

Detailed Description

template<int FIELD_DIM, int SPACE_DIM, typename OpBase, CoordinateTypes CoordSys>
struct MoFEM::OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase, CoordSys >

Definition at line 247 of file LinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpMixDivTimesUImpl()

template<int FIELD_DIM, int SPACE_DIM, typename OpBase , CoordinateTypes CoordSys>
MoFEM::OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase, CoordSys >::OpMixDivTimesUImpl ( const std::string  field_name,
boost::shared_ptr< MatrixDouble mat_vals,
ScalarFun  beta = [](doubledoubledouble) { return 1; },
boost::shared_ptr< Range ents_ptr = nullptr 
)
inline

Definition at line 249 of file LinearFormsIntegratorsImpl.hpp.

251  { return 1; },
252  boost::shared_ptr<Range> ents_ptr = nullptr)
253  : OpBase(field_name, field_name, OpBase::OPROW, ents_ptr),
254  matVals(mat_vals), betaConst(beta) {}

Member Function Documentation

◆ iNtegrate()

template<int FIELD_DIM, int SPACE_DIM, typename OpBase , CoordinateTypes CoordSys>
MoFEMErrorCode MoFEM::OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase, CoordSys >::iNtegrate ( EntitiesFieldData::EntData data)
protected

Definition at line 838 of file LinearFormsIntegratorsImpl.hpp.

839  {
841 
842  const size_t nb_base_functions = row_data.getN().size2() / 3;
843  auto t_w = this->getFTensor0IntegrationWeight();
844  // get coordinate at integration points
845  auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
846  auto t_diff_base = row_data.getFTensor2DiffN<3, SPACE_DIM>();
847  auto t_base = row_data.getFTensor1N<3>();
848  auto t_u = getFTensor1FromMat<FIELD_DIM>(*(matVals));
849 
850  for (size_t gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
851 
852  const double alpha = this->getMeasure() * t_w *
853  betaConst(t_coords(0), t_coords(1), t_coords(2));
854  auto t_nf = OpBase::template getNf<FIELD_DIM>();
855 
856  size_t bb = 0;
857  for (; bb != this->nbRows / FIELD_DIM; ++bb) {
858  const double t_div_base = t_diff_base(j, j);
859  t_nf(i) += alpha * t_div_base * t_u(i);
860  if constexpr (CoordSys == CYLINDRICAL) {
861  t_nf(i) += t_base(0) * (alpha / t_coords(0)) * t_u(i);
862  }
863  ++t_nf;
864  ++t_diff_base;
865  ++t_base;
866  }
867  for (; bb < nb_base_functions; ++bb) {
868  ++t_diff_base;
869  ++t_base;
870  }
871 
872  ++t_u;
873  ++t_w;
874  ++t_coords;
875  }
876 
878 }

Member Data Documentation

◆ betaConst

template<int FIELD_DIM, int SPACE_DIM, typename OpBase , CoordinateTypes CoordSys>
ScalarFun MoFEM::OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase, CoordSys >::betaConst
protected

Definition at line 257 of file LinearFormsIntegratorsImpl.hpp.

◆ i

template<int FIELD_DIM, int SPACE_DIM, typename OpBase , CoordinateTypes CoordSys>
FTensor::Index<'i', FIELD_DIM> MoFEM::OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase, CoordSys >::i
protected

Definition at line 259 of file LinearFormsIntegratorsImpl.hpp.

◆ j

template<int FIELD_DIM, int SPACE_DIM, typename OpBase , CoordinateTypes CoordSys>
FTensor::Index<'j', SPACE_DIM> MoFEM::OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase, CoordSys >::j
protected

Definition at line 260 of file LinearFormsIntegratorsImpl.hpp.

◆ matVals

template<int FIELD_DIM, int SPACE_DIM, typename OpBase , CoordinateTypes CoordSys>
boost::shared_ptr<MatrixDouble> MoFEM::OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase, CoordSys >::matVals
protected

Definition at line 258 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::OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase, CoordSys >::j
FTensor::Index< 'j', SPACE_DIM > j
Definition: LinearFormsIntegratorsImpl.hpp:260
MoFEM::OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase, CoordSys >::i
FTensor::Index< 'i', FIELD_DIM > i
Definition: LinearFormsIntegratorsImpl.hpp:259
MoFEM::OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase, CoordSys >::matVals
boost::shared_ptr< MatrixDouble > matVals
Definition: LinearFormsIntegratorsImpl.hpp:258
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
FIELD_DIM
constexpr int FIELD_DIM
Definition: child_and_parent.cpp:15
MoFEM::OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase, CoordSys >::betaConst
ScalarFun betaConst
Definition: LinearFormsIntegratorsImpl.hpp:257
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
CYLINDRICAL
@ CYLINDRICAL
Definition: definitions.h:130
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