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

#include <src/finite_elements/LinearFormsIntegratorsImpl.hpp>

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

Public Member Functions

 OpConvectiveTermRhsImpl (const std::string field_name, boost::shared_ptr< MatrixDouble > u_ptr, boost::shared_ptr< MatrixDouble > y_grad_ptr, ConstantFun source_fun=[]() constexpr { return 1;})
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 

Protected Attributes

boost::shared_ptr< MatrixDoubleuPtr
 
boost::shared_ptr< MatrixDoubleyGradPtr
 
ConstantFun alphaConstant
 

Detailed Description

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

Definition at line 458 of file LinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpConvectiveTermRhsImpl()

template<int SPACE_DIM, typename OpBase >
MoFEM::OpConvectiveTermRhsImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >::OpConvectiveTermRhsImpl ( const std::string  field_name,
boost::shared_ptr< MatrixDouble u_ptr,
boost::shared_ptr< MatrixDouble y_grad_ptr,
ConstantFun  source_fun = []() constexpr { return 1; } 
)
inline

Definition at line 459 of file LinearFormsIntegratorsImpl.hpp.

462  { return 1; })
463  : OpBase(field_name, field_name, OpBase::OPROW), uPtr(u_ptr),
464  yGradPtr(y_grad_ptr), alphaConstant(source_fun) {}

Member Function Documentation

◆ iNtegrate()

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

Definition at line 1166 of file LinearFormsIntegratorsImpl.hpp.

1167  {
1169 
1170  auto t_w = this->getFTensor0IntegrationWeight();
1171  auto t_base = row_data.getFTensor0N();
1172 
1173  auto t_u = getFTensor1FromMat<SPACE_DIM>(*uPtr);
1174  auto t_grad_y = getFTensor1FromMat<SPACE_DIM>(*yGradPtr);
1175 
1177  const double alpha_constant = alphaConstant();
1178  for (size_t gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
1179 
1180  // get element volume
1181  const double vol = OpBase::getMeasure();
1182  const double c = (t_grad_y(i) * t_u(i)) * (t_w * vol * alpha_constant);
1183 
1184  // get element volume
1185  int rr = 0;
1186  for (; rr != OpBase::nbRows; ++rr) {
1187  OpBase::locF[rr] += c * t_base;
1188  ++t_base;
1189  }
1190  for (; rr < OpBase::nbRowBaseFunctions; ++rr)
1191  ++t_base;
1192 
1193  ++t_w; // move to another integration weight
1194  ++t_u;
1195  ++t_grad_y;
1196  }
1197 
1199 }

Member Data Documentation

◆ alphaConstant

template<int SPACE_DIM, typename OpBase >
ConstantFun MoFEM::OpConvectiveTermRhsImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >::alphaConstant
protected

Definition at line 469 of file LinearFormsIntegratorsImpl.hpp.

◆ uPtr

template<int SPACE_DIM, typename OpBase >
boost::shared_ptr<MatrixDouble> MoFEM::OpConvectiveTermRhsImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >::uPtr
protected

Definition at line 467 of file LinearFormsIntegratorsImpl.hpp.

◆ yGradPtr

template<int SPACE_DIM, typename OpBase >
boost::shared_ptr<MatrixDouble> MoFEM::OpConvectiveTermRhsImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >::yGradPtr
protected

Definition at line 468 of file LinearFormsIntegratorsImpl.hpp.


The documentation for this struct was generated from the following file:
MoFEM::OpConvectiveTermRhsImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >::alphaConstant
ConstantFun alphaConstant
Definition: LinearFormsIntegratorsImpl.hpp:469
MoFEM::OpBaseImpl::nbIntegrationPts
int nbIntegrationPts
number of integration points
Definition: FormsIntegrators.hpp:238
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
MoFEM::OpBaseImpl::locF
VectorDouble locF
local entity vector
Definition: FormsIntegrators.hpp:251
c
const double c
speed of light (cm/ns)
Definition: initial_diffusion.cpp:39
MoFEM::OpConvectiveTermRhsImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >::uPtr
boost::shared_ptr< MatrixDouble > uPtr
Definition: LinearFormsIntegratorsImpl.hpp:467
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index< 'i', SPACE_DIM >
MoFEM::OpBaseImpl::nbRowBaseFunctions
int nbRowBaseFunctions
number or row base functions
Definition: FormsIntegrators.hpp:239
MoFEM::OpConvectiveTermRhsImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >::yGradPtr
boost::shared_ptr< MatrixDouble > yGradPtr
Definition: LinearFormsIntegratorsImpl.hpp:468
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