v0.15.0
Loading...
Searching...
No Matches
PoissonExample::OpRes_g Struct Reference

#include "tutorials/cor-2to5/src/PoissonOperators.hpp"

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

Public Member Functions

 OpRes_g (FVal f_value, boost::shared_ptr< VectorDouble > &field_vals)
 
- Public Member Functions inherited from PoissonExample::Op_g
 Op_g (FVal f_value, const string field_name="L", const double beta=1)
 
- Public Member Functions inherited from PoissonExample::OpBaseRhs< FaceElementForcesAndSourcesCore::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.
 
virtual MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)=0
 Class dedicated to integrate operator.
 
virtual MoFEMErrorCode aSsemble (EntitiesFieldData::EntData &data)=0
 Class dedicated to assemble operator to global system vector.
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 Integrate local constrains vector.
 
- Protected Member Functions inherited from PoissonExample::Op_g
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 Integrate local constrains vector.
 
MoFEMErrorCode aSsemble (EntitiesFieldData::EntData &data)
 assemble constrains vectors
 

Protected Attributes

boost::shared_ptr< VectorDouble > fieldVals
 
- Protected Attributes inherited from PoissonExample::Op_g
FTensor::Number< 0 > NX
 x-direction index
 
FTensor::Number< 1 > NY
 y-direction index
 
FTensor::Number< 2 > NZ
 z-direction index
 
FVal fValue
 Function pointer evaluating values of "U" at the boundary.
 
VectorDouble locVec
 
const double bEta
 
- Protected Attributes inherited from PoissonExample::OpBaseRhs< FaceElementForcesAndSourcesCore::UserDataOperator >
int nbRows
 < error code
 
int nbIntegrationPts
 number of integration points
 

Additional Inherited Members

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

Detailed Description

Definition at line 729 of file PoissonOperators.hpp.

Constructor & Destructor Documentation

◆ OpRes_g()

PoissonExample::OpRes_g::OpRes_g ( FVal f_value,
boost::shared_ptr< VectorDouble > & field_vals )
inline
Examples
PoissonOperators.hpp.

Definition at line 731 of file PoissonOperators.hpp.

732 : Op_g(f_value, "L", 1), fieldVals(field_vals) {}
boost::shared_ptr< VectorDouble > fieldVals
Op_g(FVal f_value, const string field_name="L", const double beta=1)

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode PoissonExample::OpRes_g::iNtegrate ( EntitiesFieldData::EntData & data)
inlineprotected

Integrate local constrains vector.

Examples
PoissonOperators.hpp.

Definition at line 740 of file PoissonOperators.hpp.

740 {
742 // set size to local vector
743 locVec.resize(nbRows, false);
744 // clear local vector
745 locVec.clear();
746 // get face area
747 const double area = getArea() * bEta;
748 // get integration weight
749 auto t_w = getFTensor0IntegrationWeight();
750 // get base function
751 auto t_l = data.getFTensor0N();
752 // get solution at integration point
753 auto t_u = getFTensor0FromVec(*fieldVals);
754 // get coordinates at integration point
755 auto t_coords = getFTensor1CoordsAtGaussPts();
756 // make loop over integration points
757 for (int gg = 0; gg != nbIntegrationPts; gg++) {
758 // evaluate function on boundary and scale it by area and integration
759 // weight
760 double alpha = area * t_w;
761 // get element of vector
763 &*locVec.data().begin());
764 for (int rr = 0; rr != nbRows; rr++) {
765 t_a += alpha * t_l *
766 (t_u - fValue(t_coords(NX), t_coords(NY), t_coords(NZ)));
767 ++t_a;
768 ++t_l;
769 }
770 ++t_w;
771 ++t_u;
772 ++t_coords;
773 }
775 }
#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()
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
FTensor::Number< 2 > NZ
z-direction index
FTensor::Number< 0 > NX
x-direction index
FTensor::Number< 1 > NY
y-direction index
FVal fValue
Function pointer evaluating values of "U" at the boundary.

Member Data Documentation

◆ fieldVals

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

Definition at line 735 of file PoissonOperators.hpp.


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