v0.15.5
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>
FTensor::Tensor1< FTensor::PackPtr< double *, DIM >, DIM > 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 iNtegrate (EntData &row_data, EntData &col_data)
 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< 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< 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 = [](doubledoubledouble) 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 data)
protectedvirtual

Class dedicated to integrate operator.

Parameters
dataentity data on element row
Returns
error code

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

Definition at line 686 of file LinearFormsIntegratorsImpl.hpp.

687 {
689
690 const size_t nb_base_functions = row_data.getN().size2() / 3;
691 // get element volume
692 const double vol = OpBase::getMeasure();
693 // get integration weights
694 auto t_w = OpBase::getFTensor0IntegrationWeight();
695 // get base function gradient on rows
696 auto t_row_base = row_data.getFTensor1N<3>();
697 // get coords
698 auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
699 // get vector values
700 auto t_vec = getFTensor1FromMat<FIELD_DIM, S>(*sourceVec);
701 // loop over integration points
702 for (int gg = 0; gg != OpBase::nbIntegrationPts; gg++) {
703 // take into account Jacobian
704 const double alpha =
705 t_w * vol * betaCoeff(t_coords(0), t_coords(1), t_coords(2));
706 // loop over rows base functions
707 int rr = 0;
708 for (; rr != OpBase::nbRows; ++rr) {
709 OpBase::locF[rr] += alpha * t_row_base(i) * t_vec(i);
710 ++t_row_base;
711 }
712 for (; rr < nb_base_functions; ++rr)
713 ++t_row_base;
714 ++t_w; // move to another integration weight
715 ++t_vec;
716 ++t_coords;
717 }
719}
#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()
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: