#pragma once #include #include "serif/discretization/domain/concepts.hpp" #include "serif/discretization/domain/schema/concepts.hpp" namespace serif::discretization::domain::schema { // Build the 0/1 marker array MFEM wants when an integrator or an essential // BC should apply only on part of the mesh. template [[nodiscard]] mfem::Array make_attribute_marker(const mfem::Mesh &mesh) { static_assert( SchemaT::template contains_domain(), "Requested marker domain is not completely registered in the supplied DomainSchema." ); mfem::Array marker(mesh.attributes.Max()); for (int domainID = 1; domainID <= marker.Size(); ++domainID) { marker[domainID - 1] = SchemaT::template domain_id_belongs_to(domainID) ? 1 : 0; } return marker; } }