32 lines
1.2 KiB
C++
32 lines
1.2 KiB
C++
#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 <ConfigurableIntegrator IntegratorT>
|
|
void set_integration_rule(IntegratorT &integrator, const ::mfem::IntegrationRule &integration_rule) {
|
|
if constexpr (HasReferenceSetIntegrationRule<IntegratorT>) {
|
|
integrator.SetIntegrationRule(integration_rule);
|
|
} else if constexpr (HasPointerSetIntegrationRule<IntegratorT>) {
|
|
integrator.SetIntRule(&integration_rule);
|
|
} else {
|
|
integrator.SetIntRule(integration_rule);
|
|
}
|
|
}
|
|
} |