v0.9.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PoissonExample::OpRes_g Struct Reference

#include <users_modules/basic_finite_elements/poisson/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, DataForcesAndSourcesCore::EntData &row_data)
 This function is called by finite element. More...
 

Protected Member Functions

MoFEMErrorCode iNtegrate (DataForcesAndSourcesCore::EntData &data)
 Integrate local constrains vector. More...
 
- Protected Member Functions inherited from PoissonExample::Op_g
MoFEMErrorCode aSsemble (DataForcesAndSourcesCore::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 739 of file PoissonOperators.hpp.

Constructor & Destructor Documentation

◆ OpRes_g()

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

Definition at line 741 of file PoissonOperators.hpp.

742  : 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 ( DataForcesAndSourcesCore::EntData data)
protectedvirtual

Integrate local constrains vector.

Reimplemented from PoissonExample::Op_g.

Examples
PoissonOperators.hpp.

Definition at line 750 of file PoissonOperators.hpp.

750  {
752  // set size to local vector
753  locVec.resize(nbRows, false);
754  // clear local vector
755  locVec.clear();
756  // get face area
757  const double area = getArea() * bEta;
758  // get integration weight
759  auto t_w = getFTensor0IntegrationWeight();
760  // get base function
761  auto t_l = data.getFTensor0N();
762  // get solution at integration point
763  auto t_u = getFTensor0FromVec(*fieldVals);
764  // get coordinates at integration point
765  auto t_coords = getFTensor1CoordsAtGaussPts();
766  // make loop over integration points
767  for (int gg = 0; gg != nbIntegrationPts; gg++) {
768  // evaluate function on boundary and scale it by area and integration
769  // weight
770  double alpha = area * t_w;
771  // get element of vector
773  &*locVec.data().begin());
774  for (int rr = 0; rr != nbRows; rr++) {
775  t_a += alpha * t_l *
776  (t_u - fValue(t_coords(NX), t_coords(NY), t_coords(NZ)));
777  ++t_a;
778  ++t_l;
779  }
780  ++t_w;
781  ++t_u;
782  ++t_coords;
783  }
785  }
static FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:142
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
boost::shared_ptr< VectorDouble > fieldVals
FTensor::Number< 1 > NY
y-direction index
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
FTensor::Number< 0 > NX
x-direction index
FVal fValue
Function pointer evaluating values of "U" at the boundary.
FTensor::Number< 2 > NZ
z-direction index

Member Data Documentation

◆ fieldVals

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

Definition at line 745 of file PoissonOperators.hpp.


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