v0.14.0
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)
 
- Protected Member Functions inherited from MoFEM::OpMassImpl< 1, 1, GAUSS, OpBase >
MoFEMErrorCode integrateImpl (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data, double vol)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 

Additional Inherited Members

- 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)
 
- Protected Attributes inherited from MoFEM::OpMassImpl< 1, 1, GAUSS, OpBase >
ScalarFun betaCoeff = [](double, double, double) constexpr { return 1; }
 

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 
)
inlineprotected

Definition at line 101 of file BiLinearFormsIntegratorsImpl.hpp.

102  {
103  return integrateImpl(row_data, col_data, OpBase::getMeasure());
104  }

◆ 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 };

The documentation for this struct was generated from the following file:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
MoFEM::OpBaseImpl::nbIntegrationPts
int nbIntegrationPts
number of integration points
Definition: FormsIntegrators.hpp:238
MoFEM::OpBaseImpl::locMat
MatrixDouble locMat
local entity block matrix
Definition: FormsIntegrators.hpp:249
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
MoFEM::OpMassImpl< 1, 1, GAUSS, OpBase >::betaCoeff
ScalarFun betaCoeff
Definition: BiLinearFormsIntegratorsImpl.hpp:81
FIELD_DIM
constexpr int FIELD_DIM
Definition: child_and_parent.cpp:15
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', FIELD_DIM >
MoFEM::OpBaseImpl::nbRowBaseFunctions
int nbRowBaseFunctions
number or row base functions
Definition: FormsIntegrators.hpp:239
MoFEM::OpBaseImpl::nbCols
int nbCols
number if dof on column
Definition: FormsIntegrators.hpp:237
MoFEM::OpBaseImpl::nbRows
int nbRows
number of dofs on rows
Definition: FormsIntegrators.hpp:236
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEM::OpMassImpl< 1, FIELD_DIM, GAUSS, OpBase >::integrateImpl
MoFEMErrorCode integrateImpl(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data, double vol)
Definition: BiLinearFormsIntegratorsImpl.hpp:602
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359