v0.14.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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. 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 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

Definition at line 731 of file PoissonOperators.hpp.

732  : Op_g(f_value, "L", 1), fieldVals(field_vals) {}

Member Function Documentation

◆ iNtegrate()

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

Integrate local constrains vector.

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  }

Member Data Documentation

◆ fieldVals

boost::shared_ptr<VectorDouble> PoissonExample::OpRes_g::fieldVals
protected

Definition at line 735 of file PoissonOperators.hpp.


The documentation for this struct was generated from the following file:
PoissonExample::Op_g::NY
FTensor::Number< 1 > NY
y-direction index
Definition: PoissonOperators.hpp:432
PoissonExample::Op_g::NX
FTensor::Number< 0 > NX
x-direction index
Definition: PoissonOperators.hpp:431
MoFEM::EntitiesFieldData::EntData::getFTensor0N
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
Definition: EntitiesFieldData.hpp:1502
PoissonExample::OpRes_g::fieldVals
boost::shared_ptr< VectorDouble > fieldVals
Definition: PoissonOperators.hpp:735
PoissonExample::Op_g::bEta
const double bEta
Definition: PoissonOperators.hpp:437
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
PoissonExample::Op_g::Op_g
Op_g(FVal f_value, const string field_name="L", const double beta=1)
Definition: PoissonOperators.hpp:425
PoissonExample::Op_g::locVec
VectorDouble locVec
Definition: PoissonOperators.hpp:436
PoissonExample::Op_g::fValue
FVal fValue
Function pointer evaluating values of "U" at the boundary.
Definition: PoissonOperators.hpp:434
FTensor::Tensor0
Definition: Tensor0.hpp:16
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
PoissonExample::OpBaseRhs< FaceElementForcesAndSourcesCore::UserDataOperator >::nbRows
int nbRows
< error code
Definition: PoissonOperators.hpp:207
PoissonExample::OpBaseRhs< FaceElementForcesAndSourcesCore::UserDataOperator >::nbIntegrationPts
int nbIntegrationPts
number of integration points
Definition: PoissonOperators.hpp:208
PoissonExample::Op_g::NZ
FTensor::Number< 2 > NZ
z-direction index
Definition: PoissonOperators.hpp:433