v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MoFEM::OpConvectiveTermRhsImpl< 1, FIELD_DIM, SPACE_DIM, GAUSS, OpBase > Struct Template Reference

#include "src/finite_elements/LinearFormsIntegratorsImpl.hpp"

Inheritance diagram for MoFEM::OpConvectiveTermRhsImpl< 1, FIELD_DIM, SPACE_DIM, GAUSS, OpBase >:
[legend]
Collaboration diagram for MoFEM::OpConvectiveTermRhsImpl< 1, FIELD_DIM, 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;})
 
- Public Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
 OpBaseImpl (const std::string row_field_name, const std::string col_field_name, const OpType type, boost::shared_ptr< Range > ents_ptr=nullptr)
 Constructor for base operator implementation.
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 Do calculations for the left hand side.
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntData &row_data)
 Do calculations for the right hand side.
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 Class dedicated to integrate operator.
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
template<int DIM>
auto getNf ()
 Get local vector tensor for assembly.
 
template<int DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, DIM >, DIM, DIM > getLocMat (const int rr)
 Get local matrix tensor for assembly.
 
virtual MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 Integrate grad-grad operator.
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 Assemble local matrix into global matrix.
 
virtual MoFEMErrorCode aSsemble (EntData &data)
 Assemble local vector into global vector.
 
virtual size_t getNbOfBaseFunctions (EntitiesFieldData::EntData &data)
 Get number of base functions.
 

Protected Attributes

boost::shared_ptr< MatrixDoubleuPtr
 
boost::shared_ptr< MatrixDoubleyGradPtr
 
ConstantFun alphaConstant
 
- Protected Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
int nbRows
 number of dofs on rows
 
int nbCols
 number if dof on column
 
int nbIntegrationPts
 number of integration points
 
int nbRowBaseFunctions
 number or row base functions
 
int rowSide
 row side number
 
int colSide
 column side number
 
EntityType rowType
 row type
 
EntityType colType
 column type
 
bool assembleTranspose
 
bool onlyTranspose
 
MatrixDouble locMat
 local entity block matrix
 
MatrixDouble locMatTranspose
 local entity block matrix
 
VectorDouble locF
 local entity vector
 

Additional Inherited Members

- Public Types inherited from MoFEM::OpBaseImpl< A, EleOp >
using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 
using MatSetValuesHook = boost::function< MoFEMErrorCode(ForcesAndSourcesCore::UserDataOperator *op_ptr, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, MatrixDouble &m)>
 
- Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
TimeFun timeScalingFun
 assumes that time variable is set
 
FEFun feScalingFun
 set by fe entity handle
 
boost::shared_ptr< RangeentsPtr
 Entities on which element is run.
 
- Static Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
static MatSetValuesHook matSetValuesHook
 

Detailed Description

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

Definition at line 481 of file LinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpConvectiveTermRhsImpl()

template<int FIELD_DIM, int SPACE_DIM, typename OpBase >
MoFEM::OpConvectiveTermRhsImpl< 1, FIELD_DIM, 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

Member Function Documentation

◆ iNtegrate()

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

Class dedicated to integrate operator.

Parameters
dataentity data on element row
Returns
error code

Reimplemented from MoFEM::OpBaseImpl< A, EleOp >.

Definition at line 1266 of file LinearFormsIntegratorsImpl.hpp.

1267 {
1269
1270 using DL = DataLayoutTraits<DataLayout::GaussByCoeffs>;
1271 auto get_u_at_pts =
1272 MatrixSizeHelper<GetFTensor1FromMatType<SPACE_DIM, -1, DL>, DL>::get(
1274 auto get_grad_y_at_pts =
1275 MatrixSizeHelper<
1278
1279 auto t_w = this->getFTensor0IntegrationWeight();
1280 auto t_base = row_data.getFTensor0N();
1281
1282 auto t_u_at_pts = get_u_at_pts();
1283 auto t_grad_y_at_pts = get_grad_y_at_pts();
1284
1287 const double alpha_constant = alphaConstant();
1288 for (size_t gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
1289
1290 // get element volume
1291 const double vol = OpBase::getMeasure();
1292
1294 t_c(J) =
1295 (t_grad_y_at_pts(J, i) * t_u_at_pts(i)) * (t_w * vol * alpha_constant);
1296
1297 auto t_nf = getFTensor1FromArray<FIELD_DIM, FIELD_DIM>(OpBase::locF);
1298 int rr = 0;
1299 for (; rr != OpBase::nbRows / FIELD_DIM; ++rr) {
1300 t_nf(J) += t_base * t_c(J);
1301 ++t_base;
1302 ++t_nf;
1303 }
1304 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
1305 ++t_base;
1306 ++t_w; // move to another integration weight
1307
1308 ++t_u_at_pts;
1309 ++t_grad_y_at_pts;
1310 }
1311
1313}
constexpr int SPACE_DIM
constexpr int FIELD_DIM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
Definition MatHuHu.hpp:33
decltype(GetFTensor1FromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor1FromMatType
decltype(GetFTensor2FromMatImpl< Tensor_Dim0, Tensor_Dim1, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor2FromMatType
VectorDouble locF
local entity vector
int nbRows
number of dofs on rows
int nbIntegrationPts
number of integration points
int nbRowBaseFunctions
number or row base functions

Member Data Documentation

◆ alphaConstant

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

Definition at line 493 of file LinearFormsIntegratorsImpl.hpp.

◆ uPtr

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

Definition at line 491 of file LinearFormsIntegratorsImpl.hpp.

◆ yGradPtr

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

Definition at line 492 of file LinearFormsIntegratorsImpl.hpp.


The documentation for this struct was generated from the following file: