v0.13.2
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PoissonExample::OpResF_Domain Struct Reference

#include <users_modules/tutorials/cor-2to5/src/PoissonOperators.hpp>

Inheritance diagram for PoissonExample::OpResF_Domain:
[legend]
Collaboration diagram for PoissonExample::OpResF_Domain:
[legend]

Public Member Functions

 OpResF_Domain (FSource f_source, boost::function< double(const double)> a, boost::shared_ptr< VectorDouble > &field_vals, boost::shared_ptr< MatrixDouble > &grad_vals)
 
- Public Member Functions inherited from PoissonExample::OpF
 OpF (FSource f_source)
 
- Public Member Functions inherited from PoissonExample::OpBaseRhs< VolumeElementForcesAndSourcesCore::UserDataOperator >
 OpBaseRhs (const std::string field_name)
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
 This function is called by finite element. More...
 
virtual MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)=0
 Class dedicated to integrate operator. More...
 
virtual MoFEMErrorCode aSsemble (EntitiesFieldData::EntData &data)=0
 Class dedicated to assemble operator to global system vector. More...
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 Integrate local entity vector. More...
 
- Protected Member Functions inherited from PoissonExample::OpF
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 Integrate local entity vector. More...
 
MoFEMErrorCode aSsemble (EntitiesFieldData::EntData &data)
 assemble local entity vector to the global right hand side More...
 

Protected Attributes

FTensor::Index< 'i', 3 > i
 
boost::function< double(const double)> A
 
boost::shared_ptr< VectorDouble > fieldVals
 
boost::shared_ptr< MatrixDouble > gradVals
 
- Protected Attributes inherited from PoissonExample::OpF
FTensor::Number< 0 > NX
 
FTensor::Number< 1 > NY
 
FTensor::Number< 2 > NZ
 
FSource fSource
 
VectorDouble locVec
 
- Protected Attributes inherited from PoissonExample::OpBaseRhs< VolumeElementForcesAndSourcesCore::UserDataOperator >
int nbRows
 < error code More...
 
int nbIntegrationPts
 number of integration points More...
 

Additional Inherited Members

- Public Types inherited from PoissonExample::OpF
typedef boost::function< double(const double, const double, const double)> FSource
 

Detailed Description

Definition at line 659 of file PoissonOperators.hpp.

Constructor & Destructor Documentation

◆ OpResF_Domain()

PoissonExample::OpResF_Domain::OpResF_Domain ( FSource  f_source,
boost::function< double(const double)>  a,
boost::shared_ptr< VectorDouble > &  field_vals,
boost::shared_ptr< MatrixDouble > &  grad_vals 
)
inline

Definition at line 661 of file PoissonOperators.hpp.

664 : OpF(f_source), A(a), fieldVals(field_vals), gradVals(grad_vals) {}
constexpr double a
OpF(FSource f_source)
boost::shared_ptr< MatrixDouble > gradVals
boost::shared_ptr< VectorDouble > fieldVals
boost::function< double(const double)> A

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode PoissonExample::OpResF_Domain::iNtegrate ( EntitiesFieldData::EntData &  data)
inlineprotectedvirtual

Integrate local entity vector.

Parameters
dataentity data on element row
Returns
error code

Reimplemented from PoissonExample::OpF.

Examples
PoissonOperators.hpp.

Definition at line 674 of file PoissonOperators.hpp.

674 {
676 // set size of local vector
677 locVec.resize(nbRows, false);
678 // clear local entity vector
679 locVec.clear();
680 // get finite element volume
681 double vol = getVolume();
682 // get integration weights
683 auto t_w = getFTensor0IntegrationWeight();
684 // get solution at integration point
685 auto t_u = getFTensor0FromVec(*fieldVals);
686 // get solution at integration point
687 auto t_grad = getFTensor1FromMat<3>(*gradVals);
688 // get base functions on entity
689 auto t_v = data.getFTensor0N();
690 // get base function gradient on rows
691 auto t_v_grad = data.getFTensor1DiffN<3>();
692 // get coordinates at integration points
693 auto t_coords = getFTensor1CoordsAtGaussPts();
694 // loop over all integration points
695 for (int gg = 0; gg != nbIntegrationPts; gg++) {
696 // evaluate constant term
697 const double alpha = vol * t_w;
698 const double source_term =
699 alpha * fSource(t_coords(NX), t_coords(NY), t_coords(NZ));
701 grad_term(i) = (alpha * A(t_u)) * t_grad(i);
702 // get element of local vector
704 &*locVec.data().begin());
705 // loop over base functions
706 for (int rr = 0; rr != nbRows; rr++) {
707 // add to local vector source term
708 t_a += t_v_grad(i) * grad_term(i) + t_v * source_term;
709 ++t_a; // move to next element of local vector
710 ++t_v; // move to next base function
711 ++t_v_grad; // move to next gradient of base function
712 }
713 ++t_w; // move to next integration weights
714 ++t_u; // move to next value
715 ++t_grad; // move to next gradient value
716 ++t_coords; // move to next physical coordinates at integration point
717 }
719 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
FTensor::Number< 2 > NZ
FTensor::Number< 1 > NY
FTensor::Number< 0 > NX
FTensor::Index< 'i', 3 > i

Member Data Documentation

◆ A

boost::function<double(const double)> PoissonExample::OpResF_Domain::A
protected
Examples
PoissonOperators.hpp.

Definition at line 721 of file PoissonOperators.hpp.

◆ fieldVals

boost::shared_ptr<VectorDouble> PoissonExample::OpResF_Domain::fieldVals
protected
Examples
PoissonOperators.hpp.

Definition at line 722 of file PoissonOperators.hpp.

◆ gradVals

boost::shared_ptr<MatrixDouble> PoissonExample::OpResF_Domain::gradVals
protected
Examples
PoissonOperators.hpp.

Definition at line 723 of file PoissonOperators.hpp.

◆ i

FTensor::Index<'i', 3> PoissonExample::OpResF_Domain::i
protected
Examples
PoissonOperators.hpp.

Definition at line 667 of file PoissonOperators.hpp.


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