v0.9.1
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/basic_finite_elements/mix_transport/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, DataForcesAndSourcesCore::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 1094 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 1103 of file MixTransportElement.hpp.

1106  fluxes_name, UserDataOperator::OPROW),
1107  cTx(ctx), F(f) {}
ForcesAndSourcesCore::UserDataOperator UserDataOperator

Member Function Documentation

◆ doWork()

MoFEMErrorCode MixTransport::MixTransportElement::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

Definition at line 1118 of file MixTransportElement.hpp.

1119  {
1121  if (data.getFieldData().size() == 0)
1123  EntityHandle fe_ent = getNumeredEntFiniteElementPtr()->getEnt();
1124  nF.resize(data.getIndices().size());
1125  nF.clear();
1126  int nb_gauss_pts = data.getN().size1();
1127  for (int gg = 0; gg < nb_gauss_pts; gg++) {
1128  double x, y, z;
1129  if (getNormalsAtGaussPts().size1() == (unsigned int)nb_gauss_pts) {
1130  x = getHoCoordsAtGaussPts()(gg, 0);
1131  y = getHoCoordsAtGaussPts()(gg, 1);
1132  z = getHoCoordsAtGaussPts()(gg, 2);
1133  } else {
1134  x = getCoordsAtGaussPts()(gg, 0);
1135  y = getCoordsAtGaussPts()(gg, 1);
1136  z = getCoordsAtGaussPts()(gg, 2);
1137  }
1138  double value;
1139  CHKERR cTx.getBcOnValues(fe_ent, gg, x, y, z, value);
1140  ;
1141  double w = getGaussPts()(2, gg) * 0.5;
1142  if (getNormalsAtGaussPts().size1() == (unsigned int)nb_gauss_pts) {
1143  noalias(nF) +=
1144  w * prod(data.getVectorN<3>(gg), getNormalsAtGaussPts(gg)) *
1145  value;
1146  } else {
1147  noalias(nF) += w * prod(data.getVectorN<3>(gg), getNormal()) * value;
1148  }
1149  }
1150  Vec f = (F != PETSC_NULL) ? F : getFEMethod()->ts_F;
1151  CHKERR VecSetValues(f, data.getIndices().size(), &data.getIndices()[0],
1152  &nF[0], ADD_VALUES);
1153 
1155  }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:514
MoFEMErrorCode VecSetValues(Vec V, const DataForcesAndSourcesCore::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
#define CHKERR
Inline error check.
Definition: definitions.h:602
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
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413
double w(const double g, const double t)
Definition: ContactOps.hpp:160

Member Data Documentation

◆ cTx

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

Definition at line 1097 of file MixTransportElement.hpp.

◆ F

Vec MixTransport::MixTransportElement::OpRhsBcOnValues::F

Definition at line 1098 of file MixTransportElement.hpp.

◆ nF

VectorDouble MixTransport::MixTransportElement::OpRhsBcOnValues::nF

Definition at line 1109 of file MixTransportElement.hpp.


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