v0.14.0
Public Member Functions | Public Attributes | List of all members
AtomTest::OpErrorSkel< 1 > Struct Reference
Inheritance diagram for AtomTest::OpErrorSkel< 1 >:
[legend]
Collaboration diagram for AtomTest::OpErrorSkel< 1 >:
[legend]

Public Member Functions

 OpErrorSkel (boost::shared_ptr< CommonData > &common_data_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Public Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

Definition at line 281 of file hanging_node_approx.cpp.

Constructor & Destructor Documentation

◆ OpErrorSkel()

AtomTest::OpErrorSkel< 1 >::OpErrorSkel ( boost::shared_ptr< CommonData > &  common_data_ptr)
inline

Definition at line 283 of file hanging_node_approx.cpp.

284  : BoundaryEleOp(H1, OPSPACE), commonDataPtr(common_data_ptr) {}

Member Function Documentation

◆ doWork()

MoFEMErrorCode AtomTest::OpErrorSkel< 1 >::doWork ( int  side,
EntityType  type,
EntData data 
)
inline

Definition at line 285 of file hanging_node_approx.cpp.

285  {
287 
289 
290  const int nb_integration_pts = getGaussPts().size2();
291  auto t_w = getFTensor0IntegrationWeight();
292  auto t_val = getFTensor0FromVec(*(commonDataPtr->approxVals));
293  auto t_coords = getFTensor1CoordsAtGaussPts();
294 
295  const double volume = getMeasure();
296 
297  double error2 = 0;
298  for (int gg = 0; gg != nb_integration_pts; ++gg) {
299 
300  const double alpha = t_w * volume;
301  double diff = t_val - AtomTest::approxFunction(t_coords(0), t_coords(1),
302  t_coords(2));
303  error2 += alpha * (pow(diff, 2));
304 
305  ++t_w;
306  ++t_val;
307  ++t_coords;
308  }
309 
310  MOFEM_LOG("SELF", Sev::verbose) << "Boundary error " << sqrt(error2);
311 
312  constexpr double eps = 1e-8;
313  if (sqrt(error2) > eps)
314  SETERRQ1(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
315  "Error on boundary = %6.4e", sqrt(error2));
316 
318  }

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<CommonData> AtomTest::OpErrorSkel< 1 >::commonDataPtr

Definition at line 282 of file hanging_node_approx.cpp.


The documentation for this struct was generated from the following file:
H1
@ H1
continuous field
Definition: definitions.h:85
BoundaryEleOp
BoundaryEle::UserDataOperator BoundaryEleOp
Definition: hanging_node_approx.cpp:27
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
AtomTest::OpErrorSkel< 1 >::commonDataPtr
boost::shared_ptr< CommonData > commonDataPtr
Definition: hanging_node_approx.cpp:282
AtomTest::approxFunction
static ApproxFieldFunction< FIELD_DIM > approxFunction
Definition: child_and_parent.cpp:67
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', SPACE_DIM >
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
eps
static const double eps
Definition: check_base_functions_derivatives_on_tet.cpp:11
MOFEM_ATOM_TEST_INVALID
@ MOFEM_ATOM_TEST_INVALID
Definition: definitions.h:40
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