v0.15.0
Loading...
Searching...
No Matches
MoFEM::OpMassImpl< 3, FIELD_DIM, GAUSS, OpBase > Struct Template Reference

#include "src/finite_elements/BiLinearFormsIntegratorsImpl.hpp"

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

Public Member Functions

 OpMassImpl (const std::string row_field_name, const std::string col_field_name, ScalarFun beta=scalar_fun_one, boost::shared_ptr< Range > ents_ptr=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)
 
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 &row_data, EntitiesFieldData::EntData &col_data)
 Integrate grad-grad operator.
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
template<int DIM>
FTensor::Tensor1< FTensor::PackPtr< double *, DIM >, DIM > getNf ()
 
template<int DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, DIM >, DIM, DIM > getLocMat (const int rr)
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 
virtual MoFEMErrorCode iNtegrate (EntData &data)
 Class dedicated to integrate operator.
 
virtual MoFEMErrorCode aSsemble (EntData &data)
 
virtual size_t getNbOfBaseFunctions (EntitiesFieldData::EntData &data)
 Get number of base functions.
 

Protected Attributes

ScalarFun betaCoeff
 
- 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
 
- 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
 

Detailed Description

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

Definition at line 108 of file BiLinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpMassImpl()

template<int FIELD_DIM, typename OpBase >
MoFEM::OpMassImpl< 3, FIELD_DIM, GAUSS, OpBase >::OpMassImpl ( const std::string row_field_name,
const std::string col_field_name,
ScalarFun beta = scalar_fun_one,
boost::shared_ptr< Range > ents_ptr = nullptr )
inline

Definition at line 110 of file BiLinearFormsIntegratorsImpl.hpp.

113 : OpBase(row_field_name, col_field_name, OpBase::OPROWCOL, ents_ptr),
114 betaCoeff(beta) {
115 if (row_field_name == col_field_name)
116 this->sYmm = true;
117 }
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition radiation.cpp:29

Member Function Documentation

◆ iNtegrate()

template<int FIELD_DIM, typename OpBase >
MoFEMErrorCode MoFEM::OpMassImpl< 3, FIELD_DIM, GAUSS, OpBase >::iNtegrate ( EntitiesFieldData::EntData & row_data,
EntitiesFieldData::EntData & col_data )
protectedvirtual

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::OpBaseImpl< A, EleOp >.

Definition at line 661 of file BiLinearFormsIntegratorsImpl.hpp.

663 {
666 size_t nb_base_functions = row_data.getN().size2() / 3;
667 // // get element volume
668 const double vol = OpBase::getMeasure();
669 // get integration weights
670 auto t_w = OpBase::getFTensor0IntegrationWeight();
671 // get base function gradient on rows
672 auto t_row_base = row_data.getFTensor1N<3>();
673 // get coordinate at integration points
674 auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
675 // loop over integration points
676 for (int gg = 0; gg != OpBase::nbIntegrationPts; gg++) {
677 const double beta = vol * betaCoeff(t_coords(0), t_coords(1), t_coords(2));
678 // take into account Jacobian
679 const double alpha = t_w * beta;
680 // loop over rows base functions
681 auto a_mat_ptr = &*OpBase::locMat.data().begin();
682 int rr = 0;
683 for (; rr != OpBase::nbRows; rr++) {
684 // get column base functions gradient at gauss point gg
685 auto t_col_base = col_data.getFTensor1N<3>(gg, 0);
686 // loop over columns
687 for (int cc = 0; cc != OpBase::nbCols; cc++) {
688 // calculate element of local matrix
689 (*a_mat_ptr) += alpha * (t_row_base(i) * t_col_base(i));
690 ++t_col_base;
691 ++a_mat_ptr;
692 }
693 ++t_row_base;
694 }
695 for (; rr < nb_base_functions; ++rr)
696 ++t_row_base;
697 ++t_coords;
698 ++t_w; // move to another integration weight
699 }
701};
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
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

Member Data Documentation

◆ betaCoeff

template<int FIELD_DIM, typename OpBase >
ScalarFun MoFEM::OpMassImpl< 3, FIELD_DIM, GAUSS, OpBase >::betaCoeff
protected

Definition at line 120 of file BiLinearFormsIntegratorsImpl.hpp.


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