Skip to content

Commit

Permalink
Remove TildeQ from initial RDMP data
Browse files Browse the repository at this point in the history
  • Loading branch information
yoonso0-0 committed Oct 10, 2023
1 parent c5883b7 commit 7f667e1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 28 deletions.
15 changes: 4 additions & 11 deletions src/Evolution/Systems/ForceFree/Subcell/SetInitialRdmpData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,16 @@ void SetInitialRdmpData::apply(
const gsl::not_null<evolution::dg::subcell::RdmpTciData*> rdmp_tci_data,
const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_e,
const tnsr::I<DataVector, 3, Frame::Inertial>& tilde_b,
const Scalar<DataVector>& tilde_q,
const evolution::dg::subcell::ActiveGrid active_grid,
const Mesh<3>& dg_mesh, const Mesh<3>& subcell_mesh) {
if (active_grid == evolution::dg::subcell::ActiveGrid::Subcell) {
const Scalar<DataVector> tilde_e_magnitude = magnitude(tilde_e);
const Scalar<DataVector> tilde_b_magnitude = magnitude(tilde_b);

rdmp_tci_data->max_variables_values =
DataVector{max(get(tilde_e_magnitude)), max(get(tilde_b_magnitude)),
max(get(tilde_q))};
DataVector{max(get(tilde_e_magnitude)), max(get(tilde_b_magnitude))};
rdmp_tci_data->min_variables_values =
DataVector{min(get(tilde_e_magnitude)), min(get(tilde_b_magnitude)),
min(get(tilde_q))};
DataVector{min(get(tilde_e_magnitude)), min(get(tilde_b_magnitude))};
} else {
using std::max;
using std::min;
Expand All @@ -38,17 +35,13 @@ void SetInitialRdmpData::apply(
get(tilde_e_magnitude), dg_mesh, subcell_mesh.extents());
const auto subcell_tilde_b_mag = evolution::dg::subcell::fd::project(
get(tilde_b_magnitude), dg_mesh, subcell_mesh.extents());
const auto subcell_tilde_q = evolution::dg::subcell::fd::project(
get(tilde_q), dg_mesh, subcell_mesh.extents());

rdmp_tci_data->max_variables_values =
DataVector{max(max(get(tilde_e_magnitude)), max(subcell_tilde_e_mag)),
max(max(get(tilde_b_magnitude)), max(subcell_tilde_b_mag)),
max(max(get(tilde_q)), max(subcell_tilde_q))};
max(max(get(tilde_b_magnitude)), max(subcell_tilde_b_mag))};
rdmp_tci_data->min_variables_values =
DataVector{min(min(get(tilde_e_magnitude)), min(subcell_tilde_e_mag)),
min(min(get(tilde_b_magnitude)), min(subcell_tilde_b_mag)),
min(min(get(tilde_q)), min(subcell_tilde_q))};
min(min(get(tilde_b_magnitude)), min(subcell_tilde_b_mag))};
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/Evolution/Systems/ForceFree/Subcell/SetInitialRdmpData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ namespace ForceFree::subcell {
* Used on the subcells after the TCI marked the DG solution as inadmissible.
*/
struct SetInitialRdmpData {
using argument_tags = tmpl::list<
ForceFree::Tags::TildeE, ForceFree::Tags::TildeB, ForceFree::Tags::TildeQ,
evolution::dg::subcell::Tags::ActiveGrid, ::domain::Tags::Mesh<3>,
evolution::dg::subcell::Tags::Mesh<3>>;
using argument_tags =
tmpl::list<ForceFree::Tags::TildeE, ForceFree::Tags::TildeB,
evolution::dg::subcell::Tags::ActiveGrid,
::domain::Tags::Mesh<3>,
evolution::dg::subcell::Tags::Mesh<3>>;
using return_tags = tmpl::list<evolution::dg::subcell::Tags::DataForRdmpTci>;

static void apply(
gsl::not_null<evolution::dg::subcell::RdmpTciData*> rdmp_tci_data,
const tnsr::I<DataVector, 3, Frame::Inertial>& subcell_tilde_e,
const tnsr::I<DataVector, 3, Frame::Inertial>& subcell_tilde_b,
const Scalar<DataVector>& subcell_tilde_q,
evolution::dg::subcell::ActiveGrid active_grid, const Mesh<3>& dg_mesh,
const Mesh<3>& subcell_mesh);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,19 @@ SPECTRE_TEST_CASE("Unit.Evolution.Systems.ForceFree.Subcell.SetInitialRdmpData",
ForceFree::subcell::SetInitialRdmpData::apply(
make_not_null(&rdmp_data), get<ForceFree::Tags::TildeE>(dg_vars),
get<ForceFree::Tags::TildeB>(dg_vars),
get<ForceFree::Tags::TildeQ>(dg_vars),
evolution::dg::subcell::ActiveGrid::Dg, dg_mesh, subcell_mesh);

const auto& dg_tilde_e_magnitude =
magnitude(get<ForceFree::Tags::TildeE>(dg_vars));
const auto dg_tilde_b_magnitude =
magnitude(get<ForceFree::Tags::TildeB>(dg_vars));
const auto& dg_tilde_q = get<ForceFree::Tags::TildeQ>(dg_vars);

const auto projected_subcell_tilde_e_magnitude =
Scalar<DataVector>(evolution::dg::subcell::fd::project(
get(dg_tilde_e_magnitude), dg_mesh, subcell_mesh.extents()));
const auto projected_subcell_tilde_b_magnitude =
Scalar<DataVector>(evolution::dg::subcell::fd::project(
get(dg_tilde_b_magnitude), dg_mesh, subcell_mesh.extents()));
const auto& subcell_tilde_q = get<ForceFree::Tags::TildeQ>(subcell_vars);

evolution::dg::subcell::RdmpTciData expected_dg_rdmp_data{};
using std::max;
Expand All @@ -66,21 +63,18 @@ SPECTRE_TEST_CASE("Unit.Evolution.Systems.ForceFree.Subcell.SetInitialRdmpData",
DataVector{max(max(get(dg_tilde_e_magnitude)),
max(get(projected_subcell_tilde_e_magnitude))),
max(max(get(dg_tilde_b_magnitude)),
max(get(projected_subcell_tilde_b_magnitude))),
max(max(get(dg_tilde_q)), max(get(subcell_tilde_q)))};
max(get(projected_subcell_tilde_b_magnitude)))};
expected_dg_rdmp_data.min_variables_values =
DataVector{min(min(get(dg_tilde_e_magnitude)),
min(get(projected_subcell_tilde_e_magnitude))),
min(min(get(dg_tilde_b_magnitude)),
min(get(projected_subcell_tilde_b_magnitude))),
min(min(get(dg_tilde_q)), min(get(subcell_tilde_q)))};
min(get(projected_subcell_tilde_b_magnitude)))};

