394 {
396
397 auto x_ptr = boost::make_shared<MatrixDouble>();
398 auto det_ptr = boost::make_shared<VectorDouble>();
399 auto jac_ptr = boost::make_shared<MatrixDouble>();
400 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
401
403 auto dm =
simple->getDM();
404
405 auto post_proc_fe =
406 boost::make_shared<PostProcBrokenMeshInMoab<DomainEle>>(
mField);
407
408 post_proc_fe->getOpPtrVector().push_back(
410
412
413 post_proc_fe->getOpPtrVector().push_back(
414
415 new OpPPMap(post_proc_fe->getPostProcMesh(),
416 post_proc_fe->getMapGaussPts(),
417
418 {},
419
420 {{"HO_POSITIONS", x_ptr}},
421
422 {}, {}
423
424 )
425
426 );
427
429 CHKERR post_proc_fe->writeFile(
"out_approx.h5m");
430
431 auto error_fe = boost::make_shared<DomainEle>(
mField);
432
433 error_fe->getOpPtrVector().push_back(
435 error_fe->getOpPtrVector().push_back(
437 error_fe->getOpPtrVector().push_back(
new OpError(
"HO_POSITIONS", x_ptr));
438
439 error_fe->preProcessHook = [&]() {
441 MOFEM_LOG(
"EXAMPLE", Sev::inform) <<
"Create vec ";
446 };
447
448 error_fe->postProcessHook = [&]() {
452 double error2;
455 <<
"Error " << std::sqrt(error2 / (4 * M_PI *
A *
A));
458 };
459
461
466 "PARALLEL=WRITE_PART");
467 else
470}
void simple(double P1[], double P2[], double P3[], double c[], const int N)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
#define MOFEM_LOG(channel, severity)
Log.
auto createSmartVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
virtual int get_comm_size() const =0
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
Get values at integration pts for tensor filed rank 1, i.e. vector field.
Calculate normals at Gauss points of triangle element.
Post post-proc data at points from hash maps.
Simple interface for fast problem set-up.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
static SmartPetscObj< Vec > errorVec