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

Evaluate function values and gradients at Gauss Pts. More...

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

Inherits UserDataOperator.

Collaboration diagram for MinimalSurfaceEquation::MinimalSurfaceElement::OpCalculateCoefficientsAtGaussPts:
[legend]

Public Member Functions

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

Public Attributes

CommonDatacommonData
 
bool rhsAndNotLhs
 

Detailed Description

Evaluate function values and gradients at Gauss Pts.

Examples
minimal_surface_area.cpp.

Definition at line 229 of file MinimalSurfaceElement.hpp.

Constructor & Destructor Documentation

◆ OpCalculateCoefficientsAtGaussPts()

MinimalSurfaceEquation::MinimalSurfaceElement::OpCalculateCoefficientsAtGaussPts::OpCalculateCoefficientsAtGaussPts ( const string  field_name,
CommonData common_data,
bool  rhs_and_not_lhs 
)

Member Function Documentation

◆ doWork()

PetscErrorCode MinimalSurfaceEquation::MinimalSurfaceElement::OpCalculateCoefficientsAtGaussPts::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData &  data 
)

Definition at line 240 of file MinimalSurfaceElement.hpp.

241  {
243 
244  // Element loops over entities, it start from vertices
245  if (type == MBVERTEX) {
246  int nb_gauss_pts = data.getN().size1();
247  commonData.normGradU2.resize(nb_gauss_pts, false);
248  for (int gg = 0; gg != nb_gauss_pts; gg++) {
249  ublas::matrix_row<MatrixDouble> grad_at_gauss_pt(commonData.gradU,
250  gg);
251  commonData.normGradU2[gg] =
252  inner_prod(grad_at_gauss_pt, grad_at_gauss_pt);
253  }
254  commonData.aN.resize(nb_gauss_pts, false);
255  for (int gg = 0; gg != nb_gauss_pts; gg++) {
256  commonData.aN[gg] = 1. / sqrt(1 + commonData.normGradU2[gg]);
257  }
258  if (rhsAndNotLhs) {
259  // needed at right hand side when residual is calculated
260  commonData.aNbyGradU.resize(nb_gauss_pts, 2, false);
261  for (int gg = 0; gg != nb_gauss_pts; gg++) {
262  ublas::matrix_row<MatrixDouble> grad_at_gauss_pt(commonData.gradU,
263  gg);
264  for (int rr = 0; rr != 2; rr++) {
265  commonData.aNbyGradU(gg, rr) =
266  commonData.aN[gg] * grad_at_gauss_pt[rr];
267  }
268  }
269  } else {
270  // needed at left hand side when matrix is calculated
271  commonData.aNpow3byGradU.resize(nb_gauss_pts, 2, false);
272  for (int gg = 0; gg != nb_gauss_pts; gg++) {
273  ublas::matrix_row<MatrixDouble> grad_at_gauss_pt(commonData.gradU,
274  gg);
275  for (int rr = 0; rr != 2; rr++) {
276  commonData.aNpow3byGradU(gg, rr) =
277  pow(commonData.aN[gg], 3) * grad_at_gauss_pt[rr];
278  }
279  }
280  }
281  }
282 
283  // doVerticesRow = true;
284  // doEdgesRow = false;
285  // doQuadsRow = false;
286  // doTrisRow = false;
287  // doTetsRow = false;
288  // doPrismsRow = false;
289 
291  }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
VectorDouble normGradU2
size of nb_gauss_pts, norm of gradient
MatrixDouble gradU
nb_gauss_pts x 2 gradients at integration pts
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

Member Data Documentation

◆ commonData

CommonData& MinimalSurfaceEquation::MinimalSurfaceElement::OpCalculateCoefficientsAtGaussPts::commonData

Definition at line 231 of file MinimalSurfaceElement.hpp.

◆ rhsAndNotLhs

bool MinimalSurfaceEquation::MinimalSurfaceElement::OpCalculateCoefficientsAtGaussPts::rhsAndNotLhs

Definition at line 232 of file MinimalSurfaceElement.hpp.


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