#pragma once /** * @file configure.hpp * @author Emily M. Boudreaux * * @brief File containing utility functions for configuring MFEM integrators with integration rules. */ #include "mfem/fem/intrules.hpp" #include "serif/discretization/quadrature/backend/mfem/concepts.hpp" namespace serif::discretization::quadrature::backend::mfem { /** * @brief Configure an MFEM integrator with an integration rule. This function will call the appropriate SetIntegrationRule method on the integrator based on its capabilities. * @tparam IntegratorT The type of the integrator to configure. * @param integrator The integrator to configure. * @param integration_rule The integration rule to use for configuration. */ template void set_integration_rule(IntegratorT &integrator, const ::mfem::IntegrationRule &integration_rule) { if constexpr (HasReferenceSetIntegrationRule) { integrator.SetIntegrationRule(integration_rule); } else if constexpr (HasPointerSetIntegrationRule) { integrator.SetIntRule(&integration_rule); } else { integrator.SetIntRule(integration_rule); } } }