v0.12.1
Public Member Functions | Public Attributes | List of all members
MixTransport::UnsaturatedFlowElement::OpRhsBcOnValues Struct Reference

Evaluate boundary condition at the boundary. More...

#include <users_modules/tutorials/cor-0to1/src/UnsaturatedFlow.hpp>

Inheritance diagram for MixTransport::UnsaturatedFlowElement::OpRhsBcOnValues:
[legend]
Collaboration diagram for MixTransport::UnsaturatedFlowElement::OpRhsBcOnValues:
[legend]

Public Member Functions

 OpRhsBcOnValues (UnsaturatedFlowElement &ctx, const std::string fluxes_name, boost::shared_ptr< MethodForForceScaling > &value_scale)
 Constructor. More...
 
MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 Integrate boundary condition. More...
 

Public Attributes

UnsaturatedFlowElementcTx
 
boost::shared_ptr< MethodForForceScalingvalueScale
 
VectorDouble nF
 Vector of residuals. More...
 

Detailed Description

Evaluate boundary condition at the boundary.

Definition at line 254 of file UnsaturatedFlow.hpp.

Constructor & Destructor Documentation

◆ OpRhsBcOnValues()

MixTransport::UnsaturatedFlowElement::OpRhsBcOnValues::OpRhsBcOnValues ( UnsaturatedFlowElement ctx,
const std::string  fluxes_name,
boost::shared_ptr< MethodForForceScaling > &  value_scale 
)

Constructor.

Examples
UnsaturatedFlow.hpp.

Definition at line 263 of file UnsaturatedFlow.hpp.

266  fluxes_name, UserDataOperator::OPROW),
267  cTx(ctx), valueScale(value_scale) {}
ForcesAndSourcesCore::UserDataOperator UserDataOperator
boost::shared_ptr< MethodForForceScaling > valueScale

Member Function Documentation

◆ doWork()

MoFEMErrorCode MixTransport::UnsaturatedFlowElement::OpRhsBcOnValues::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)

Integrate boundary condition.

Parameters
sidelocal index of entity
typetype of entity
datadata on entity
Returns
error code
Examples
UnsaturatedFlow.hpp.

Definition at line 278 of file UnsaturatedFlow.hpp.

279  {
281  if (data.getFieldData().size() == 0)
283  // Get EntityHandle of the finite element
284  EntityHandle fe_ent = getNumeredEntFiniteElementPtr()->getEnt();
285  // Resize and clear vector
286  nF.resize(data.getIndices().size());
287  nF.clear();
288  // Get number of integration points
289  int nb_gauss_pts = data.getN().size1();
290  for (int gg = 0; gg < nb_gauss_pts; gg++) {
291  double x, y, z;
292  x = getCoordsAtGaussPts()(gg, 0);
293  y = getCoordsAtGaussPts()(gg, 1);
294  z = getCoordsAtGaussPts()(gg, 2);
295  double value;
296  // get value of boundary condition
297  CHKERR cTx.getBcOnValues(fe_ent, gg, x, y, z, value);
298  const double w = getGaussPts()(2, gg) * 0.5;
299  const double beta = w * (value - z);
300  noalias(nF) += beta * prod(data.getVectorN<3>(gg), getNormal());
301  }
302  // Scale vector if history evaluating method is given
303  Vec f = getFEMethod()->ts_F;
304  if (valueScale) {
305  CHKERR valueScale->scaleNf(getFEMethod(), nF);
306  }
307  // Assemble vector
308  CHKERR VecSetValues(f, data.getIndices().size(), &data.getIndices()[0],
309  &nF[0], ADD_VALUES);
311  }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
#define CHKERR
Inline error check.
Definition: definitions.h:548
const FTensor::Tensor2< T, Dim, Dim > Vec
double w(const double g, const double t)
MoFEMErrorCode getBcOnValues(const EntityHandle ent, const int gg, const double x, const double y, const double z, double &value)
Get value on boundary.

Member Data Documentation

◆ cTx

UnsaturatedFlowElement& MixTransport::UnsaturatedFlowElement::OpRhsBcOnValues::cTx
Examples
UnsaturatedFlow.hpp.

Definition at line 257 of file UnsaturatedFlow.hpp.

◆ nF

VectorDouble MixTransport::UnsaturatedFlowElement::OpRhsBcOnValues::nF

Vector of residuals.

Examples
UnsaturatedFlow.hpp.

Definition at line 269 of file UnsaturatedFlow.hpp.

◆ valueScale

boost::shared_ptr<MethodForForceScaling> MixTransport::UnsaturatedFlowElement::OpRhsBcOnValues::valueScale
Examples
UnsaturatedFlow.hpp.

Definition at line 258 of file UnsaturatedFlow.hpp.


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