v0.13.2
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/BiLinearFormsIntegrators.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 iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 Integrate grad-grad operator. More...
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 Integrate grad-grad operator. More...
 
- 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 iNtegrate (EntData &row_data, EntData &col_data)
 Integrate grad-grad operator. More...
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 
virtual MoFEMErrorCode iNtegrate (EntData &data)
 Class dedicated to integrate operator. More...
 
virtual MoFEMErrorCode aSsemble (EntData &data)
 

Additional Inherited Members

- Public Types inherited from MoFEM::OpBaseImpl< A, EleOp >
using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 
- 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)
 
- 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. More...
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntData &row_data)
 Do calculations for the right hand side. More...
 
- Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
TimeFun timeScalingFun
 assumes that time variable is set More...
 
FEFun feScalingFun
 assumes that time variable is set More...
 
boost::shared_ptr< RangeentsPtr
 Entities on which element is run. More...
 
- Protected Attributes inherited from MoFEM::OpMassImpl< 1, 1, GAUSS, OpBase >
ScalarFun betaCoeff
 
- Protected Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
int nbRows
 number of dofs on rows More...
 
int nbCols
 number if dof on column More...
 
int nbIntegrationPts
 number of integration points More...
 
int nbRowBaseFunctions
 number or row base functions More...
 
int rowSide
 row side number More...
 
int colSide
 column side number More...
 
EntityType rowType
 row type More...
 
EntityType colType
 column type More...
 
bool assembleTranspose
 
bool onlyTranspose
 
MatrixDouble locMat
 local entity block matrix More...
 
MatrixDouble locMatTranspose
 local entity block matrix More...
 
VectorDouble locF
 local entity vector More...
 

Detailed Description

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

Definition at line 83 of file BiLinearFormsIntegrators.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 
)
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::OpMassImpl< 1, 1, GAUSS, OpBase >.

Definition at line 741 of file BiLinearFormsIntegrators.hpp.

743 {
745 // get element volume
746 const double vol = OpBase::getMeasure();
747 // get integration weights
748 auto t_w = OpBase::getFTensor0IntegrationWeight();
749 // get base function gradient on rows
750 auto t_row_base = row_data.getFTensor0N();
751 // get coordinate at integration points
752 auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
753
755 auto get_t_vec = [&](const int rr) {
756 std::array<double *, FIELD_DIM> ptrs;
757 for (auto i = 0; i != FIELD_DIM; ++i)
758 ptrs[i] = &OpBase::locMat(rr + i, i);
760 ptrs);
761 };
762
763 // loop over integration points
764 for (int gg = 0; gg != OpBase::nbIntegrationPts; gg++) {
765 const double beta = vol * betaCoeff(t_coords(0), t_coords(1), t_coords(2));
766 // take into account Jacobian
767 const double alpha = t_w * beta;
768 // loop over rows base functions
769 int rr = 0;
770 for (; rr != OpBase::nbRows / FIELD_DIM; rr++) {
771 // get column base functions gradient at gauss point gg
772 auto t_col_base = col_data.getFTensor0N(gg, 0);
773 // get mat vec
774 auto t_vec = get_t_vec(FIELD_DIM * rr);
775 // loop over columns
776 for (int cc = 0; cc != OpBase::nbCols / FIELD_DIM; cc++) {
777 // calculate element of local matrix
778 t_vec(i) += alpha * (t_row_base * t_col_base);
779 ++t_col_base;
780 ++t_vec;
781 }
782 ++t_row_base;
783 }
784 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
785 ++t_row_base;
786 ++t_coords;
787 ++t_w; // move to another integration weight
788 }
790};
constexpr int FIELD_DIM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
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: