10#ifdef MOOSE_MFEM_ENABLED
13#include "libmesh/int_range.h"
16 mfem::QuadratureFunction & qf, UpdatePolicy update_policy,
const std::string & name)
17 :
mfem::VectorQuadratureFunctionCoefficient(qf),
27 mfem::VectorCoefficient::SetTime(t);
33 mfem::ElementTransformation & T,
34 const mfem::IntegrationPoint & ip)
39 mfem::VectorQuadratureFunctionCoefficient::Eval(V, T, ip);
47 mfem::VectorQuadratureFunctionCoefficient::Project(qf);
57 const mfem::QuadratureSpaceBase & qspace = *
_qf.GetSpace();
58 const mfem::Mesh &
mesh = *qspace.GetMesh();
59 mfem::IsoparametricTransformation T;
63 for (
const auto iel : make_range(qspace.GetNE()))
66 const mfem::IntegrationRule & ir = qspace.GetIntRule(iel);
67 mesh.GetElementTransformation(iel, &T);
68 for (
const auto iq : make_range(ir.Size()))
70 const mfem::IntegrationPoint & ip = ir[iq];
72 values.GetColumnReference(iq, col);
std::array< Real, 2 > values
Shared lazy-update state for quadrature function coefficients.
void MarkTimeChanged()
Mark the stored values as stale following a change of time.
bool _dirty
Whether the stored values are stale and must be re-projected before use.
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 Eval(mfem::Vector &V, mfem::ElementTransformation &T, const mfem::IntegrationPoint &ip) override
Return the stored values at ip, re-projecting the source first if invalidated.
mfem::VectorCoefficient * _source
Source coefficient the stored values are projected from.
void Refresh()
Project the source coefficient into the quadrature function if invalidated.
mfem::QuadratureFunction & _qf
Storage for the projected values, shared with the owning MOOSE object.
void SetTime(mfem::real_t t) override
Set the time for the coefficient, invalidating the stored values unless the update policy is NONE.
MFEMVectorQuadratureFunctionCoefficient(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.