390 {
392
393 auto x_ptr = boost::make_shared<MatrixDouble>();
394 auto det_ptr = boost::make_shared<VectorDouble>();
395 auto jac_ptr = boost::make_shared<MatrixDouble>();
396 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
397
400
401 auto post_proc_fe =
402 boost::make_shared<PostProcBrokenMeshInMoab<DomainEle>>(
mField);
403
404 post_proc_fe->getOpPtrVector().push_back(
406
408
409 post_proc_fe->getOpPtrVector().push_back(
410
411 new OpPPMap(post_proc_fe->getPostProcMesh(),
412 post_proc_fe->getMapGaussPts(),
413
414 {},
415
416 {{"HO_POSITIONS", x_ptr}},
417
418 {}, {}
419
420 )
421
422 );
423
425 CHKERR post_proc_fe->writeFile(
"out_approx.h5m");
426
427 auto error_fe = boost::make_shared<DomainEle>(
mField);
428
429 error_fe->getOpPtrVector().push_back(
431 error_fe->getOpPtrVector().push_back(
433 error_fe->getOpPtrVector().push_back(
new OpError(
"HO_POSITIONS", x_ptr));
434
435 error_fe->preProcessHook = [&]() {
437 MOFEM_LOG(
"EXAMPLE", Sev::inform) <<
"Create vec ";
442 };
443
444 error_fe->postProcessHook = [&]() {
448 double error2;
451 <<
"Error " << std::sqrt(error2 / (4 * M_PI *
A *
A));
454 };
455
457
462 "PARALLEL=WRITE_PART");
463 else
466}
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 createVectorMPI(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
Specialization for MatrixDouble vector field values calculation.
Calculate normal vectors at Gauss points of face elements.
Post post-proc data at points from hash maps.
Simple interface for fast problem set-up.
MoFEMErrorCode getDM(DM *dm)
Get DM.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
static SmartPetscObj< Vec > errorVec