Skip to content

Commit

Permalink
test change
Browse files Browse the repository at this point in the history
  • Loading branch information
jyoo1042 committed Dec 5, 2023
1 parent 0b06b99 commit f1f2816
Showing 1 changed file with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ void test_create_from_options() {
" PolytropicExponent: 1.654\n"
" ThresholdDensity: 0.42\n"
" InversePlasmaBeta: 85.0\n"
" BFieldNormGridRes: 6")
" BFieldNormGridRes: 4")
->get_clone();
const auto deserialized_option_solution =
serialize_and_deserialize(option_solution);
const auto& disk = dynamic_cast<const grmhd::AnalyticData::MagnetizedFmDisk&>(
*deserialized_option_solution);

CHECK(disk == grmhd::AnalyticData::MagnetizedFmDisk(
1.3, 0.345, 6.123, 14.2, 0.065, 1.654, 0.42, 85.0, 6));
1.3, 0.345, 6.123, 14.2, 0.065, 1.654, 0.42, 85.0, 4));
}

void test_move() {
Expand Down Expand Up @@ -142,16 +142,15 @@ void test_variables(const DataType& used_for_size) {
const auto coords = make_with_value<tnsr::I<DataType, 3>>(used_for_size, 1.0);
const gr::Solutions::SphericalKerrSchild sks_soln{
bh_mass, {{0.0, 0.0, bh_dimless_spin}}, {{0.0, 0.0, 0.0}}};
CHECK_ITERABLE_APPROX(
get<gr::Tags::Lapse<DataType>>(sks_soln.variables(
coords, 0.0, gr::Solutions::SphericalKerrSchild::tags<DataType>{})),
get<gr::Tags::Lapse<DataType>>(
disk.variables(coords, tmpl::list<gr::Tags::Lapse<DataType>>{})));
CHECK_ITERABLE_APPROX(
get<gr::Tags::SqrtDetSpatialMetric<DataType>>(sks_soln.variables(
coords, 0.0, gr::Solutions::SphericalKerrSchild::tags<DataType>{})),
get<gr::Tags::SqrtDetSpatialMetric<DataType>>(disk.variables(
coords, tmpl::list<gr::Tags::SqrtDetSpatialMetric<DataType>>{})));
const auto [expected_lapse, expected_sqrt_det_gamma] = sks_soln.variables(
coords, 0.0,
tmpl::list<gr::Tags::Lapse<DataType>,
gr::Tags::SqrtDetSpatialMetric<DataType>>{});
const auto [lapse, sqrt_det_gamma] = disk.variables(
coords, tmpl::list<gr::Tags::Lapse<DataType>,
gr::Tags::SqrtDetSpatialMetric<DataType>>{});
CHECK_ITERABLE_APPROX(expected_lapse, lapse);
CHECK_ITERABLE_APPROX(expected_sqrt_det_gamma, sqrt_det_gamma);
const auto expected_spatial_metric =
get<gr::Tags::SpatialMetric<DataType, 3>>(sks_soln.variables(
coords, 0.0, gr::Solutions::SphericalKerrSchild::tags<DataType>{}));
Expand All @@ -160,8 +159,8 @@ void test_variables(const DataType& used_for_size) {
coords, tmpl::list<gr::Tags::SpatialMetric<DataType, 3>>{}));
CHECK_ITERABLE_APPROX(expected_spatial_metric, spatial_metric);

// Check that when InversePlasmaBeta = 0, magnetic field vanishes and
// we recover FishboneMoncriefDisk
// // Check that when InversePlasmaBeta = 0, magnetic field vanishes and
// // we recover FishboneMoncriefDisk
MagnetizedFmDiskProxy another_disk(
bh_mass, bh_dimless_spin, inner_edge_radius, max_pressure_radius,
polytropic_constant, polytropic_exponent, threshold_density, 0.0, 4);
Expand Down Expand Up @@ -197,7 +196,7 @@ SPECTRE_TEST_CASE("Unit.PointwiseFunctions.AnalyticData.GrMhd.MagFmDisk",
test_move();

test_variables(std::numeric_limits<double>::signaling_NaN());
test_variables(DataVector(5));
// test_variables(DataVector(5));

// #ifdef SPECTRE_DEBUG
// CHECK_THROWS_WITH(
Expand Down

0 comments on commit f1f2816

Please sign in to comment.