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

#include "src/finite_elements/LinearFormsIntegratorsImpl.hpp"

Inheritance diagram for MoFEM::OpBaseTimesVectorImpl< 1, FIELD_DIM, S, GAUSS, OpBase >:
[legend]
Collaboration diagram for MoFEM::OpBaseTimesVectorImpl< 1, 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.
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &, EntitiesFieldData::EntData &)
 Integrate grad-grad operator.
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
template<int DIM>
auto 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 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< MatrixDoublesourceVec
 
FTensor::Index< 'i', FIELD_DIMi
 
- 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< 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, int S, typename OpBase>
struct MoFEM::OpBaseTimesVectorImpl< 1, FIELD_DIM, S, GAUSS, OpBase >

Definition at line 144 of file LinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpBaseTimesVectorImpl()

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

Definition at line 146 of file LinearFormsIntegratorsImpl.hpp.

148 { return 1; },
149 boost::shared_ptr<Range> ents_ptr = nullptr)
150 : OpBase(field_name, field_name, OpBase::OPROW, ents_ptr),
151 betaCoeff(beta_coeff), sourceVec(vec) {}
constexpr auto field_name

Member Function Documentation

◆ iNtegrate() [1/2]

template<int FIELD_DIM, int S, typename OpBase >
MoFEMErrorCode MoFEM::OpBaseTimesVectorImpl< 1, FIELD_DIM, S, GAUSS, OpBase >::iNtegrate ( EntitiesFieldData::EntData ,
EntitiesFieldData::EntData  
)
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::OpBaseImpl< A, EleOp >.

Definition at line 160 of file LinearFormsIntegratorsImpl.hpp.

161 {
163 }
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32

◆ iNtegrate() [2/2]

template<int FIELD_DIM, int S, typename OpBase >
MoFEMErrorCode MoFEM::OpBaseTimesVectorImpl< 1, 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 648 of file LinearFormsIntegratorsImpl.hpp.

649 {
651
652 using DL = DataLayoutTraits<DataLayout::GaussByCoeffs>;
653 auto get_vec_at_pts =
654 MatrixSizeHelper<GetFTensor1FromMatType<FIELD_DIM, S, DL>, DL>::get(
656
657 // get element volume
658 const double vol = OpBase::getMeasure();
659 // get integration weights
660 auto t_w = OpBase::getFTensor0IntegrationWeight();
661 // get base function gradient on rows
662 auto t_row_base = row_data.getFTensor0N();
663 // get coords
664 auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
665 // get vector values
666 auto t_vec_at_pts = get_vec_at_pts();
667 // loop over integration points
668 for (int gg = 0; gg != OpBase::nbIntegrationPts; gg++) {
669 // take into account Jacobian
670 const double beta = betaCoeff(t_coords(0), t_coords(1), t_coords(2));
671 const double alpha = t_w * vol * beta;
672 // get loc vector tensor
673 auto t_nf = OpBase::template getNf<FIELD_DIM>();
674 // loop over rows base functions
675 int rr = 0;
676 for (; rr != OpBase::nbRows / FIELD_DIM; ++rr) {
677 t_nf(i) += alpha * t_row_base * t_vec_at_pts(i);
678 ++t_row_base;
679 ++t_nf;
680 }
681 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
682 ++t_row_base;
683 ++t_w; // move to another integration weight
684 ++t_vec_at_pts;
685 ++t_coords;
686 }
688}
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()
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
Definition MatHuHu.hpp:33
int nbRows
number of dofs on rows
int nbIntegrationPts
number of integration points
int nbRowBaseFunctions
number or row base functions

Member Data Documentation

◆ betaCoeff

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

Definition at line 156 of file LinearFormsIntegratorsImpl.hpp.

◆ i

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

Definition at line 158 of file LinearFormsIntegratorsImpl.hpp.

◆ sourceVec

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

Definition at line 157 of file LinearFormsIntegratorsImpl.hpp.


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