371 {
373 auto check_result_fe_ptr = boost::make_shared<DomainEle>(
mField);
381 check_result_fe_ptr->getOpPtrVector(), {H1})),
382 "Apply transform");
383 check_result_fe_ptr->getRuleHook = [](int, int, int p) { return p; };
384 auto analyticalFunction = [&](double x, double y, double z) {
385 return cos(M_PI * x) * cos(M_PI * y);
386 };
387 auto u_ptr = boost::make_shared<VectorDouble>();
388 check_result_fe_ptr->getOpPtrVector().push_back(
390 auto mValFuncPtr = boost::make_shared<VectorDouble>();
391 check_result_fe_ptr->getOpPtrVector().push_back(
393 check_result_fe_ptr->getOpPtrVector().push_back(
395 check_result_fe_ptr->getOpPtrVector().push_back(
401 check_result_fe_ptr);
407
409 const double *L2_norms;
410 const double *Ex_norms;
414 <<
"L2_NORM: " << std::sqrt(L2_norms[
NORM]);
416 << "NORMALISED_ERROR: "
417 << (std::sqrt(L2_norms[
NORM]) / std::sqrt(Ex_norms[
EX_NORM]));
420 }
421
423 const double *L2_norms;
424 const double *Ex_norms;
427 double ref_percentage = 4.4e-04;
428 double normalised_error;
430 case 1:
431 normalised_error = std::sqrt(L2_norms[0]) / std::sqrt(Ex_norms[0]);
432 break;
433 default:
435 "atom test %d does not exist",
atomTest);
436 }
437 if (normalised_error > ref_percentage) {
439 "atom test %d failed! Calculated Norm %3.16e is greater than "
440 "reference Norm %3.16e",
441 atomTest, normalised_error, ref_percentage);
442 }
445 }
447}
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
@ MOFEM_ATOM_TEST_INVALID
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(channel)
Set and reset channel.
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
Get norm of input VectorDouble for Tensor0.
Get values from scalar function at integration points and save them to VectorDouble for Tensor0.
MoFEMErrorCode getDM(DM *dm)
Get DM.
const std::string getDomainFEName() const
Get the Domain FE Name.
SmartPetscObj< Vec > errorVec
SmartPetscObj< Vec > exactVec