v0.15.0
Loading...
Searching...
No Matches
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) {}
BoundaryEle::UserDataOperator BoundaryEleOp
@ H1
continuous field
Definition definitions.h:85
boost::shared_ptr< CommonData > commonDataPtr

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 SETERRQ(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
315 "Error on boundary = %6.4e", sqrt(error2));
316
318 }
static const double eps
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_ATOM_TEST_INVALID
Definition definitions.h:40
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
constexpr int SPACE_DIM
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
static ApproxFieldFunction< FIELD_DIM > approxFunction

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: