v0.16.3
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MoFEM::OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase > Struct Template Reference

#include "src/finite_elements/LinearFormsIntegratorsImpl.hpp"

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

Public Member Functions

 OpBaseTimesVectorImpl (const std::string field_name, boost::shared_ptr< MatrixDouble > vec, ScalarFun beta_coeff=[](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)
 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.
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 Class dedicated to integrate operator.
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
template<int DIM>
auto getNf ()
 Get local vector tensor for assembly.
 
template<int ROW_DIM, int COL_DIM = ROW_DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, COL_DIM >, ROW_DIM, COL_DIM > getLocMat (const int rr)
 Get local matrix tensor for assembly.
 
virtual MoFEMErrorCode iNtegrate (EntData &, EntData &)
 Integrate grad-grad operator.
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 Assemble local matrix into global matrix.
 
virtual MoFEMErrorCode aSsemble (EntData &data)
 Assemble local vector into global vector.
 
virtual size_t getNbOfBaseFunctions (EntitiesFieldData::EntData &data)
 Get number of base functions.
 

Protected Attributes

ScalarFun betaCoeff
 
boost::shared_ptr< MatrixDouble > sourceVec
 
FTensor::Index< 'i', FIELD_DIM > i
 
- 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 = boost::function< MoFEMErrorCode(ForcesAndSourcesCore::UserDataOperator *op_ptr, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, MatrixDouble &m)>
 
- Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
TimeFun timeScalingFun
 assumes that time variable is set
 
FEFun feScalingFun
 set by fe entity handle
 
boost::shared_ptr< Range > entsPtr
 Entities on which element is run.
 
- Static Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
static MatSetValuesHook matSetValuesHook
 

Detailed Description

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

Definition at line 167 of file LinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpBaseTimesVectorImpl()

template<int FIELD_DIM, int S, typename OpBase >
MoFEM::OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase >::OpBaseTimesVectorImpl ( const std::string  field_name,
boost::shared_ptr< MatrixDouble >  vec,
ScalarFun  beta_coeff = [](double, double, double) constexpr { return 1; },
boost::shared_ptr< Range >  ents_ptr = nullptr 
)
inline

Definition at line 169 of file LinearFormsIntegratorsImpl.hpp.

171 { return 1; },
172 boost::shared_ptr<Range> ents_ptr = nullptr)
173 : OpBase(field_name, field_name, OpBase::OPROW, ents_ptr), sourceVec(vec),
174 betaCoeff(beta_coeff) {}
constexpr auto field_name

Member Function Documentation

◆ iNtegrate()

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

Class dedicated to integrate operator.

Parameters
dataentity data on element row
Returns
error code

Reimplemented from MoFEM::OpBaseImpl< A, EleOp >.

Definition at line 691 of file LinearFormsIntegratorsImpl.hpp.

692 {
694
695 using DL = DataLayoutTraits<DataLayout::GaussByCoeffs>;
696 auto get_vec_at_pts =
697 MatrixSizeHelper<GetFTensor1FromMatType<FIELD_DIM, S, DL>, DL>::get(
699
700 const size_t nb_base_functions = row_data.getN().size2() / 3;
701 // get element volume
702 const double vol = OpBase::getMeasure();
703 // get integration weights
704 auto t_w = OpBase::getFTensor0IntegrationWeight();
705 // get base function gradient on rows
706 auto t_row_base = row_data.getFTensor1N<3>();
707 // get coords
708 auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
709 // get vector values
710 auto t_vec_at_pts = get_vec_at_pts();
711 // loop over integration points
712 for (int gg = 0; gg != OpBase::nbIntegrationPts; gg++) {
713 // take into account Jacobian
714 const double alpha =
715 t_w * vol * betaCoeff(t_coords(0), t_coords(1), t_coords(2));
716 // loop over rows base functions
717 int rr = 0;
718 for (; rr != OpBase::nbRows; ++rr) {
719 OpBase::locF[rr] += alpha * t_row_base(i) * t_vec_at_pts(i);
720 ++t_row_base;
721 }
722 for (; rr < nb_base_functions; ++rr)
723 ++t_row_base;
724 ++t_w; // move to another integration weight
725 ++t_vec_at_pts;
726 ++t_coords;
727 }
729}
#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()
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
Definition MatHuHu.hpp:33
VectorDouble locF
local entity vector
int nbRows
number of dofs on rows
int nbIntegrationPts
number of integration points

Member Data Documentation

◆ betaCoeff

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

Definition at line 177 of file LinearFormsIntegratorsImpl.hpp.

◆ i

template<int FIELD_DIM, int S, typename OpBase >
FTensor::Index<'i', FIELD_DIM> MoFEM::OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase >::i
protected

Definition at line 179 of file LinearFormsIntegratorsImpl.hpp.

◆ sourceVec

template<int FIELD_DIM, int S, typename OpBase >
boost::shared_ptr<MatrixDouble> MoFEM::OpBaseTimesVectorImpl< 3, FIELD_DIM, S, GAUSS, OpBase >::sourceVec
protected

Definition at line 178 of file LinearFormsIntegratorsImpl.hpp.


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