Files
meson-mfem/src/include/serif/discretization/domain/schema/utils.hpp
Emily Boudreaux d1f59d6d70 feat(mean_field): added dimensions, discritization, and start of eos
The full rewrite of mean_field into something maintainable is progressing. dimensions is mostly done, discritization (domain, blocks, and fields) is done, and eos is progressing quickly
2026-09-15 10:42:00 -04:00

25 lines
925 B
C++

#pragma once
#include <mfem.hpp>
#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 <IsDomainOrSet DomainT, IsSchema SchemaT>
[[nodiscard]] mfem::Array<int> make_attribute_marker(const mfem::Mesh &mesh) {
static_assert(
SchemaT::template contains_domain<DomainT>(),
"Requested marker domain is not completely registered in the supplied DomainSchema."
);
mfem::Array<int> marker(mesh.attributes.Max());
for (int domainID = 1; domainID <= marker.Size(); ++domainID) {
marker[domainID - 1] = SchemaT::template domain_id_belongs_to<DomainT>(domainID) ? 1 : 0;
}
return marker;
}
}