v0.16.0
Loading...
Searching...
No Matches
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;})
 
- 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 SPACE_DIM, typename OpBase>
struct MoFEM::OpConvectiveTermRhsImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >

Definition at line 465 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

Member Function Documentation

◆ iNtegrate()

template<int SPACE_DIM, typename OpBase >
MoFEMErrorCode MoFEM::OpConvectiveTermRhsImpl< 1, 1, 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 1220 of file LinearFormsIntegratorsImpl.hpp.

1221 {
1223
1224 using DL = DataLayoutTraits<DataLayout::GaussByCoeffs>;
1225 auto get_u_at_pts =
1226 MatrixSizeHelper<GetFTensor1FromMatType<SPACE_DIM, -1, DL>, DL>::get(
1228 auto get_grad_y_at_pts =
1229 MatrixSizeHelper<GetFTensor1FromMatType<SPACE_DIM, -1, DL>, DL>::get(
1231
1232 auto t_w = this->getFTensor0IntegrationWeight();
1233 auto t_base = row_data.getFTensor0N();
1234
1235 auto t_u_at_pts = get_u_at_pts();
1236 auto t_grad_y_at_pts = get_grad_y_at_pts();
1237
1239 const double alpha_constant = alphaConstant();
1240 for (size_t gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
1241
1242 // get element volume
1243 const double vol = OpBase::getMeasure();
1244 const double c =
1245 (t_grad_y_at_pts(i) * t_u_at_pts(i)) * (t_w * vol * alpha_constant);
1246
1247 // get element volume
1248 int rr = 0;
1249 for (; rr != OpBase::nbRows; ++rr) {
1250 OpBase::locF[rr] += c * t_base;
1251 ++t_base;
1252 }
1253 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
1254 ++t_base;
1255
1256 ++t_w; // move to another integration weight
1257 ++t_u_at_pts;
1258 ++t_grad_y_at_pts;
1259 }
1260
1262}
constexpr int SPACE_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
const double c
speed of light (cm/ns)
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
Definition MatHuHu.hpp:33
decltype(GetFTensor1FromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor1FromMatType
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 SPACE_DIM, typename OpBase >
ConstantFun MoFEM::OpConvectiveTermRhsImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >::alphaConstant
protected

Definition at line 476 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 474 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 475 of file LinearFormsIntegratorsImpl.hpp.


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