CHECK(rdmp_data == expected_dg_rdmp_data);

ForceFree::subcell::SetInitialRdmpData::apply(
make_not_null(&rdmp_data), get<ForceFree::Tags::TildeE>(subcell_vars),
get<ForceFree::Tags::TildeB>(subcell_vars),
get<ForceFree::Tags::TildeQ>(subcell_vars),
evolution::dg::subcell::ActiveGrid::Subcell, dg_mesh, subcell_mesh);

const auto subcell_tilde_e_magnitude =
Expand All @@ -90,11 +84,9 @@ SPECTRE_TEST_CASE("Unit.Evolution.Systems.ForceFree.Subcell.SetInitialRdmpData",

evolution::dg::subcell::RdmpTciData expected_subcell_rdmp_data{};
expected_subcell_rdmp_data.max_variables_values = DataVector{
max(get(subcell_tilde_e_magnitude)), max(get(subcell_tilde_b_magnitude)),
max(get(subcell_tilde_q))};
max(get(subcell_tilde_e_magnitude)), max(get(subcell_tilde_b_magnitude))};
expected_subcell_rdmp_data.min_variables_values = DataVector{
min(get(subcell_tilde_e_magnitude)), min(get(subcell_tilde_b_magnitude)),
min(get(subcell_tilde_q))};
min(get(subcell_tilde_e_magnitude)), min(get(subcell_tilde_b_magnitude))};

CHECK(rdmp_data == expected_subcell_rdmp_data);
}
Expand Down

0 comments on commit 7f667e1

Please sign in to comment.