Files
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

65 lines
3.0 KiB
C++

#include <string_view>
#include <catch2/catch_test_macros.hpp>
#include "serif/discretization/domain/physical_domains.hpp"
#include "serif/discretization/domain/schema/concepts.hpp"
#include "serif/discretization/domain/schema/schemas.hpp"
#include "serif/discretization/domain/types.hpp"
#include "serif/tests/test_tags.hpp"
namespace domain = serif::discretization::domain;
namespace schema = domain::schema;
TEST_CASE(
"Core Envelope Vacuum Schema Exposes Exact Compile Time And Runtime "
"Metadata",
tags::unit &tags::mesh &tags::utils &tags::domain
) {
using SchemaT = schema::CoreEnvelopeVacuumDomainSchema;
STATIC_REQUIRE(schema::IsSchema<SchemaT>);
STATIC_REQUIRE(SchemaT::domain_id_count == 3);
STATIC_REQUIRE(SchemaT::boundary_id_count == 2);
STATIC_REQUIRE(SchemaT::relation_count == 7);
constexpr auto domainDescriptors = SchemaT::domain_descriptors();
constexpr auto boundaryDescriptors = SchemaT::boundary_descriptors();
STATIC_REQUIRE(domainDescriptors[0].name == std::string_view{"core"});
STATIC_REQUIRE(domainDescriptors[0].ID == 1);
STATIC_REQUIRE(domainDescriptors[1].name == std::string_view{"envelope"});
STATIC_REQUIRE(domainDescriptors[1].ID == 2);
STATIC_REQUIRE(domainDescriptors[2].name == std::string_view{"vacuum"});
STATIC_REQUIRE(domainDescriptors[2].ID == 3);
STATIC_REQUIRE(boundaryDescriptors[0].name == std::string_view{"stellar_surface"});
STATIC_REQUIRE(boundaryDescriptors[0].ID == 1);
STATIC_REQUIRE(boundaryDescriptors[1].name == std::string_view{"infinity_surface"});
STATIC_REQUIRE(boundaryDescriptors[1].ID == 2);
STATIC_REQUIRE(SchemaT::template contains_domain<domain::CoreDomain>());
STATIC_REQUIRE(SchemaT::template contains_domain<domain::StellarDomains>());
STATIC_REQUIRE(SchemaT::template contains_domain<domain::AllDomains>());
STATIC_REQUIRE(SchemaT::template domain_id_belongs_to<domain::StellarDomains>(1));
STATIC_REQUIRE(SchemaT::template domain_id_belongs_to<domain::StellarDomains>(2));
STATIC_REQUIRE_FALSE(SchemaT::template domain_id_belongs_to<domain::StellarDomains>(3));
STATIC_REQUIRE(SchemaT::template domain_id_belongs_to<domain::AllDomains>(1));
STATIC_REQUIRE(SchemaT::template domain_id_belongs_to<domain::AllDomains>(2));
STATIC_REQUIRE(SchemaT::template domain_id_belongs_to<domain::AllDomains>(3));
STATIC_REQUIRE(SchemaT::template domain_id<domain::CoreDomain>() == 1);
STATIC_REQUIRE(SchemaT::template domain_id<domain::EnvelopeDomain>() == 2);
STATIC_REQUIRE(SchemaT::template domain_id<domain::VacuumDomain>() == 3);
STATIC_REQUIRE(SchemaT::template contains_boundary<domain::StellarSurfaceBoundary>());
STATIC_REQUIRE(SchemaT::template contains_boundary<domain::InfinitySurfaceBoundary>());
STATIC_REQUIRE(SchemaT::template boundary_id<domain::StellarSurfaceBoundary>() == 1);
STATIC_REQUIRE(SchemaT::template boundary_id<domain::InfinitySurfaceBoundary>() == 2);
CHECK(true);
}