v0.15.0
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.
 
- 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>
FTensor::Tensor1< FTensor::PackPtr< double *, DIM >, DIM > 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 aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 Assemble local matrix into global matrix.
 
virtual MoFEMErrorCode iNtegrate (EntData &data)
 Class dedicated to integrate operator.
 
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
 assumes that time variable is set
 
boost::shared_ptr< RangeentsPtr
 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 92 of file BiLinearFormsIntegratorsImpl.hpp.

Member Function Documentation

◆ iNtegrate()

template<int FIELD_DIM, typename OpBase >
MoFEMErrorCode MoFEM::OpMassImpl< 1, FIELD_DIM, GAUSS, OpBase >::iNtegrate ( EntitiesFieldData::EntData row_data,
EntitiesFieldData::EntData col_data 
)
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 101 of file BiLinearFormsIntegratorsImpl.hpp.

102 {
103 return integrateImpl(row_data, col_data, OpBase::getMeasure());
104 }
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 602 of file BiLinearFormsIntegratorsImpl.hpp.

604 {
606
607 auto integrate = [&](auto &mat) {
609 // get integration weights
610 auto t_w = OpBase::getFTensor0IntegrationWeight();
611 // get base function gradient on rows
612 auto t_row_base = row_data.getFTensor0N();
613 // get coordinate at integration points
614 auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
615
617 auto get_t_vec = [&](const int rr) {
618 std::array<double *, FIELD_DIM> ptrs;
619 for (auto i = 0; i != FIELD_DIM; ++i)
620 ptrs[i] = &mat(rr + i, i);
622 ptrs);
623 };
624
625 // loop over integration points
626 for (int gg = 0; gg != OpBase::nbIntegrationPts; gg++) {
627 const double beta = betaCoeff(t_coords(0), t_coords(1), t_coords(2));
628 // take into account Jacobian
629 const double alpha = t_w * beta;
630 // loop over rows base functions
631 int rr = 0;
632 for (; rr != OpBase::nbRows / FIELD_DIM; rr++) {
633 // get column base functions gradient at gauss point gg
634 auto t_col_base = col_data.getFTensor0N(gg, 0);
635 // get mat vec
636 auto t_vec = get_t_vec(FIELD_DIM * rr);
637 // loop over columns
638 for (int cc = 0; cc != OpBase::nbCols / FIELD_DIM; cc++) {
639 // calculate element of local matrix
640 t_vec(i) += alpha * (t_row_base * t_col_base);
641 ++t_col_base;
642 ++t_vec;
643 }
644 ++t_row_base;
645 }
646 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
647 ++t_row_base;
648 ++t_coords;
649 ++t_w; // move to another integration weight
650 }
652 };
653
654 CHKERR integrate(OpBase::locMat);
655 OpBase::locMat *= vol;
656
658};
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: