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
This commit is contained in:
24
src/include/serif/discretization/domain/schema/utils.hpp
Normal file
24
src/include/serif/discretization/domain/schema/utils.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user