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

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

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

Public Member Functions

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

Public Attributes

UnsaturatedFlowElementcTx
 
FTensor::Index< 'i', 3 > i
 

Detailed Description

Definition at line 920 of file UnsaturatedFlow.hpp.

Constructor & Destructor Documentation

◆ OpIntegrateFluxes()

MixTransport::UnsaturatedFlowElement::OpIntegrateFluxes::OpIntegrateFluxes ( UnsaturatedFlowElement ctx,
const std::string  fluxes_name 
)

Constructor.

Examples
UnsaturatedFlow.hpp.

Definition at line 927 of file UnsaturatedFlow.hpp.

930  fluxes_name, UserDataOperator::OPROW),
931  cTx(ctx) {}
ForcesAndSourcesCore::UserDataOperator UserDataOperator

Member Function Documentation

◆ doWork()

MoFEMErrorCode MixTransport::UnsaturatedFlowElement::OpIntegrateFluxes::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
Examples
UnsaturatedFlow.hpp.

Definition at line 942 of file UnsaturatedFlow.hpp.

943  {
945  int nb_dofs = data.getFieldData().size();
946  if (nb_dofs == 0)
948  // Get base function
949  auto t_n_hdiv = data.getFTensor1N<3>();
950  // get normal of face
951  auto t_normal = getFTensor1Normal();
952  // Integration weight
953  auto t_w = getFTensor0IntegrationWeight();
954  double flux_on_entity = 0;
955  int nb_gauss_pts = data.getN().size1();
956  for (int gg = 0; gg < nb_gauss_pts; gg++) {
957  auto t_data = data.getFTensor0FieldData();
958  for (int rr = 0; rr != nb_dofs; rr++) {
959  flux_on_entity -= (0.5 * t_data * t_w) * (t_n_hdiv(i) * t_normal(i));
960  ++t_n_hdiv;
961  ++t_data;
962  }
963  ++t_w;
964  }
965  CHKERR VecSetValue(cTx.ghostFlux, 0, flux_on_entity, ADD_VALUES);
967  }
#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
Vec ghostFlux
Ghost Vector of integrated fluxes.

Member Data Documentation

◆ cTx

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

Definition at line 922 of file UnsaturatedFlow.hpp.

◆ i

FTensor::Index<'i', 3> MixTransport::UnsaturatedFlowElement::OpIntegrateFluxes::i
Examples
UnsaturatedFlow.hpp.

Definition at line 933 of file UnsaturatedFlow.hpp.


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