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

Assemble residual. More...

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

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

Public Member Functions

 OpAssembleResidaul (const string field_name, CommonData &common_data)
 
PetscErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Public Attributes

CommonDatacommonData
 
VectorDouble rEsidual
 

Detailed Description

Assemble residual.

Examples
minimal_surface_area.cpp.

Definition at line 295 of file MinimalSurfaceElement.hpp.

Constructor & Destructor Documentation

◆ OpAssembleResidaul()

MinimalSurfaceEquation::MinimalSurfaceElement::OpAssembleResidaul::OpAssembleResidaul ( const string  field_name,
CommonData common_data 
)
inline

Member Function Documentation

◆ doWork()

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

Definition at line 303 of file MinimalSurfaceElement.hpp.

304  {
306 
307  int nb_dofs = data.getIndices().size();
308  if (nb_dofs == 0) {
310  }
311  rEsidual.resize(nb_dofs, false);
312  rEsidual.clear();
313  int nb_gauss_pts = data.getN().size1();
314  for (int gg = 0; gg != nb_gauss_pts; gg++) {
315  double val = getGaussPts()(2, gg) * getArea();
316  ublas::matrix_row<MatrixDouble> an_by_grad_u(commonData.aNbyGradU, gg);
317  noalias(rEsidual) += val * prod(data.getDiffN(gg), an_by_grad_u);
318  }
319  CHKERR VecSetValues(getFEMethod()->snes_f, data.getIndices().size(),
320  &*data.getIndices().data().begin(), &rEsidual[0],
321  ADD_VALUES);
323  }

Member Data Documentation

◆ commonData

CommonData& MinimalSurfaceEquation::MinimalSurfaceElement::OpAssembleResidaul::commonData

Definition at line 297 of file MinimalSurfaceElement.hpp.

◆ rEsidual

VectorDouble MinimalSurfaceEquation::MinimalSurfaceElement::OpAssembleResidaul::rEsidual

Definition at line 302 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::OpAssembleResidaul::rEsidual
VectorDouble rEsidual
Definition: MinimalSurfaceElement.hpp:302
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::OpAssembleResidaul::commonData
CommonData & commonData
Definition: MinimalSurfaceElement.hpp:297
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
MinimalSurfaceEquation::MinimalSurfaceElement::CommonData::aNbyGradU
MatrixDouble aNbyGradU
nb_gauss_pts x 2,
Definition: MinimalSurfaceElement.hpp:80
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