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

#include "src/finite_elements/LinearFormsIntegratorsImpl.hpp"

Inheritance diagram for MoFEM::OpSourceImpl< 1, FIELD_DIM, GAUSS, SourceFunctionSpecialization::S< OpBase > >:
[legend]
Collaboration diagram for MoFEM::OpSourceImpl< 1, FIELD_DIM, GAUSS, SourceFunctionSpecialization::S< OpBase > >:
[legend]

Public Member Functions

 OpSourceImpl (const std::string field_name, TimeFun time_fun, VectorFun< FIELD_DIM > source_fun, boost::shared_ptr< Range > ents_ptr=nullptr)
 Construct a new Op Source Impl object.
 
 OpSourceImpl (const std::string field_name, VectorFun< FIELD_DIM > source_fun, boost::shared_ptr< Range > ents_ptr=nullptr)
 Construct a new Op Source Impl object.
 
- 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

VectorFun< FIELD_DIMsourceFun
 
- 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, typename OpBase>
struct MoFEM::OpSourceImpl< 1, FIELD_DIM, GAUSS, SourceFunctionSpecialization::S< OpBase > >

Definition at line 66 of file LinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpSourceImpl() [1/2]

template<int FIELD_DIM, typename OpBase >
MoFEM::OpSourceImpl< 1, FIELD_DIM, GAUSS, SourceFunctionSpecialization::S< OpBase > >::OpSourceImpl ( const std::string  field_name,
TimeFun  time_fun,
VectorFun< FIELD_DIM source_fun,
boost::shared_ptr< Range ents_ptr = nullptr 
)
inline

Construct a new Op Source Impl object.

Parameters
field_name
time_fun
source_fun
ents_ptr

Definition at line 77 of file LinearFormsIntegratorsImpl.hpp.

80 : OpBase(field_name, field_name, OpBase::OPROW, time_fun, ents_ptr),
81 sourceFun(source_fun) {}
constexpr auto field_name
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition radiation.cpp:29

◆ OpSourceImpl() [2/2]

template<int FIELD_DIM, typename OpBase >
MoFEM::OpSourceImpl< 1, FIELD_DIM, GAUSS, SourceFunctionSpecialization::S< OpBase > >::OpSourceImpl ( const std::string  field_name,
VectorFun< FIELD_DIM source_fun,
boost::shared_ptr< Range ents_ptr = nullptr 
)
inline

Construct a new Op Source Impl object.

Parameters
field_name
source_fun
ents_ptr

Definition at line 90 of file LinearFormsIntegratorsImpl.hpp.

92 : OpBase(field_name, field_name, OpBase::OPROW, ents_ptr),
93 sourceFun(source_fun) {}

Member Function Documentation

◆ iNtegrate()

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

533 {
536
537 // get element volume
538 const double vol = OpBase::getMeasure();
539 // get integration weights
540 auto t_w = OpBase::getFTensor0IntegrationWeight();
541 // get base function gradient on rows
542 auto t_row_base = row_data.getFTensor0N();
543 // get coordinate at integration points
544 auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
545 // loop over integration points
546 for (int gg = 0; gg != OpBase::nbIntegrationPts; gg++) {
547 // source file
548 auto t_source = sourceFun(t_coords(0), t_coords(1), t_coords(2));
549 // take into account Jacobian
550 const double alpha = t_w * vol;
551 // loop over rows base functions
552 auto t_nf = getFTensor1FromArray<FIELD_DIM, FIELD_DIM>(OpBase::locF);
553 int rr = 0;
554 for (; rr != OpBase::nbRows / FIELD_DIM; ++rr) {
555 t_nf(i) += alpha * t_row_base * t_source(i);
556 ++t_row_base;
557 ++t_nf;
558 }
559 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
560 ++t_row_base;
561 ++t_coords;
562 ++t_w; // move to another integration weight
563 }
565}
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()
FTensor::Index< 'i', SPACE_DIM > i
VectorDouble locF
local entity vector
int nbRows
number of dofs on rows
int nbIntegrationPts
number of integration points
int nbRowBaseFunctions
number or row base functions

Member Data Documentation

◆ sourceFun

template<int FIELD_DIM, typename OpBase >
VectorFun<FIELD_DIM> MoFEM::OpSourceImpl< 1, FIELD_DIM, GAUSS, SourceFunctionSpecialization::S< OpBase > >::sourceFun
protected

Definition at line 96 of file LinearFormsIntegratorsImpl.hpp.


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