v0.13.2
Loading...
Searching...
No Matches
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

Definition at line 94 of file MinimalSurfaceElement.hpp.

95 : EdgeElementForcesAndSourcesCore::UserDataOperator(
96 field_name, UserDataOperator::OPROW),
97 vF(v_f) {}
constexpr auto field_name

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 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
virtual double evalFunction(double x, double y)
Function on boundary Inherit this class and overload this function to change bc.

◆ 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: