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
25 lines
925 B
C++
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;
|
|
}
|
|
}
|