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:
42
tests/discritization/domain/schema/utils.cpp
Normal file
42
tests/discritization/domain/schema/utils.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <mfem.hpp>
|
||||
|
||||
#include "serif/discretization/domain/physical_domains.hpp"
|
||||
#include "serif/discretization/domain/schema/schemas.hpp"
|
||||
#include "serif/discretization/domain/schema/utils.hpp"
|
||||
#include "serif/discretization/domain/types.hpp"
|
||||
|
||||
#include "serif/tests/test_tags.hpp"
|
||||
#include "serif/tests/discritization/domain/domain_test_utils.hpp"
|
||||
|
||||
namespace domain = serif::discretization::domain;
|
||||
namespace schema = domain::schema;
|
||||
|
||||
TEST_CASE(
|
||||
"Domain Schema Builds Exact MFEM Attribute Markers",
|
||||
tags::domain &tags::utils &tags::unit
|
||||
) {
|
||||
using Schema = schema::CoreEnvelopeVacuumDomainSchema;
|
||||
|
||||
const mfem::Mesh mesh = domain_test_utils::make_layered_mesh();
|
||||
|
||||
const mfem::Array<int> stellarMarker = schema::make_attribute_marker<domain::StellarDomains, Schema>(mesh);
|
||||
const mfem::Array<int> vacuumMarker = schema::make_attribute_marker<domain::VacuumDomain, Schema>(mesh);
|
||||
const mfem::Array<int> allMarker = schema::make_attribute_marker<domain::AllDomains, Schema>(mesh);
|
||||
|
||||
REQUIRE(stellarMarker.Size() == 3);
|
||||
REQUIRE(vacuumMarker.Size() == 3);
|
||||
REQUIRE(allMarker.Size() == 3);
|
||||
|
||||
CHECK(stellarMarker[0] == 1);
|
||||
CHECK(stellarMarker[1] == 1);
|
||||
CHECK(stellarMarker[2] == 0);
|
||||
|
||||
CHECK(vacuumMarker[0] == 0);
|
||||
CHECK(vacuumMarker[1] == 0);
|
||||
CHECK(vacuumMarker[2] == 1);
|
||||
|
||||
CHECK(allMarker[0] == 1);
|
||||
CHECK(allMarker[1] == 1);
|
||||
CHECK(allMarker[2] == 1);
|
||||
}
|
||||
Reference in New Issue
Block a user