v0.14.0
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
OpError Struct Reference
Inheritance diagram for OpError:
[legend]
Collaboration diagram for OpError:
[legend]

Public Member Functions

 OpError (boost::shared_ptr< VectorDouble > u_at_pts_ptr, double &l2_error)
 
 OpError (const std::string field_name, boost::shared_ptr< MatrixDouble > x_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Static Public Attributes

static SmartPetscObj< Vec > errorVec
 

Private Attributes

boost::shared_ptr< VectorDouble > uAtPtsPtr
 
doublel2Error
 
boost::shared_ptr< MatrixDouble > xPtr
 

Detailed Description

Examples
approx_sphere.cpp, child_and_parent.cpp, dg_projection.cpp, hanging_node_approx.cpp, higher_derivatives.cpp, mixed_poisson.cpp, and PoissonOperators.hpp.

Definition at line 61 of file initial_diffusion.cpp.

Constructor & Destructor Documentation

◆ OpError() [1/2]

OpError::OpError ( boost::shared_ptr< VectorDouble >  u_at_pts_ptr,
double l2_error 
)
inline

Definition at line 62 of file initial_diffusion.cpp.

63  : DomainEleOp("PHOTON_FLUENCE_RATE", OPROW), uAtPtsPtr(u_at_pts_ptr),
64  l2Error(l2_error) {
65  // Only will be executed once on vertices
66  std::fill(&doEntities[MBEDGE], &doEntities[MBMAXTYPE], false);
67  }

◆ OpError() [2/2]

OpError::OpError ( const std::string  field_name,
boost::shared_ptr< MatrixDouble >  x_ptr 
)
inline

Definition at line 221 of file approx_sphere.cpp.

222  : DomainEleOp(field_name, field_name, AssemblyDomainEleOp::OPROW),
223  xPtr(x_ptr) {
224 
225  std::fill(&doEntities[MBEDGE], &doEntities[MBMAXTYPE], false);
226  }

Member Function Documentation

◆ doWork()

MoFEMErrorCode OpError::doWork ( int  side,
EntityType  type,
EntData data 
)
inline

Definition at line 228 of file approx_sphere.cpp.

228  {
229 
231 
232  auto t_w = getFTensor0IntegrationWeight();
233  auto t_x = getFTensor1FromMat<3>(*xPtr);
234  auto t_normal = getFTensor1NormalsAtGaussPts();
235  auto nb_integration_pts = getGaussPts().size2();
236 
237  double error = 0;
238 
239  for (int gg = 0; gg != nb_integration_pts; gg++) {
240 
241  double l = std::sqrt(t_normal(i) * t_normal(i));
242  error += t_w * l * std::abs((t_x(i) * t_x(i) - A * A));
243 
244  ++t_w;
245  ++t_x;
246  ++t_normal;
247  }
248 
249  CHKERR VecSetValue(errorVec, 0, error, ADD_VALUES);
250 
252  }

Member Data Documentation

◆ errorVec

SmartPetscObj< Vec > OpError::errorVec
static
Examples
approx_sphere.cpp.

Definition at line 254 of file approx_sphere.cpp.

◆ l2Error

double& OpError::l2Error
private

Definition at line 71 of file initial_diffusion.cpp.

◆ uAtPtsPtr

boost::shared_ptr<VectorDouble> OpError::uAtPtsPtr
private

Definition at line 70 of file initial_diffusion.cpp.

◆ xPtr

boost::shared_ptr<MatrixDouble> OpError::xPtr
private

Definition at line 257 of file approx_sphere.cpp.


The documentation for this struct was generated from the following files:
OpError::l2Error
double & l2Error
Definition: initial_diffusion.cpp:71
OpError::uAtPtsPtr
boost::shared_ptr< VectorDouble > uAtPtsPtr
Definition: initial_diffusion.cpp:70
OpError::errorVec
static SmartPetscObj< Vec > errorVec
Definition: approx_sphere.cpp:254
DomainEleOp
DomainEle::UserDataOperator DomainEleOp
Definition: initial_diffusion.cpp:24
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
OpError::xPtr
boost::shared_ptr< MatrixDouble > xPtr
Definition: approx_sphere.cpp:257
i
FTensor::Index< 'i', 3 > i
Definition: approx_sphere.cpp:36
A
constexpr double A
Definition: approx_sphere.cpp:34
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
DomainEleOp
DomainEle::UserDataOperator DomainEleOp
Definition: approx_sphere.cpp:24
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
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21