10 #ifdef MOOSE_MFEM_ENABLED 13 #include "libmesh/int_range.h" 16 mfem::Coefficient & source,
17 mfem::QuadratureFunction & qf,
18 UpdatePolicy update_policy,
19 const std::string & name)
20 :
mfem::QuadratureFunctionCoefficient(qf),
30 mfem::Coefficient::SetTime(t);
36 const mfem::IntegrationPoint & ip)
41 return mfem::QuadratureFunctionCoefficient::Eval(T, ip);
49 mfem::QuadratureFunctionCoefficient::Project(qf);
59 const mfem::QuadratureSpaceBase & qspace = *
_qf.GetSpace();
60 const mfem::Mesh &
mesh = *qspace.GetMesh();
61 mfem::IsoparametricTransformation T;
66 _qf.GetValues(iel, values);
67 const mfem::IntegrationRule & ir = qspace.GetIntRule(iel);
68 mesh.GetElementTransformation(iel, &T);
71 const mfem::IntegrationPoint & ip = ir[iq];
73 values[iq] =
_source.Eval(T, ip);
std::string name(const ElemQuality q)
void SetTime(mfem::real_t t) override
Set the time for the coefficient, invalidating the stored values unless the update policy is NONE...
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 Refresh()
Project the source coefficient into the quadrature function if invalidated.
bool _dirty
Whether the stored values are stale and must be re-projected before use.
MFEMScalarQuadratureFunctionCoefficient(mfem::Coefficient &source, mfem::QuadratureFunction &qf, UpdatePolicy update_policy, const std::string &name)
void Project(mfem::QuadratureFunction &qf) override
Copy the stored values into qf, re-projecting the source first if invalidated.
mfem::real_t Eval(mfem::ElementTransformation &T, const mfem::IntegrationPoint &ip) override
Return the stored value at ip, re-projecting the source first if invalidated.
void MarkTimeChanged()
Mark the stored values as stale following a change of time.
mfem::Coefficient & _source
Source coefficient the stored values are projected from.
IntRange< T > make_range(T beg, T end)
Shared lazy-update state for quadrature function coefficients.
mfem::QuadratureFunction & _qf
Storage for the projected values, shared with the owning MOOSE object.