v0.16.3
Loading...
Searching...
No Matches
Protected Member Functions | List of all members
MoFEM::OpMassImpl< 1, FIELD_DIM, GAUSS, OpBase > Struct Template Reference

#include "src/finite_elements/BiLinearFormsIntegratorsImpl.hpp"

Inheritance diagram for MoFEM::OpMassImpl< 1, FIELD_DIM, GAUSS, OpBase >:
[legend]
Collaboration diagram for MoFEM::OpMassImpl< 1, FIELD_DIM, GAUSS, OpBase >:
[legend]

Protected Member Functions

MoFEMErrorCode integrateImpl (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data, double vol)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 Integrate grad-grad operator.
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 Class dedicated to integrate operator.
 
- Protected Member Functions inherited from MoFEM::OpMassImpl< 1, 1, GAUSS, OpBase >
MoFEMErrorCode integrateImpl (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data, double vol)
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
template<int DIM>
auto getNf ()
 Get local vector tensor for assembly.
 
template<int ROW_DIM, int COL_DIM = ROW_DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, COL_DIM >, ROW_DIM, COL_DIM > getLocMat (const int rr)
 Get local matrix tensor for assembly.
 
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.
 

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 Member Functions inherited from MoFEM::OpMassImpl< 1, 1, GAUSS, OpBase >
 OpMassImpl (const std::string row_field_name, const std::string col_field_name, ScalarFun beta=[](double, double, double) constexpr { return 1;}, boost::shared_ptr< Range > ents_ptr=nullptr, boost::shared_ptr< MatrixDouble > cache_mat=nullptr)
 
- 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.
 
- 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< Range > entsPtr
 Entities on which element is run.
 
- Static Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
static MatSetValuesHook matSetValuesHook
 
- Protected Attributes inherited from MoFEM::OpMassImpl< 1, 1, GAUSS, OpBase >
ScalarFun betaCoeff = [](double, double, double) constexpr { return 1; }
 
- 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
 

Detailed Description

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

Definition at line 94 of file BiLinearFormsIntegratorsImpl.hpp.

Member Function Documentation

◆ iNtegrate() [1/2]

template<int FIELD_DIM, typename OpBase >
MoFEMErrorCode MoFEM::OpMassImpl< 1, FIELD_DIM, GAUSS, OpBase >::iNtegrate ( EntitiesFieldData::EntData &  )
inlineprotectedvirtual

Class dedicated to integrate operator.

Parameters
dataentity data on element row
Returns
error code

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

Definition at line 107 of file BiLinearFormsIntegratorsImpl.hpp.

107 {
109 }
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32

◆ iNtegrate() [2/2]

template<int FIELD_DIM, typename OpBase >
MoFEMErrorCode MoFEM::OpMassImpl< 1, FIELD_DIM, GAUSS, OpBase >::iNtegrate ( EntitiesFieldData::EntData &  ,
EntitiesFieldData::EntData &   
)
inlineprotectedvirtual

Integrate grad-grad operator.

Parameters
row_datarow data (consist base functions on row entity)
col_datacolumn data (consist base functions on column entity)
Returns
error code

Reimplemented from MoFEM::OpMassImpl< 1, 1, GAUSS, OpBase >.

Definition at line 103 of file BiLinearFormsIntegratorsImpl.hpp.

104 {
105 return integrateImpl(row_data, col_data, OpBase::getMeasure());
106 }
MoFEMErrorCode integrateImpl(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data, double vol)

◆ integrateImpl()

template<int FIELD_DIM, typename OpBase >
MoFEMErrorCode MoFEM::OpMassImpl< 1, FIELD_DIM, GAUSS, OpBase >::integrateImpl ( EntitiesFieldData::EntData &  row_data,
EntitiesFieldData::EntData &  col_data,
double  vol 
)
protected

Definition at line 677 of file BiLinearFormsIntegratorsImpl.hpp.

679 {
681
682 auto integrate = [&](auto &mat) {
684 // get integration weights
685 auto t_w = OpBase::getFTensor0IntegrationWeight();
686 // get base function gradient on rows
687 auto t_row_base = row_data.getFTensor0N();
688 // get coordinate at integration points
689 auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
690
692 auto get_t_vec = [&](const int rr) {
693 std::array<double *, FIELD_DIM> ptrs;
694 for (auto i = 0; i != FIELD_DIM; ++i)
695 ptrs[i] = &mat(rr + i, i);
697 ptrs);
698 };
699
700 // loop over integration points
701 for (int gg = 0; gg != OpBase::nbIntegrationPts; gg++) {
702 const double beta = betaCoeff(t_coords(0), t_coords(1), t_coords(2));
703 // take into account Jacobian
704 const double alpha = t_w * beta;
705 // loop over rows base functions
706 int rr = 0;
707 for (; rr != OpBase::nbRows / FIELD_DIM; rr++) {
708 // get column base functions gradient at gauss point gg
709 auto t_col_base = col_data.getFTensor0N(gg, 0);
710 // get mat vec
711 auto t_vec = get_t_vec(FIELD_DIM * rr);
712 // loop over columns
713 for (int cc = 0; cc != OpBase::nbCols / FIELD_DIM; cc++) {
714 // calculate element of local matrix
715 t_vec(i) += alpha * (t_row_base * t_col_base);
716 ++t_col_base;
717 ++t_vec;
718 }
719 ++t_row_base;
720 }
721 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
722 ++t_row_base;
723 ++t_coords;
724 ++t_w; // move to another integration weight
725 }
727 };
728
729 CHKERR integrate(OpBase::locMat);
730 OpBase::locMat *= vol;
731
733};
constexpr int FIELD_DIM
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#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()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
FTensor::Index< 'i', SPACE_DIM > i
int nbRows
number of dofs on rows
int nbIntegrationPts
number of integration points
MatrixDouble locMat
local entity block matrix
int nbCols
number if dof on column
int nbRowBaseFunctions
number or row base functions

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