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

calculate \( \int_\mathcal{S} {\boldsymbol\tau} \cdot \mathbf{n}u \textrm{d}\mathcal{S} \) More...

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

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

Public Member Functions

 OpRhsBcOnValues (MixTransportElement &ctx, const std::string fluxes_name, Vec f)
 Constructor. More...
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Integrate boundary condition. More...
 

Public Attributes

MixTransportElementcTx
 
Vec F
 
VectorDouble nF
 

Detailed Description

calculate \( \int_\mathcal{S} {\boldsymbol\tau} \cdot \mathbf{n}u \textrm{d}\mathcal{S} \)

This terms comes from differentiation by parts. Note that in this Dirichlet boundary conditions are natural.

Definition at line 1055 of file MixTransportElement.hpp.

Constructor & Destructor Documentation

◆ OpRhsBcOnValues()

MixTransport::MixTransportElement::OpRhsBcOnValues::OpRhsBcOnValues ( MixTransportElement ctx,
const std::string  fluxes_name,
Vec  f 
)

Constructor.

Definition at line 1064 of file MixTransportElement.hpp.

1067  fluxes_name, UserDataOperator::OPROW),
1068  cTx(ctx), F(f) {}
ForcesAndSourcesCore::UserDataOperator UserDataOperator

Member Function Documentation

◆ doWork()

MoFEMErrorCode MixTransport::MixTransportElement::OpRhsBcOnValues::doWork ( int  side,
EntityType  type,
EntitiesFieldData::EntData data 
)

Integrate boundary condition.

Parameters
sidelocal index of entity
typetype of entity
datadata on entity
Returns
error code

Definition at line 1079 of file MixTransportElement.hpp.

1080  {
1082  if (data.getFieldData().size() == 0)
1084  EntityHandle fe_ent = getNumeredEntFiniteElementPtr()->getEnt();
1085  nF.resize(data.getIndices().size());
1086  nF.clear();
1087  int nb_gauss_pts = data.getN().size1();
1088  for (int gg = 0; gg < nb_gauss_pts; gg++) {
1089  const double x = getCoordsAtGaussPts()(gg, 0);
1090  const double y = getCoordsAtGaussPts()(gg, 1);
1091  const double z = getCoordsAtGaussPts()(gg, 2);
1092 
1093  double value;
1094  CHKERR cTx.getBcOnValues(fe_ent, gg, x, y, z, value);
1095  ;
1096  double w = getGaussPts()(2, gg) * 0.5;
1097  if (getNormalsAtGaussPts().size1() == (unsigned int)nb_gauss_pts) {
1098  noalias(nF) +=
1099  w * prod(data.getVectorN<3>(gg), getNormalsAtGaussPts(gg)) *
1100  value;
1101  } else {
1102  noalias(nF) += w * prod(data.getVectorN<3>(gg), getNormal()) * value;
1103  }
1104  }
1105  Vec f = (F != PETSC_NULL) ? F : getFEMethod()->ts_F;
1106  CHKERR VecSetValues(f, data.getIndices().size(), &data.getIndices()[0],
1107  &nF[0], ADD_VALUES);
1108 
1110  }
#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)
virtual MoFEMErrorCode getBcOnValues(const EntityHandle ent, const int gg, const double x, const double y, const double z, double &value)
evaluate natural (Dirichlet) boundary conditions

Member Data Documentation

◆ cTx

MixTransportElement& MixTransport::MixTransportElement::OpRhsBcOnValues::cTx

Definition at line 1058 of file MixTransportElement.hpp.

◆ F

Vec MixTransport::MixTransportElement::OpRhsBcOnValues::F

Definition at line 1059 of file MixTransportElement.hpp.

◆ nF

VectorDouble MixTransport::MixTransportElement::OpRhsBcOnValues::nF

Definition at line 1070 of file MixTransportElement.hpp.


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