373 {
375 auto check_result_fe_ptr = boost::make_shared<DomainEle>(
mField);
383 check_result_fe_ptr->getOpPtrVector(), {H1})),
384 "Apply transform");
385 check_result_fe_ptr->getRuleHook = [](
int,
int,
int p) {
return p; };
386 auto analyticalFunction = [&](double x, double y, double z) {
387 return cos(M_PI * x) * cos(M_PI * y);
388 };
389 auto u_ptr = boost::make_shared<VectorDouble>();
390 check_result_fe_ptr->getOpPtrVector().push_back(
392 auto mValFuncPtr = boost::make_shared<VectorDouble>();
393 check_result_fe_ptr->getOpPtrVector().push_back(
395 check_result_fe_ptr->getOpPtrVector().push_back(
397 check_result_fe_ptr->getOpPtrVector().push_back(
403 check_result_fe_ptr);
409
411 const double *L2_norms;
412 const double *Ex_norms;
416 <<
"L2_NORM: " << std::sqrt(L2_norms[
NORM]);
418 << "NORMALISED_ERROR: "
419 << (std::sqrt(L2_norms[
NORM]) / std::sqrt(Ex_norms[
EX_NORM]));
422 }
423
425 const double *L2_norms;
426 const double *Ex_norms;
429 double ref_percentage = 4.4e-04;
430 double normalised_error;
432 case 1:
433 normalised_error = std::sqrt(L2_norms[0]) / std::sqrt(Ex_norms[0]);
434 break;
435 default:
437 "atom test %d does not exist",
atomTest);
438 }
439 if (normalised_error > ref_percentage) {
441 "atom test %d failed! Calculated Norm %3.16e is greater than "
442 "reference Norm %3.16e",
443 atomTest, normalised_error, ref_percentage);
444 }
447 }
449}
#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