diff --git a/src/Evolution/Systems/ForceFree/FiniteDifference/AdaptiveOrder.cpp b/src/Evolution/Systems/ForceFree/FiniteDifference/AdaptiveOrder.cpp index 938635897d4d..c5a2c36d821c 100644 --- a/src/Evolution/Systems/ForceFree/FiniteDifference/AdaptiveOrder.cpp +++ b/src/Evolution/Systems/ForceFree/FiniteDifference/AdaptiveOrder.cpp @@ -78,9 +78,9 @@ void AdaptiveOrder::pup(PUP::er& p) { PUP::able::PUP_ID AdaptiveOrder::my_PUP_ID = 0; void AdaptiveOrder::reconstruct( - const gsl::not_null, dim>*> + const gsl::not_null, dim>*> vars_on_lower_face, - const gsl::not_null, dim>*> + const gsl::not_null, dim>*> vars_on_upper_face, const Variables& volume_vars, const tnsr::I& tilde_j, @@ -118,7 +118,7 @@ void AdaptiveOrder::reconstruct( } void AdaptiveOrder::reconstruct_fd_neighbor( - const gsl::not_null*> vars_on_face, + const gsl::not_null*> vars_on_face, const Variables& volume_vars, const tnsr::I& tilde_j, const Element& element, diff --git a/src/Evolution/Systems/ForceFree/FiniteDifference/AdaptiveOrder.hpp b/src/Evolution/Systems/ForceFree/FiniteDifference/AdaptiveOrder.hpp index b533ee5958d1..b1333bf26cc2 100644 --- a/src/Evolution/Systems/ForceFree/FiniteDifference/AdaptiveOrder.hpp +++ b/src/Evolution/Systems/ForceFree/FiniteDifference/AdaptiveOrder.hpp @@ -22,6 +22,7 @@ #include "Evolution/DgSubcell/Tags/Mesh.hpp" #include "Evolution/DiscontinuousGalerkin/Actions/NormalCovectorAndMagnitude.hpp" #include "Evolution/Systems/ForceFree/FiniteDifference/Reconstructor.hpp" +#include "Evolution/Systems/ForceFree/FiniteDifference/Tags.hpp" #include "Evolution/Systems/ForceFree/Tags.hpp" #include "NumericalAlgorithms/FiniteDifference/FallbackReconstructorType.hpp" #include "Options/Auto.hpp" @@ -40,7 +41,7 @@ template class ElementId; template class Mesh; -template +template class Variables; namespace gsl { template @@ -72,21 +73,7 @@ class AdaptiveOrder : public Reconstructor { using volume_vars_tags = tmpl::list; - using face_vars_tags = - tmpl::list, Frame::Inertial>, - ::Tags::Flux, Frame::Inertial>, - ::Tags::Flux, Frame::Inertial>, - ::Tags::Flux, Frame::Inertial>, - ::Tags::Flux, Frame::Inertial>, - gr::Tags::Lapse, - gr::Tags::Shift, - gr::Tags::SpatialMetric, - gr::Tags::SqrtDetSpatialMetric, - gr::Tags::InverseSpatialMetric, - evolution::dg::Actions::detail::NormalVector<3>>; + using recons_tags = ForceFree::fd::tags_list_for_reconstruction; using FallbackReconstructorType = ::fd::reconstruction::FallbackReconstructorType; @@ -163,9 +150,9 @@ class AdaptiveOrder : public Reconstructor { evolution::dg::subcell::Tags::Mesh>; void reconstruct( - gsl::not_null, dim>*> + gsl::not_null, dim>*> vars_on_lower_face, - gsl::not_null, dim>*> + gsl::not_null, dim>*> vars_on_upper_face, const Variables& volume_vars, const tnsr::I& tilde_j, @@ -178,7 +165,7 @@ class AdaptiveOrder : public Reconstructor { const Mesh& subcell_mesh) const; void reconstruct_fd_neighbor( - gsl::not_null*> vars_on_face, + gsl::not_null*> vars_on_face, const Variables& volume_vars, const tnsr::I& tilde_j, const Element& element, diff --git a/src/Evolution/Systems/ForceFree/FiniteDifference/MonotonisedCentral.cpp b/src/Evolution/Systems/ForceFree/FiniteDifference/MonotonisedCentral.cpp index 1aaa79da74d1..fa3a34aa7964 100644 --- a/src/Evolution/Systems/ForceFree/FiniteDifference/MonotonisedCentral.cpp +++ b/src/Evolution/Systems/ForceFree/FiniteDifference/MonotonisedCentral.cpp @@ -41,9 +41,9 @@ void MonotonisedCentral::pup(PUP::er& p) { Reconstructor::pup(p); } PUP::able::PUP_ID MonotonisedCentral::my_PUP_ID = 0; void MonotonisedCentral::reconstruct( - const gsl::not_null, dim>*> + const gsl::not_null, dim>*> vars_on_lower_face, - const gsl::not_null, dim>*> + const gsl::not_null, dim>*> vars_on_upper_face, const Variables& volume_vars, const tnsr::I& tilde_j, @@ -77,7 +77,7 @@ void MonotonisedCentral::reconstruct( } void MonotonisedCentral::reconstruct_fd_neighbor( - const gsl::not_null*> vars_on_face, + const gsl::not_null*> vars_on_face, const Variables& volume_vars, const tnsr::I& tilde_j, const Element& element, diff --git a/src/Evolution/Systems/ForceFree/FiniteDifference/MonotonisedCentral.hpp b/src/Evolution/Systems/ForceFree/FiniteDifference/MonotonisedCentral.hpp index b10031580769..91a11a7852b2 100644 --- a/src/Evolution/Systems/ForceFree/FiniteDifference/MonotonisedCentral.hpp +++ b/src/Evolution/Systems/ForceFree/FiniteDifference/MonotonisedCentral.hpp @@ -38,7 +38,7 @@ template class ElementId; template class Mesh; -template +template class Variables; namespace gsl { template @@ -68,21 +68,7 @@ class MonotonisedCentral : public Reconstructor { using volume_vars_tags = tmpl::list; - using face_vars_tags = - tmpl::list, Frame::Inertial>, - ::Tags::Flux, Frame::Inertial>, - ::Tags::Flux, Frame::Inertial>, - ::Tags::Flux, Frame::Inertial>, - ::Tags::Flux, Frame::Inertial>, - gr::Tags::Lapse, - gr::Tags::Shift, - gr::Tags::SpatialMetric, - gr::Tags::SqrtDetSpatialMetric, - gr::Tags::InverseSpatialMetric, - evolution::dg::Actions::detail::NormalVector<3>>; + using recons_tags = ForceFree::fd::tags_list_for_reconstruction; public: static constexpr size_t dim = 3; @@ -117,9 +103,9 @@ class MonotonisedCentral : public Reconstructor { evolution::dg::subcell::Tags::Mesh>; void reconstruct( - gsl::not_null, dim>*> + gsl::not_null, dim>*> vars_on_lower_face, - gsl::not_null, dim>*> + gsl::not_null, dim>*> vars_on_upper_face, const Variables& volume_vars, const tnsr::I& tilde_j, @@ -132,7 +118,7 @@ class MonotonisedCentral : public Reconstructor { const Mesh& subcell_mesh) const; void reconstruct_fd_neighbor( - gsl::not_null*> vars_on_face, + gsl::not_null*> vars_on_face, const Variables& volume_vars, const tnsr::I& tilde_j, const Element& element, diff --git a/src/Evolution/Systems/ForceFree/FiniteDifference/Wcns5z.cpp b/src/Evolution/Systems/ForceFree/FiniteDifference/Wcns5z.cpp index 9c903f9c40f1..655bd7c0259d 100644 --- a/src/Evolution/Systems/ForceFree/FiniteDifference/Wcns5z.cpp +++ b/src/Evolution/Systems/ForceFree/FiniteDifference/Wcns5z.cpp @@ -59,9 +59,9 @@ void Wcns5z::pup(PUP::er& p) { PUP::able::PUP_ID Wcns5z::my_PUP_ID = 0; void Wcns5z::reconstruct( - const gsl::not_null, dim>*> + const gsl::not_null, dim>*> vars_on_lower_face, - const gsl::not_null, dim>*> + const gsl::not_null, dim>*> vars_on_upper_face, const Variables& volume_vars, const tnsr::I& tilde_j, @@ -95,7 +95,7 @@ void Wcns5z::reconstruct( } void Wcns5z::reconstruct_fd_neighbor( - const gsl::not_null*> vars_on_face, + const gsl::not_null*> vars_on_face, const Variables& volume_vars, const tnsr::I& tilde_j, const Element& element, diff --git a/src/Evolution/Systems/ForceFree/FiniteDifference/Wcns5z.hpp b/src/Evolution/Systems/ForceFree/FiniteDifference/Wcns5z.hpp index e2138ef67c9d..dc603107cab6 100644 --- a/src/Evolution/Systems/ForceFree/FiniteDifference/Wcns5z.hpp +++ b/src/Evolution/Systems/ForceFree/FiniteDifference/Wcns5z.hpp @@ -39,7 +39,7 @@ template class ElementId; template class Mesh; -template +template class Variables; namespace gsl { template @@ -68,21 +68,7 @@ class Wcns5z : public Reconstructor { using volume_vars_tags = tmpl::list; - using face_vars_tags = - tmpl::list, Frame::Inertial>, - ::Tags::Flux, Frame::Inertial>, - ::Tags::Flux, Frame::Inertial>, - ::Tags::Flux, Frame::Inertial>, - ::Tags::Flux, Frame::Inertial>, - gr::Tags::Lapse, - gr::Tags::Shift, - gr::Tags::SpatialMetric, - gr::Tags::SqrtDetSpatialMetric, - gr::Tags::InverseSpatialMetric, - evolution::dg::Actions::detail::NormalVector<3>>; + using recons_tags = ForceFree::fd::tags_list_for_reconstruction; using FallbackReconstructorType = ::fd::reconstruction::FallbackReconstructorType; @@ -152,9 +138,9 @@ class Wcns5z : public Reconstructor { evolution::dg::subcell::Tags::Mesh>; void reconstruct( - gsl::not_null, dim>*> + gsl::not_null, dim>*> vars_on_lower_face, - gsl::not_null, dim>*> + gsl::not_null, dim>*> vars_on_upper_face, const Variables& volume_vars, const tnsr::I& tilde_j, @@ -167,7 +153,7 @@ class Wcns5z : public Reconstructor { const Mesh& subcell_mesh) const; void reconstruct_fd_neighbor( - gsl::not_null*> vars_on_face, + gsl::not_null*> vars_on_face, const Variables& volume_vars, const tnsr::I& tilde_j, const Element& element, diff --git a/tests/Unit/Helpers/Evolution/Systems/ForceFree/FiniteDifference/TestHelpers.hpp b/tests/Unit/Helpers/Evolution/Systems/ForceFree/FiniteDifference/TestHelpers.hpp index 8927640968b7..3c890a7727ec 100644 --- a/tests/Unit/Helpers/Evolution/Systems/ForceFree/FiniteDifference/TestHelpers.hpp +++ b/tests/Unit/Helpers/Evolution/Systems/ForceFree/FiniteDifference/TestHelpers.hpp @@ -123,8 +123,6 @@ void test_reconstructor(const size_t points_per_dimension, using TildeJ = ::ForceFree::Tags::TildeJ; using cons_tags = tmpl::list; - using flux_tags = db::wrap_tags_in<::Tags::Flux, cons_tags, tmpl::size_t<3>, - Frame::Inertial>; const Mesh<3> subcell_mesh{points_per_dimension, Spectral::Basis::FiniteDifference, @@ -183,43 +181,12 @@ void test_reconstructor(const size_t points_per_dimension, const size_t reconstructed_num_pts = (subcell_mesh.extents(0) + 1) * subcell_mesh.extents().slice_away(0).product(); - using face_vars_tags = tmpl::append< - tmpl::list, cons_tags, flux_tags, - tmpl::remove_duplicates, - gr::Tags::Shift, - gr::Tags::SpatialMetric, - gr::Tags::SqrtDetSpatialMetric, - gr::Tags::InverseSpatialMetric, - evolution::dg::Actions::detail::NormalVector<3>>>>>; - tnsr::ii lower_face_spatial_metric{ - reconstructed_num_pts, 0.0}; - tnsr::ii upper_face_spatial_metric{ - reconstructed_num_pts, 0.0}; - for (size_t i = 0; i < 3; ++i) { - lower_face_spatial_metric.get(i, i) = 1.0 + 0.01 * i; - upper_face_spatial_metric.get(i, i) = 1.0 - 0.01 * i; - } - const Scalar lower_face_sqrt_det_spatial_metric{ - sqrt(get(determinant(lower_face_spatial_metric)))}; - const Scalar upper_face_sqrt_det_spatial_metric{ - sqrt(get(determinant(upper_face_spatial_metric)))}; - - std::array, 3> vars_on_lower_face = - make_array<3>(Variables(reconstructed_num_pts)); - std::array, 3> vars_on_upper_face = - make_array<3>(Variables(reconstructed_num_pts)); - for (size_t i = 0; i < 3; ++i) { - get>( - gsl::at(vars_on_lower_face, i)) = lower_face_sqrt_det_spatial_metric; - get>( - gsl::at(vars_on_upper_face, i)) = upper_face_sqrt_det_spatial_metric; - - get>( - gsl::at(vars_on_lower_face, i)) = lower_face_spatial_metric; - get>( - gsl::at(vars_on_upper_face, i)) = upper_face_spatial_metric; - } + using recons_tags = ::ForceFree::fd::tags_list_for_reconstruction; + + std::array, 3> vars_on_lower_face = + make_array<3>(Variables(reconstructed_num_pts)); + std::array, 3> vars_on_upper_face = + make_array<3>(Variables(reconstructed_num_pts)); // Now we have everything to call the reconstruction dynamic_cast(reconstructor) @@ -244,7 +211,7 @@ void test_reconstructor(const size_t points_per_dimension, } // check reconstructed values for reconstruct() function - Variables expected_face_values{ + Variables expected_face_values{ face_centered_mesh.number_of_grid_points()}; expected_face_values.assign_subset( compute_solution(logical_coords_face_centered)); @@ -266,18 +233,7 @@ void test_reconstructor(const size_t points_per_dimension, const size_t num_pts_on_mortar = face_centered_mesh.slice_away(dim).number_of_grid_points(); - Variables upper_side_vars_on_mortar{num_pts_on_mortar}; - // Slice GR variables onto the mortar - data_on_slice( - make_not_null(&get>( - upper_side_vars_on_mortar)), - get>(expected_face_values), - face_centered_mesh.extents(), dim, face_centered_mesh.extents(dim) - 1); - data_on_slice( - make_not_null(&get>( - upper_side_vars_on_mortar)), - get>(expected_face_values), - face_centered_mesh.extents(), dim, face_centered_mesh.extents(dim) - 1); + Variables upper_side_vars_on_mortar{num_pts_on_mortar}; dynamic_cast(reconstructor) .reconstruct_fd_neighbor(make_not_null(&upper_side_vars_on_mortar), @@ -285,18 +241,7 @@ void test_reconstructor(const size_t points_per_dimension, ghost_data, subcell_mesh, Direction<3>{dim, Side::Upper}); - Variables lower_side_vars_on_mortar{num_pts_on_mortar}; - // Slice GR variables onto the mortar - data_on_slice( - make_not_null(&get>( - lower_side_vars_on_mortar)), - get>(expected_face_values), - face_centered_mesh.extents(), dim, 0); - data_on_slice( - make_not_null(&get>( - lower_side_vars_on_mortar)), - get>(expected_face_values), - face_centered_mesh.extents(), dim, 0); + Variables lower_side_vars_on_mortar{num_pts_on_mortar}; dynamic_cast(reconstructor) .reconstruct_fd_neighbor(make_not_null(&lower_side_vars_on_mortar),