10 #ifdef MOOSE_MFEM_ENABLED 15 #include "libmesh/ignore_warnings.h" 17 #include "libmesh/restore_warnings.h" 23 SamePoint(
const mfem::IntegrationPoint & a,
const mfem::IntegrationPoint & b,
const int dim)
25 constexpr mfem::real_t tol = 1e-12;
26 mfem::real_t pa[3], pb[3];
29 for (
int d = 0; d <
dim; ++d)
32 return std::abs(a.weight - b.weight) < tol;
38 mfem::ElementTransformation & T,
39 const mfem::IntegrationPoint & ip)
const 41 const mfem::QuadratureSpaceBase & qspace = *qf.GetSpace();
42 const int el_idx = qspace.GetEntityIndex(T);
47 const mfem::Geometry::Type geom = qspace.GetGeometry(el_idx);
48 const int dim = mfem::Geometry::Dimension[geom];
49 const mfem::IntegrationRule & stored_rule = qspace.GetIntRule(el_idx);
52 if (ip.index < stored_rule.Size() && SamePoint(stored_rule.IntPoint(ip.index), ip,
dim))
58 const int stored_order = qspace.GetOrder();
59 int suggested_order = -1;
64 for (
int order = 0; order <= 2 * stored_order + 64; ++order)
66 const mfem::IntegrationRule & candidate = mfem::IntRules.Get(geom, order);
67 if (ip.index < candidate.Size() && SamePoint(candidate.IntPoint(ip.index), ip,
dim))
69 suggested_order = order;
74 if (suggested_order >= 0)
77 "' stores values on the order-",
81 " points on this element), but it is being evaluated by an integrator using a " 82 "different quadrature rule (",
83 mfem::IntRules.Get(geom, suggested_order).Size(),
84 " points). The stored values are indexed by quadrature point, so the orders must " 85 "match. Set 'order = ",
93 "' stores values on the order-",
95 " quadrature rule, but it is being evaluated by an integrator using a different " 96 "quadrature rule. The stored values are indexed by quadrature point, so the orders " 97 "must match; adjust 'order' on '",
99 "' to match the consuming integrator.");
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
void CheckIntegrationRule(const mfem::QuadratureFunction &qf, mfem::ElementTransformation &T, const mfem::IntegrationPoint &ip) const
Verify that the integration point ip supplied by a consuming integrator belongs to the same quadratur...
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
const std::string _name
Name of the owning MOOSE object, used in error messages.