No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PoissonExample::OpRes_g Struct Reference

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

Inheritance diagram for PoissonExample::OpRes_g:
Collaboration diagram for PoissonExample::OpRes_g:

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. 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 constrains vector. More...
- Protected Member Functions inherited from PoissonExample::Op_g
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 Integrate local constrains vector. More...
MoFEMErrorCode aSsemble (EntitiesFieldData::EntData &data)
 assemble constrains vectors More...

Protected Attributes

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

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 726 of file PoissonOperators.hpp.

Constructor & Destructor Documentation

◆ OpRes_g()

PoissonExample::OpRes_g::OpRes_g ( FVal  f_value,
boost::shared_ptr< VectorDouble > &  field_vals 

Definition at line 728 of file PoissonOperators.hpp.

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

Member Function Documentation

◆ iNtegrate()

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

Integrate local constrains vector.

Reimplemented from PoissonExample::Op_g.


Definition at line 737 of file PoissonOperators.hpp.

737 {
739 // set size to local vector
740 locVec.resize(nbRows, false);
741 // clear local vector
742 locVec.clear();
743 // get face area
744 const double area = getArea() * bEta;
745 // get integration weight
746 auto t_w = getFTensor0IntegrationWeight();
747 // get base function
748 auto t_l = data.getFTensor0N();
749 // get solution at integration point
750 auto t_u = getFTensor0FromVec(*fieldVals);
751 // get coordinates at integration point
752 auto t_coords = getFTensor1CoordsAtGaussPts();
753 // make loop over integration points
754 for (int gg = 0; gg != nbIntegrationPts; gg++) {
755 // evaluate function on boundary and scale it by area and integration
756 // weight
757 double alpha = area * t_w;
758 // get element of vector
760 &*locVec.data().begin());
761 for (int rr = 0; rr != nbRows; rr++) {
762 t_a += alpha * t_l *
763 (t_u - fValue(t_coords(NX), t_coords(NY), t_coords(NZ)));
764 ++t_a;
765 ++t_l;
766 }
767 ++t_w;
768 ++t_u;
769 ++t_coords;
770 }
772 }
#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
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

Definition at line 732 of file PoissonOperators.hpp.

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