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

#include <src/finite_elements/LinearFormsIntegratorsImpl.hpp>

Inheritance diagram for MoFEM::OpNormalMixVecTimesScalarImpl< 3, GAUSS, OpBase >:
[legend]
Collaboration diagram for MoFEM::OpNormalMixVecTimesScalarImpl< 3, GAUSS, OpBase >:
[legend]

Public Member Functions

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

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 

Protected Attributes

ScalarFun sourceFun
 
FTensor::Index< 'i', 3 > i
 

Detailed Description

template<typename OpBase>
struct MoFEM::OpNormalMixVecTimesScalarImpl< 3, GAUSS, OpBase >

Definition at line 395 of file LinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpNormalMixVecTimesScalarImpl()

template<typename OpBase >
MoFEM::OpNormalMixVecTimesScalarImpl< 3, GAUSS, OpBase >::OpNormalMixVecTimesScalarImpl ( const std::string  field_name,
ScalarFun  source_fun = [](doubledoubledouble) constexpr { return 1; },
boost::shared_ptr< Range ents_ptr = nullptr 
)
inline

Definition at line 396 of file LinearFormsIntegratorsImpl.hpp.

398  { return 1; },
399  boost::shared_ptr<Range> ents_ptr = nullptr)
400  : OpBase(field_name, field_name, OpBase::OPROW, ents_ptr),
401  sourceFun(source_fun) {}

Member Function Documentation

◆ iNtegrate()

template<typename OpBase >
MoFEMErrorCode MoFEM::OpNormalMixVecTimesScalarImpl< 3, GAUSS, OpBase >::iNtegrate ( EntitiesFieldData::EntData data)
protected

Definition at line 1043 of file LinearFormsIntegratorsImpl.hpp.

1044  {
1046 
1047  const size_t nb_base_functions = row_data.getN().size2() / 3;
1048  // get element volume
1049  // get integration weights
1050  auto t_w = OpBase::getFTensor0IntegrationWeight();
1051  // get base function gradient on rows
1052  auto t_row_base = row_data.getFTensor1N<3>();
1053  // get coordinate at integration points
1054  auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
1055  // get normal
1056  auto t_normal = OpBase::getFTensor1NormalsAtGaussPts();
1057  double a = 1;
1058  if (this->getNumeredEntFiniteElementPtr()->getEntType() == MBTRI)
1059  a *= 2;
1060  // loop over integration points
1061  for (int gg = 0; gg != OpBase::nbIntegrationPts; gg++) {
1062  // take into account Jacobian
1063  const double alpha =
1064  t_w * sourceFun(t_coords(0), t_coords(1), t_coords(2)) / a;
1065  // loop over rows base functions
1066  int rr = 0;
1067  for (; rr != OpBase::nbRows; ++rr) {
1068  OpBase::locF[rr] += alpha * t_row_base(i) * t_normal(i);
1069  ++t_row_base;
1070  }
1071  for (; rr < nb_base_functions; ++rr)
1072  ++t_row_base;
1073  ++t_coords;
1074  ++t_w; // move to another integration weight
1075  ++t_normal;
1076  }
1078 }

Member Data Documentation

◆ i

template<typename OpBase >
FTensor::Index<'i', 3> MoFEM::OpNormalMixVecTimesScalarImpl< 3, GAUSS, OpBase >::i
protected

Definition at line 405 of file LinearFormsIntegratorsImpl.hpp.

◆ sourceFun

template<typename OpBase >
ScalarFun MoFEM::OpNormalMixVecTimesScalarImpl< 3, GAUSS, OpBase >::sourceFun
protected

Definition at line 404 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::OpNormalMixVecTimesScalarImpl< 3, GAUSS, OpBase >::i
FTensor::Index< 'i', 3 > i
Definition: LinearFormsIntegratorsImpl.hpp:405
MoFEM::OpNormalMixVecTimesScalarImpl< 3, GAUSS, OpBase >::sourceFun
ScalarFun sourceFun
Definition: LinearFormsIntegratorsImpl.hpp:404
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
MoFEM::OpBaseImpl::locF
VectorDouble locF
local entity vector
Definition: FormsIntegrators.hpp:251
a
constexpr double a
Definition: approx_sphere.cpp:30
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
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