v0.14.0
Public Member Functions | Public Attributes | List of all members
MinimalSurfaceEquation::MinimalSurfaceElement::OpAssmebleBcRhs Struct Reference

Integrate vector on rhs,. More...

#include <users_modules/minimal_surface_equation/src/MinimalSurfaceElement.hpp>

Inheritance diagram for MinimalSurfaceEquation::MinimalSurfaceElement::OpAssmebleBcRhs:
[legend]
Collaboration diagram for MinimalSurfaceEquation::MinimalSurfaceElement::OpAssmebleBcRhs:
[legend]

Public Member Functions

 OpAssmebleBcRhs (const string field_name, Vec v_f)
 
virtual double evalFunction (double x, double y)
 Function on boundary Inherit this class and overload this function to change bc. More...
 
PetscErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Public Attributes

Vec vF
 
VectorDouble nF
 

Detailed Description

Integrate vector on rhs,.

\[ \mathbf{F} = \int_L \mathbf{N}^\textrm{T} g(x,y) \textrm{d}L \]

Examples
minimal_surface_area.cpp.

Definition at line 91 of file MinimalSurfaceElement.hpp.

Constructor & Destructor Documentation

◆ OpAssmebleBcRhs()

MinimalSurfaceEquation::MinimalSurfaceElement::OpAssmebleBcRhs::OpAssmebleBcRhs ( const string  field_name,
Vec  v_f 
)
inline

Member Function Documentation

◆ doWork()

PetscErrorCode MinimalSurfaceEquation::MinimalSurfaceElement::OpAssmebleBcRhs::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)
inline

Definition at line 108 of file MinimalSurfaceElement.hpp.

109  {
111 
112  int nb_dofs = data.getFieldData().size();
113  if (nb_dofs == 0) {
115  }
116  nF.resize(nb_dofs, false);
117  nF.clear();
118  int nb_gauss_pts = data.getN().size1();
119  for (int gg = 0; gg != nb_gauss_pts; gg++) {
120  double val = getLength() * getGaussPts()(1, gg);
121  double x = getCoordsAtGaussPts()(gg, 0);
122  double y = getCoordsAtGaussPts()(gg, 1);
123  noalias(nF) += val * evalFunction(x, y) * data.getN(gg);
124  }
125  CHKERR VecSetValues(vF, data.getIndices().size(),
126  &*data.getIndices().data().begin(), &nF[0],
127  ADD_VALUES);
129  }

◆ evalFunction()

virtual double MinimalSurfaceEquation::MinimalSurfaceElement::OpAssmebleBcRhs::evalFunction ( double  x,
double  y 
)
inlinevirtual

Function on boundary Inherit this class and overload this function to change bc.

Definition at line 102 of file MinimalSurfaceElement.hpp.

102  {
103  return sin(2 * M_PI * (x + y));
104  // return sin(M_PI*x);
105  }

Member Data Documentation

◆ nF

VectorDouble MinimalSurfaceEquation::MinimalSurfaceElement::OpAssmebleBcRhs::nF

Definition at line 107 of file MinimalSurfaceElement.hpp.

◆ vF

Vec MinimalSurfaceEquation::MinimalSurfaceElement::OpAssmebleBcRhs::vF

Definition at line 93 of file MinimalSurfaceElement.hpp.


The documentation for this struct was generated from the following file:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
MinimalSurfaceEquation::MinimalSurfaceElement::OpAssmebleBcRhs::nF
VectorDouble nF
Definition: MinimalSurfaceElement.hpp:107
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1589
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MinimalSurfaceEquation::MinimalSurfaceElement::OpAssmebleBcRhs::vF
Vec vF
Definition: MinimalSurfaceElement.hpp:93
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
MinimalSurfaceEquation::MinimalSurfaceElement::OpAssmebleBcRhs::evalFunction
virtual double evalFunction(double x, double y)
Function on boundary Inherit this class and overload this function to change bc.
Definition: MinimalSurfaceElement.hpp:102
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPROW
@ OPROW
operator doWork function is executed on FE rows
Definition: ForcesAndSourcesCore.hpp:567