v0.15.0
Loading...
Searching...
No Matches
MoFEM::OpMassCacheImpl< 1, FIELD_DIM, I, OpBase > Struct Template Reference

#include "src/finite_elements/BiLinearFormsIntegratorsImpl.hpp"

Inheritance diagram for MoFEM::OpMassCacheImpl< 1, FIELD_DIM, I, OpBase >:
[legend]
Collaboration diagram for MoFEM::OpMassCacheImpl< 1, FIELD_DIM, I, OpBase >:
[legend]

Public Member Functions

 OpMassCacheImpl (CacheMatsTypeType cache, const std::string row_field_name, const std::string col_field_name, const double beta, boost::shared_ptr< Range > ents_ptr=nullptr)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 

Protected Attributes

double scalarBeta
 
CacheMatsTypeType cacheLocMats
 

Detailed Description

template<int FIELD_DIM, IntegrationType I, typename OpBase>
struct MoFEM::OpMassCacheImpl< 1, FIELD_DIM, I, OpBase >

Definition at line 163 of file BiLinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpMassCacheImpl()

template<int FIELD_DIM, IntegrationType I, typename OpBase >
MoFEM::OpMassCacheImpl< 1, FIELD_DIM, I, OpBase >::OpMassCacheImpl ( CacheMatsTypeType cache,
const std::string row_field_name,
const std::string col_field_name,
const double beta,
boost::shared_ptr< Range > ents_ptr = nullptr )
inline

Definition at line 165 of file BiLinearFormsIntegratorsImpl.hpp.

168 : OpMassImpl<1, FIELD_DIM, I, OpBase>(
169 row_field_name, col_field_name,
170 [](double, double, double) constexpr { return 1; }, ents_ptr),
171 cacheLocMats(cache), scalarBeta(beta) {}

Member Function Documentation

◆ iNtegrate()

template<int FIELD_DIM, IntegrationType I, typename OpBase >
MoFEMErrorCode MoFEM::OpMassCacheImpl< 1, FIELD_DIM, I, OpBase >::iNtegrate ( EntitiesFieldData::EntData & row_data,
EntitiesFieldData::EntData & col_data )

Definition at line 801 of file BiLinearFormsIntegratorsImpl.hpp.

803 {
805
806 const auto vol = this->getMeasure();
807 const auto row_type = this->rowType;
808 const auto col_type = this->colType;
809 auto &loc_mat = this->locMat;
810
811 auto p = std::make_pair(row_type, col_type);
812
813 if (cacheLocMats[p]) {
814 if (cacheLocMats[p]->size1() != loc_mat.size1() &&
815 cacheLocMats[p]->size2() != loc_mat.size2()) {
816 cacheLocMats[p]->resize(loc_mat.size1(), loc_mat.size2());
817 CHKERR this->integrateImpl(row_data, col_data, 1);
818 *(cacheLocMats[p]) = loc_mat;
819 } else {
820 loc_mat = *(cacheLocMats[p]);
821 }
822 loc_mat *= scalarBeta * this->getMeasure();
823 } else {
824 CHKERR this->integrateImpl(row_data, col_data,
825 scalarBeta * this->getMeasure());
826 }
828}
#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.

Member Data Documentation

◆ cacheLocMats

template<int FIELD_DIM, IntegrationType I, typename OpBase >
CacheMatsTypeType MoFEM::OpMassCacheImpl< 1, FIELD_DIM, I, OpBase >::cacheLocMats
protected

Definition at line 178 of file BiLinearFormsIntegratorsImpl.hpp.

◆ scalarBeta

template<int FIELD_DIM, IntegrationType I, typename OpBase >
double MoFEM::OpMassCacheImpl< 1, FIELD_DIM, I, OpBase >::scalarBeta
protected

Definition at line 177 of file BiLinearFormsIntegratorsImpl.hpp.


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