#pragma once /** * @file schema.hpp * @author Emily M. Boudreaux * @brief Adapt MFEM meshes to domain schema validation. */ #include "mfem/mesh/mesh.hpp" #include "serif/backend/mfem/discretization/topology.hpp" #include "serif/discretization/domain/concepts.hpp" #include "serif/discretization/domain/schema/validation/all.hpp" namespace serif::backend::mfem::discretization { /** * @brief Validate an MFEM mesh against a physical domain schema. * @tparam SchemaT The schema type to validate against. * @param mesh The MFEM mesh to validate. * @return The validation result for every relation in the schema. * @note Reuse make_mesh_topology when several schemas inspect the same mesh. */ template <::serif::discretization::domain::schema::IsSchema SchemaT> [[nodiscard]] ::serif::discretization::domain::schema::validation::SchemaValidationResult validate_schema(const ::mfem::Mesh& mesh) { return ::serif::discretization::domain::schema::validation::validate_schema(make_mesh_topology(mesh)); } }