10#ifdef MOOSE_MFEM_ENABLED
22 params.
addParam<MFEMFESpaceName>(
"flux_fespace",
"FE space to write the flux into");
23 params.
addParam<MFEMFESpaceName>(
"smooth_flux_fespace",
"FE space to write the smooth flux into");
32 if (
auto * sn = queryParam<MFEMFESpaceName>(
"flux_fespace"))
36 if (
auto * sn = queryParam<MFEMFESpaceName>(
"smooth_flux_fespace"))
48 [[maybe_unused]]
bool is_supported =
false;
51 is_supported |= (
dynamic_cast<mfem::DiffusionIntegrator *
>(
_integ.get()) !=
nullptr);
53 is_supported |= (
dynamic_cast<mfem::CurlCurlIntegrator *
>(
_integ.get()) !=
nullptr);
55 is_supported |= (
dynamic_cast<mfem::ElasticityIntegrator *
>(
_integ.get()) !=
nullptr);
58 mooseError(
"MFEML2ZienkiewiczZhuIndicator only supports MFEMDiffusionKernel, "
59 "MFEMCurlCurlKernel and MFEMLinearElasticityKernel");
68 _flux_fec = std::make_unique<mfem::L2_FECollection>(order,
dim);
registerMooseObject("MooseApp", MFEML2ZienkiewiczZhuIndicator)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Constructs and stores an mfem::ParFiniteElementSpace object.
static InputParameters validParams()
mfem::ParFiniteElementSpace & getFESpace() const
Get reference to FE space using the name we store when setting up this class.
const std::string & _kernel_name
Name of the kernel providing the error estimate.
mfem::ParMesh & getParMesh() const
Get reference to the FE space's underlying mesh.
std::shared_ptr< mfem::ErrorEstimator > _error_estimator
Shared pointer to the MFEM estimator wrapped by this class.
const VariableName & _var_name
Name of the variable associated with the weak form that the kernel is applied to.
Class to construct an MFEM integrator to apply to the equation system.
virtual mfem::BilinearFormIntegrator * createBFIntegrator()
Create MFEM integrator to apply to the LHS of the weak form. Ownership managed by the caller.
Wrapper for the Zienkiewicz-Zhu estimator with L2 projection.
MFEML2ZienkiewiczZhuIndicator(const InputParameters ¶meters)
std::shared_ptr< mfem::ParFiniteElementSpace > _flux_fes
Finite element space for the discontinuous flux.
std::shared_ptr< mfem::FiniteElementCollection > _smooth_flux_fec
Finite element collection for the smoothed flux.
static InputParameters validParams()
virtual void createEstimator() override
Override the createEstimator method to use a Zienkiewicz-Zhu estimator.
std::shared_ptr< mfem::FiniteElementCollection > _flux_fec
Finite element collection for the discontinuous flux.
std::unique_ptr< mfem::BilinearFormIntegrator > _integ
Auxiliary blf integrator implementing ComputeElementFlux().
std::shared_ptr< mfem::ParFiniteElementSpace > _smooth_flux_fes
Finite element space for the smoothed flux.
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
std::shared_ptr< mfem::ParGridFunction > getGridFunction(const std::string &name)
T & getMFEMObject(const std::string &system, const std::string &name, const THREAD_ID tid=0) const
Retrieve an MFEM object from the warehouse by system and name.