diff --git a/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/MonotonisedCentral.cpp b/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/MonotonisedCentral.cpp index 995cc774b55b..ca08d9a94113 100644 --- a/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/MonotonisedCentral.cpp +++ b/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/MonotonisedCentral.cpp @@ -236,103 +236,33 @@ bool operator!=(const MonotonisedCentralPrim& lhs, } #define THERMO_DIM(data) BOOST_PP_TUPLE_ELEM(0, data) -#define TAGS_LIST_FD(data) \ - tmpl::list< \ - gr::Tags::SpacetimeMetric, gh::Tags::Pi, \ - gh::Tags::Phi, ValenciaDivClean::Tags::TildeD, \ - ValenciaDivClean::Tags::TildeYe, ValenciaDivClean::Tags::TildeTau, \ - ValenciaDivClean::Tags::TildeS, \ - ValenciaDivClean::Tags::TildeB, \ - ValenciaDivClean::Tags::TildePhi, \ - hydro::Tags::RestMassDensity, \ - hydro::Tags::ElectronFraction, \ - hydro::Tags::SpecificInternalEnergy, \ - hydro::Tags::SpatialVelocity, \ - hydro::Tags::MagneticField, \ - hydro::Tags::DivergenceCleaningField, \ - hydro::Tags::LorentzFactor, \ - hydro::Tags::Pressure, hydro::Tags::Temperature, \ - hydro::Tags::LorentzFactorTimesSpatialVelocity, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - tmpl::size_t<3>, Frame::Inertial>, \ - ::Tags::Flux, \ - tmpl::size_t<3>, 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>> -#define TAGS_LIST_DG_FD_INTERFACE(data) \ - tmpl::list< \ - gr::Tags::SpacetimeMetric, gh::Tags::Pi, \ - gh::Tags::Phi, ValenciaDivClean::Tags::TildeD, \ - ValenciaDivClean::Tags::TildeYe, ValenciaDivClean::Tags::TildeTau, \ - ValenciaDivClean::Tags::TildeS, \ - ValenciaDivClean::Tags::TildeB, \ - ValenciaDivClean::Tags::TildePhi, \ - hydro::Tags::RestMassDensity, \ - hydro::Tags::ElectronFraction, \ - hydro::Tags::SpecificInternalEnergy, \ - hydro::Tags::SpatialVelocity, \ - hydro::Tags::MagneticField, \ - hydro::Tags::DivergenceCleaningField, \ - hydro::Tags::LorentzFactor, \ - hydro::Tags::Pressure, hydro::Tags::Temperature, \ - hydro::Tags::LorentzFactorTimesSpatialVelocity, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - tmpl::size_t<3>, Frame::Inertial>, \ - ::Tags::Flux, \ - tmpl::size_t<3>, Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - gh::ConstraintDamping::Tags::ConstraintGamma1, \ - gh::ConstraintDamping::Tags::ConstraintGamma2, \ - gr::Tags::Lapse, gr::Tags::Shift, \ - gr::Tags::SpatialMetric, \ - gr::Tags::SqrtDetSpatialMetric, \ - gr::Tags::InverseSpatialMetric, \ - evolution::dg::Actions::detail::NormalVector<3>> - -#define INSTANTIATION(r, data) \ - template void MonotonisedCentralPrim::reconstruct( \ - gsl::not_null, 3>*> \ - vars_on_lower_face, \ - gsl::not_null, 3>*> \ - vars_on_upper_face, \ - const Variables>& volume_prims, \ - const Variables& \ - volume_spacetime_and_cons_vars, \ - const EquationsOfState::EquationOfState& eos, \ - const Element<3>& element, \ - const DirectionalIdMap<3, evolution::dg::subcell::GhostData>& \ - ghost_data, \ - const Mesh<3>& subcell_mesh) const; \ - template void MonotonisedCentralPrim::reconstruct_fd_neighbor( \ - gsl::not_null*> vars_on_face, \ - const Variables>& subcell_volume_prims, \ - const Variables< \ - grmhd::GhValenciaDivClean::Tags::spacetime_reconstruction_tags>& \ - subcell_volume_spacetime_metric, \ - const EquationsOfState::EquationOfState& eos, \ - const Element<3>& element, \ - const DirectionalIdMap<3, evolution::dg::subcell::GhostData>& \ - ghost_data, \ - const Mesh<3>& subcell_mesh, \ +#define INSTANTIATION(r, data) \ + template void MonotonisedCentralPrim::reconstruct( \ + gsl::not_null, 3>*> \ + vars_on_lower_face, \ + gsl::not_null, 3>*> \ + vars_on_upper_face, \ + const Variables>& volume_prims, \ + const Variables& \ + volume_spacetime_and_cons_vars, \ + const EquationsOfState::EquationOfState& eos, \ + const Element<3>& element, \ + const DirectionalIdMap<3, evolution::dg::subcell::GhostData>& \ + ghost_data, \ + const Mesh<3>& subcell_mesh) const; \ + template void MonotonisedCentralPrim::reconstruct_fd_neighbor( \ + gsl::not_null*> \ + vars_on_face, \ + const Variables>& subcell_volume_prims, \ + const Variables< \ + grmhd::GhValenciaDivClean::Tags::spacetime_reconstruction_tags>& \ + subcell_volume_spacetime_metric, \ + const EquationsOfState::EquationOfState& eos, \ + const Element<3>& element, \ + const DirectionalIdMap<3, evolution::dg::subcell::GhostData>& \ + ghost_data, \ + const Mesh<3>& subcell_mesh, \ const Direction<3> direction_to_reconstruct) const; GENERATE_INSTANTIATIONS(INSTANTIATION, (1, 2, 3)) diff --git a/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/PositivityPreservingAdaptiveOrder.cpp b/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/PositivityPreservingAdaptiveOrder.cpp index ae62d853185b..6977f4737fb5 100644 --- a/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/PositivityPreservingAdaptiveOrder.cpp +++ b/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/PositivityPreservingAdaptiveOrder.cpp @@ -355,107 +355,37 @@ bool operator!=(const PositivityPreservingAdaptiveOrderPrim& lhs, } #define THERMO_DIM(data) BOOST_PP_TUPLE_ELEM(0, data) -#define TAGS_LIST_FD(data) \ - tmpl::list< \ - gr::Tags::SpacetimeMetric, gh::Tags::Pi, \ - gh::Tags::Phi, ValenciaDivClean::Tags::TildeD, \ - ValenciaDivClean::Tags::TildeYe, ValenciaDivClean::Tags::TildeTau, \ - ValenciaDivClean::Tags::TildeS, \ - ValenciaDivClean::Tags::TildeB, \ - ValenciaDivClean::Tags::TildePhi, \ - hydro::Tags::RestMassDensity, \ - hydro::Tags::ElectronFraction, \ - hydro::Tags::SpecificInternalEnergy, \ - hydro::Tags::SpatialVelocity, \ - hydro::Tags::MagneticField, \ - hydro::Tags::DivergenceCleaningField, \ - hydro::Tags::LorentzFactor, \ - hydro::Tags::Pressure, hydro::Tags::Temperature, \ - hydro::Tags::LorentzFactorTimesSpatialVelocity, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - tmpl::size_t<3>, Frame::Inertial>, \ - ::Tags::Flux, \ - tmpl::size_t<3>, 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>> -#define TAGS_LIST_DG_FD_INTERFACE(data) \ - tmpl::list< \ - gr::Tags::SpacetimeMetric, gh::Tags::Pi, \ - gh::Tags::Phi, ValenciaDivClean::Tags::TildeD, \ - ValenciaDivClean::Tags::TildeYe, ValenciaDivClean::Tags::TildeTau, \ - ValenciaDivClean::Tags::TildeS, \ - ValenciaDivClean::Tags::TildeB, \ - ValenciaDivClean::Tags::TildePhi, \ - hydro::Tags::RestMassDensity, \ - hydro::Tags::ElectronFraction, \ - hydro::Tags::SpecificInternalEnergy, \ - hydro::Tags::SpatialVelocity, \ - hydro::Tags::MagneticField, \ - hydro::Tags::DivergenceCleaningField, \ - hydro::Tags::LorentzFactor, \ - hydro::Tags::Pressure, hydro::Tags::Temperature, \ - hydro::Tags::LorentzFactorTimesSpatialVelocity, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - tmpl::size_t<3>, Frame::Inertial>, \ - ::Tags::Flux, \ - tmpl::size_t<3>, Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - gh::ConstraintDamping::Tags::ConstraintGamma1, \ - gh::ConstraintDamping::Tags::ConstraintGamma2, \ - gr::Tags::Lapse, gr::Tags::Shift, \ - gr::Tags::SpatialMetric, \ - gr::Tags::SqrtDetSpatialMetric, \ - gr::Tags::InverseSpatialMetric, \ - evolution::dg::Actions::detail::NormalVector<3>> - -#define INSTANTIATION(r, data) \ - template void PositivityPreservingAdaptiveOrderPrim::reconstruct( \ - gsl::not_null, 3>*> \ - vars_on_lower_face, \ - gsl::not_null, 3>*> \ - vars_on_upper_face, \ - const gsl::not_null< \ - std::optional, 3>>*> \ - reconstruction_order, \ - const Variables>& volume_prims, \ - const Variables& \ - volume_spacetime_and_cons_vars, \ - const EquationsOfState::EquationOfState& eos, \ - const Element<3>& element, \ - const DirectionalIdMap<3, evolution::dg::subcell::GhostData>& \ - ghost_data, \ - const Mesh<3>& subcell_mesh) const; \ - template void \ - PositivityPreservingAdaptiveOrderPrim::reconstruct_fd_neighbor( \ - gsl::not_null*> vars_on_face, \ - const Variables>& subcell_volume_prims, \ - const Variables< \ - grmhd::GhValenciaDivClean::Tags::spacetime_reconstruction_tags>& \ - subcell_volume_spacetime_metric, \ - const EquationsOfState::EquationOfState& eos, \ - const Element<3>& element, \ - const DirectionalIdMap<3, evolution::dg::subcell::GhostData>& \ - ghost_data, \ - const Mesh<3>& subcell_mesh, \ +#define INSTANTIATION(r, data) \ + template void PositivityPreservingAdaptiveOrderPrim::reconstruct( \ + gsl::not_null, 3>*> \ + vars_on_lower_face, \ + gsl::not_null, 3>*> \ + vars_on_upper_face, \ + const gsl::not_null< \ + std::optional, 3>>*> \ + reconstruction_order, \ + const Variables>& volume_prims, \ + const Variables& \ + volume_spacetime_and_cons_vars, \ + const EquationsOfState::EquationOfState& eos, \ + const Element<3>& element, \ + const DirectionalIdMap<3, evolution::dg::subcell::GhostData>& \ + ghost_data, \ + const Mesh<3>& subcell_mesh) const; \ + template void \ + PositivityPreservingAdaptiveOrderPrim::reconstruct_fd_neighbor( \ + gsl::not_null*> \ + vars_on_face, \ + const Variables>& subcell_volume_prims, \ + const Variables< \ + grmhd::GhValenciaDivClean::Tags::spacetime_reconstruction_tags>& \ + subcell_volume_spacetime_metric, \ + const EquationsOfState::EquationOfState& eos, \ + const Element<3>& element, \ + const DirectionalIdMap<3, evolution::dg::subcell::GhostData>& \ + ghost_data, \ + const Mesh<3>& subcell_mesh, \ const Direction<3> direction_to_reconstruct) const; GENERATE_INSTANTIATIONS(INSTANTIATION, (1, 2, 3)) diff --git a/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/ReconstructWork.hpp b/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/ReconstructWork.hpp index d507880ec510..4f4c2cc2c1c5 100644 --- a/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/ReconstructWork.hpp +++ b/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/ReconstructWork.hpp @@ -7,10 +7,16 @@ #include #include +#include "DataStructures/DataBox/Prefixes.hpp" #include "DataStructures/Tensor/TypeAliases.hpp" #include "Domain/Structure/DirectionalIdMap.hpp" #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp" #include "Evolution/Systems/GrMhd/GhValenciaDivClean/Tags.hpp" +#include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.hpp" +#include "Evolution/Systems/GrMhd/ValenciaDivClean/TagsDeclarations.hpp" +#include "PointwiseFunctions/GeneralRelativity/TagsDeclarations.hpp" +#include "PointwiseFunctions/Hydro/TagsDeclarations.hpp" +#include "Utilities/TMPL.hpp" /// \cond class DataVector; @@ -35,9 +41,34 @@ class EquationOfState; namespace evolution::dg::subcell { class GhostData; } // namespace evolution::dg::subcell +namespace evolution::dg::Actions::detail { +template +struct NormalVector; +} // namespace evolution::dg::Actions::detail +namespace gh::ConstraintDamping::Tags { +struct ConstraintGamma1; +struct ConstraintGamma2; +} // namespace gh::ConstraintDamping::Tags /// \endcond namespace grmhd::GhValenciaDivClean::fd { +using tags_list_for_reconstruct = + tmpl::push_front, + gh::Tags::Pi, gh::Tags::Phi>; + +namespace detail { +using tags_list_for_reconstruct_split_lapse = + tmpl::split>; +} // namespace detail + +using tags_list_for_reconstruct_fd_neighbor = tmpl::append< + tmpl::front, + tmpl::push_front, + gh::ConstraintDamping::Tags::ConstraintGamma1, + gh::ConstraintDamping::Tags::ConstraintGamma2, + gr::Tags::Lapse>>; + /*! * \brief Reconstructs \f$\rho, p, Wv^i, B^i\f$, \f$\Phi\f$, and the spacetime * metric, then computes the Lorentz factor, upper spatial velocity, specific @@ -46,14 +77,15 @@ namespace grmhd::GhValenciaDivClean::fd { */ template void reconstruct_prims_work( - gsl::not_null, 3>*> vars_on_lower_face, - gsl::not_null, 3>*> vars_on_upper_face, + gsl::not_null, 3>*> + vars_on_lower_face, + gsl::not_null, 3>*> + vars_on_upper_face, const HydroReconstructor& hydro_reconstructor, const SpacetimeReconstructor& spacetime_reconstructor, const ComputeGrmhdSpacetimeVarsFromReconstructedSpacetimeTags& @@ -78,13 +110,14 @@ void reconstruct_prims_work( */ template < typename SpacetimeTagsToReconstruct, typename PrimTagsForReconstruction, - typename PrimsTagsSentByNeighbor, typename TagsList, typename PrimsTags, + typename PrimsTagsSentByNeighbor, typename PrimsTags, size_t ThermodynamicDim, typename LowerHydroReconstructor, typename LowerSpacetimeReconstructor, typename UpperHydroReconstructor, typename UpperSpacetimeReconstructor, typename ComputeGrmhdSpacetimeVarsFromReconstructedSpacetimeTags> void reconstruct_fd_neighbor_work( - gsl::not_null*> vars_on_face, + gsl::not_null*> + vars_on_face, const LowerHydroReconstructor& reconstruct_lower_neighbor_hydro, const LowerSpacetimeReconstructor& reconstruct_lower_neighbor_spacetime, const UpperHydroReconstructor& reconstruct_upper_neighbor_hydro, diff --git a/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/ReconstructWork.tpp b/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/ReconstructWork.tpp index 30ab0bb7b68a..624a39373a6d 100644 --- a/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/ReconstructWork.tpp +++ b/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/ReconstructWork.tpp @@ -15,13 +15,14 @@ #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" #include "Domain/Structure/Direction.hpp" +#include "Domain/Structure/DirectionMap.hpp" #include "Domain/Structure/DirectionalId.hpp" #include "Domain/Structure/DirectionalIdMap.hpp" -#include "Domain/Structure/DirectionMap.hpp" #include "Domain/Structure/Element.hpp" #include "Domain/Structure/ElementId.hpp" #include "Evolution/DgSubcell/GhostData.hpp" #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp" +#include "Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/ReconstructWork.hpp" #include "Evolution/Systems/GrMhd/GhValenciaDivClean/Tags.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/ConservativeFromPrimitive.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.tpp" @@ -38,14 +39,15 @@ namespace grmhd::GhValenciaDivClean::fd { template void reconstruct_prims_work( - const gsl::not_null, 3>*> vars_on_lower_face, - const gsl::not_null, 3>*> vars_on_upper_face, + const gsl::not_null, 3>*> + vars_on_lower_face, + const gsl::not_null, 3>*> + vars_on_upper_face, const HydroReconstructor& hydro_reconstructor, const SpacetimeReconstructor& spacetime_reconstructor, const ComputeGrmhdSpacetimeVarsFromReconstructedSpacetimeTags& @@ -231,13 +233,14 @@ void reconstruct_prims_work( template < typename SpacetimeTagsToReconstruct, typename PrimTagsForReconstruction, - typename PrimsTagsSentByNeighbor, typename TagsList, typename PrimsTags, + typename PrimsTagsSentByNeighbor, typename PrimsTags, size_t ThermodynamicDim, typename LowerHydroReconstructor, typename LowerSpacetimeReconstructor, typename UpperHydroReconstructor, typename UpperSpacetimeReconstructor, typename ComputeGrmhdSpacetimeVarsFromReconstructedSpacetimeTags> void reconstruct_fd_neighbor_work( - const gsl::not_null*> vars_on_face, + const gsl::not_null*> + vars_on_face, const LowerHydroReconstructor& reconstruct_lower_neighbor_hydro, const LowerSpacetimeReconstructor& reconstruct_lower_neighbor_spacetime, const UpperHydroReconstructor& reconstruct_upper_neighbor_hydro, diff --git a/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/Wcns5z.cpp b/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/Wcns5z.cpp index b4b7b92dd907..96c742c1be30 100644 --- a/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/Wcns5z.cpp +++ b/src/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/Wcns5z.cpp @@ -259,103 +259,33 @@ bool operator!=(const Wcns5zPrim& lhs, const Wcns5zPrim& rhs) { } #define THERMO_DIM(data) BOOST_PP_TUPLE_ELEM(0, data) -#define TAGS_LIST_FD(data) \ - tmpl::list< \ - gr::Tags::SpacetimeMetric, gh::Tags::Pi, \ - gh::Tags::Phi, ValenciaDivClean::Tags::TildeD, \ - ValenciaDivClean::Tags::TildeYe, ValenciaDivClean::Tags::TildeTau, \ - ValenciaDivClean::Tags::TildeS, \ - ValenciaDivClean::Tags::TildeB, \ - ValenciaDivClean::Tags::TildePhi, \ - hydro::Tags::RestMassDensity, \ - hydro::Tags::ElectronFraction, \ - hydro::Tags::SpecificInternalEnergy, \ - hydro::Tags::SpatialVelocity, \ - hydro::Tags::MagneticField, \ - hydro::Tags::DivergenceCleaningField, \ - hydro::Tags::LorentzFactor, \ - hydro::Tags::Pressure, hydro::Tags::Temperature, \ - hydro::Tags::LorentzFactorTimesSpatialVelocity, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - tmpl::size_t<3>, Frame::Inertial>, \ - ::Tags::Flux, \ - tmpl::size_t<3>, 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>> -#define TAGS_LIST_DG_FD_INTERFACE(data) \ - tmpl::list< \ - gr::Tags::SpacetimeMetric, gh::Tags::Pi, \ - gh::Tags::Phi, ValenciaDivClean::Tags::TildeD, \ - ValenciaDivClean::Tags::TildeYe, ValenciaDivClean::Tags::TildeTau, \ - ValenciaDivClean::Tags::TildeS, \ - ValenciaDivClean::Tags::TildeB, \ - ValenciaDivClean::Tags::TildePhi, \ - hydro::Tags::RestMassDensity, \ - hydro::Tags::ElectronFraction, \ - hydro::Tags::SpecificInternalEnergy, \ - hydro::Tags::SpatialVelocity, \ - hydro::Tags::MagneticField, \ - hydro::Tags::DivergenceCleaningField, \ - hydro::Tags::LorentzFactor, \ - hydro::Tags::Pressure, hydro::Tags::Temperature, \ - hydro::Tags::LorentzFactorTimesSpatialVelocity, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - ::Tags::Flux, \ - tmpl::size_t<3>, Frame::Inertial>, \ - ::Tags::Flux, \ - tmpl::size_t<3>, Frame::Inertial>, \ - ::Tags::Flux, \ - Frame::Inertial>, \ - gh::ConstraintDamping::Tags::ConstraintGamma1, \ - gh::ConstraintDamping::Tags::ConstraintGamma2, \ - gr::Tags::Lapse, gr::Tags::Shift, \ - gr::Tags::SpatialMetric, \ - gr::Tags::SqrtDetSpatialMetric, \ - gr::Tags::InverseSpatialMetric, \ - evolution::dg::Actions::detail::NormalVector<3>> - -#define INSTANTIATION(r, data) \ - template void Wcns5zPrim::reconstruct( \ - gsl::not_null, 3>*> \ - vars_on_lower_face, \ - gsl::not_null, 3>*> \ - vars_on_upper_face, \ - const Variables>& volume_prims, \ - const Variables& \ - volume_spacetime_and_cons_vars, \ - const EquationsOfState::EquationOfState& eos, \ - const Element<3>& element, \ - const DirectionalIdMap<3, evolution::dg::subcell::GhostData>& \ - ghost_data, \ - const Mesh<3>& subcell_mesh) const; \ - template void Wcns5zPrim::reconstruct_fd_neighbor( \ - gsl::not_null*> vars_on_face, \ - const Variables>& subcell_volume_prims, \ - const Variables< \ - grmhd::GhValenciaDivClean::Tags::spacetime_reconstruction_tags>& \ - subcell_volume_spacetime_metric, \ - const EquationsOfState::EquationOfState& eos, \ - const Element<3>& element, \ - const DirectionalIdMap<3, evolution::dg::subcell::GhostData>& \ - ghost_data, \ - const Mesh<3>& subcell_mesh, \ +#define INSTANTIATION(r, data) \ + template void Wcns5zPrim::reconstruct( \ + gsl::not_null, 3>*> \ + vars_on_lower_face, \ + gsl::not_null, 3>*> \ + vars_on_upper_face, \ + const Variables>& volume_prims, \ + const Variables& \ + volume_spacetime_and_cons_vars, \ + const EquationsOfState::EquationOfState& eos, \ + const Element<3>& element, \ + const DirectionalIdMap<3, evolution::dg::subcell::GhostData>& \ + ghost_data, \ + const Mesh<3>& subcell_mesh) const; \ + template void Wcns5zPrim::reconstruct_fd_neighbor( \ + gsl::not_null*> \ + vars_on_face, \ + const Variables>& subcell_volume_prims, \ + const Variables< \ + grmhd::GhValenciaDivClean::Tags::spacetime_reconstruction_tags>& \ + subcell_volume_spacetime_metric, \ + const EquationsOfState::EquationOfState& eos, \ + const Element<3>& element, \ + const DirectionalIdMap<3, evolution::dg::subcell::GhostData>& \ + ghost_data, \ + const Mesh<3>& subcell_mesh, \ const Direction<3>& direction_to_reconstruct) const; GENERATE_INSTANTIATIONS(INSTANTIATION, (1, 2, 3)) diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonicityPreserving5.cpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonicityPreserving5.cpp index 35514c760d69..1d899a39d72b 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonicityPreserving5.cpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonicityPreserving5.cpp @@ -51,11 +51,11 @@ void MonotonicityPreserving5Prim::pup(PUP::er& p) { // NOLINTNEXTLINE PUP::able::PUP_ID MonotonicityPreserving5Prim::my_PUP_ID = 0; -template +template void MonotonicityPreserving5Prim::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_prims, const EquationsOfState::EquationOfState& eos, @@ -82,9 +82,9 @@ void MonotonicityPreserving5Prim::reconstruct( ghost_zone_size(), true); } -template +template void MonotonicityPreserving5Prim::reconstruct_fd_neighbor( - const gsl::not_null*> vars_on_face, + const gsl::not_null*> vars_on_face, const Variables>& subcell_volume_prims, const EquationsOfState::EquationOfState& eos, const Element& element, @@ -135,38 +135,12 @@ bool operator!=(const MonotonicityPreserving5Prim& lhs, } #define THERMO_DIM(data) BOOST_PP_TUPLE_ELEM(0, data) -#define TAGS_LIST(data) \ - tmpl::list, Tags::TildeB, \ - Tags::TildePhi, hydro::Tags::RestMassDensity, \ - hydro::Tags::ElectronFraction, \ - hydro::Tags::SpecificInternalEnergy, \ - hydro::Tags::SpatialVelocity, \ - hydro::Tags::MagneticField, \ - hydro::Tags::DivergenceCleaningField, \ - hydro::Tags::LorentzFactor, \ - hydro::Tags::Pressure, \ - hydro::Tags::Temperature, \ - hydro::Tags::LorentzFactorTimesSpatialVelocity, \ - ::Tags::Flux, Frame::Inertial>, \ - ::Tags::Flux, Frame::Inertial>, \ - ::Tags::Flux, Frame::Inertial>, \ - ::Tags::Flux, tmpl::size_t<3>, \ - Frame::Inertial>, \ - ::Tags::Flux, tmpl::size_t<3>, \ - 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>> #define INSTANTIATION(r, data) \ template void MonotonicityPreserving5Prim::reconstruct( \ - gsl::not_null, 3>*> \ + gsl::not_null, 3>*> \ vars_on_lower_face, \ - gsl::not_null, 3>*> \ + gsl::not_null, 3>*> \ vars_on_upper_face, \ const Variables>& volume_prims, \ const EquationsOfState::EquationOfState& eos, \ @@ -175,7 +149,7 @@ bool operator!=(const MonotonicityPreserving5Prim& lhs, ghost_data, \ const Mesh<3>& subcell_mesh) const; \ template void MonotonicityPreserving5Prim::reconstruct_fd_neighbor( \ - gsl::not_null*> vars_on_face, \ + gsl::not_null*> vars_on_face, \ const Variables>& subcell_volume_prims, \ const EquationsOfState::EquationOfState& eos, \ const Element<3>& element, \ @@ -187,6 +161,5 @@ bool operator!=(const MonotonicityPreserving5Prim& lhs, GENERATE_INSTANTIATIONS(INSTANTIATION, (1, 2, 3)) #undef INSTANTIATION -#undef TAGS_LIST #undef THERMO_DIM } // namespace grmhd::ValenciaDivClean::fd diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonicityPreserving5.hpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonicityPreserving5.hpp index 361cb5b8ce2c..2b49033842c9 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonicityPreserving5.hpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonicityPreserving5.hpp @@ -17,6 +17,7 @@ #include "Evolution/DgSubcell/Tags/GhostDataForReconstruction.hpp" #include "Evolution/DgSubcell/Tags/Inactive.hpp" #include "Evolution/DgSubcell/Tags/Mesh.hpp" +#include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Reconstructor.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp" #include "Options/String.hpp" @@ -122,10 +123,12 @@ class MonotonicityPreserving5Prim : public Reconstructor { evolution::dg::subcell::Tags::GhostDataForReconstruction, evolution::dg::subcell::Tags::Mesh>; - template + template void reconstruct( - gsl::not_null, dim>*> vars_on_lower_face, - gsl::not_null, dim>*> vars_on_upper_face, + gsl::not_null, dim>*> + vars_on_lower_face, + gsl::not_null, dim>*> + vars_on_upper_face, const Variables>& volume_prims, const EquationsOfState::EquationOfState& eos, const Element& element, @@ -133,9 +136,9 @@ class MonotonicityPreserving5Prim : public Reconstructor { ghost_data, const Mesh& subcell_mesh) const; - template + template void reconstruct_fd_neighbor( - gsl::not_null*> vars_on_face, + gsl::not_null*> vars_on_face, const Variables>& subcell_volume_prims, const EquationsOfState::EquationOfState& eos, const Element& element, diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonisedCentral.cpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonisedCentral.cpp index 02b045cdc267..f81f46e18271 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonisedCentral.cpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonisedCentral.cpp @@ -41,11 +41,11 @@ void MonotonisedCentralPrim::pup(PUP::er& p) { Reconstructor::pup(p); } // NOLINTNEXTLINE PUP::able::PUP_ID MonotonisedCentralPrim::my_PUP_ID = 0; -template +template void MonotonisedCentralPrim::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_prims, const EquationsOfState::EquationOfState& eos, @@ -70,9 +70,9 @@ void MonotonisedCentralPrim::reconstruct( ghost_zone_size(), true); } -template +template void MonotonisedCentralPrim::reconstruct_fd_neighbor( - const gsl::not_null*> vars_on_face, + const gsl::not_null*> vars_on_face, const Variables>& subcell_volume_prims, const EquationsOfState::EquationOfState& eos, const Element& element, @@ -123,38 +123,12 @@ bool operator!=(const MonotonisedCentralPrim& lhs, } #define THERMO_DIM(data) BOOST_PP_TUPLE_ELEM(0, data) -#define TAGS_LIST(data) \ - tmpl::list, Tags::TildeB, \ - Tags::TildePhi, hydro::Tags::RestMassDensity, \ - hydro::Tags::ElectronFraction, \ - hydro::Tags::SpecificInternalEnergy, \ - hydro::Tags::SpatialVelocity, \ - hydro::Tags::MagneticField, \ - hydro::Tags::DivergenceCleaningField, \ - hydro::Tags::LorentzFactor, \ - hydro::Tags::Pressure, \ - hydro::Tags::Temperature, \ - hydro::Tags::LorentzFactorTimesSpatialVelocity, \ - ::Tags::Flux, Frame::Inertial>, \ - ::Tags::Flux, Frame::Inertial>, \ - ::Tags::Flux, Frame::Inertial>, \ - ::Tags::Flux, tmpl::size_t<3>, \ - Frame::Inertial>, \ - ::Tags::Flux, tmpl::size_t<3>, \ - 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>> #define INSTANTIATION(r, data) \ template void MonotonisedCentralPrim::reconstruct( \ - gsl::not_null, 3>*> \ + gsl::not_null, 3>*> \ vars_on_lower_face, \ - gsl::not_null, 3>*> \ + gsl::not_null, 3>*> \ vars_on_upper_face, \ const Variables>& volume_prims, \ const EquationsOfState::EquationOfState& eos, \ @@ -163,7 +137,7 @@ bool operator!=(const MonotonisedCentralPrim& lhs, ghost_data, \ const Mesh<3>& subcell_mesh) const; \ template void MonotonisedCentralPrim::reconstruct_fd_neighbor( \ - gsl::not_null*> vars_on_face, \ + gsl::not_null*> vars_on_face, \ const Variables>& subcell_volume_prims, \ const EquationsOfState::EquationOfState& eos, \ const Element<3>& element, \ @@ -175,6 +149,5 @@ bool operator!=(const MonotonisedCentralPrim& lhs, GENERATE_INSTANTIATIONS(INSTANTIATION, (1, 2, 3)) #undef INSTANTIATION -#undef TAGS_LIST #undef THERMO_DIM } // namespace grmhd::ValenciaDivClean::fd diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonisedCentral.hpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonisedCentral.hpp index c53cde2a0bd2..64ea1526dd20 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonisedCentral.hpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/MonotonisedCentral.hpp @@ -15,6 +15,7 @@ #include "Domain/Tags.hpp" #include "Evolution/DgSubcell/Tags/GhostDataForReconstruction.hpp" #include "Evolution/DgSubcell/Tags/Mesh.hpp" +#include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Reconstructor.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp" #include "Options/String.hpp" @@ -99,10 +100,12 @@ class MonotonisedCentralPrim : public Reconstructor { evolution::dg::subcell::Tags::GhostDataForReconstruction, evolution::dg::subcell::Tags::Mesh>; - template + template void reconstruct( - gsl::not_null, dim>*> vars_on_lower_face, - gsl::not_null, dim>*> vars_on_upper_face, + gsl::not_null, dim>*> + vars_on_lower_face, + gsl::not_null, dim>*> + vars_on_upper_face, const Variables>& volume_prims, const EquationsOfState::EquationOfState& eos, const Element& element, @@ -111,9 +114,9 @@ class MonotonisedCentralPrim : public Reconstructor { const Mesh& subcell_mesh) const; /// Called by an element doing DG when the neighbor is doing subcell. - template + template void reconstruct_fd_neighbor( - gsl::not_null*> vars_on_face, + gsl::not_null*> vars_on_face, const Variables>& subcell_volume_prims, const EquationsOfState::EquationOfState& eos, const Element& element, diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/PositivityPreservingAdaptiveOrder.cpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/PositivityPreservingAdaptiveOrder.cpp index 11707e752586..6a9ecd977d33 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/PositivityPreservingAdaptiveOrder.cpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/PositivityPreservingAdaptiveOrder.cpp @@ -94,10 +94,12 @@ void PositivityPreservingAdaptiveOrderPrim::pup(PUP::er& p) { // NOLINTNEXTLINE PUP::able::PUP_ID PositivityPreservingAdaptiveOrderPrim::my_PUP_ID = 0; -template +template void PositivityPreservingAdaptiveOrderPrim::reconstruct( - const gsl::not_null, 3>*> vars_on_lower_face, - const gsl::not_null, 3>*> vars_on_upper_face, + const gsl::not_null, 3>*> + vars_on_lower_face, + const gsl::not_null, 3>*> + vars_on_upper_face, const gsl::not_null, 3>>*> reconstruction_order, const Variables>& volume_prims, @@ -145,9 +147,9 @@ void PositivityPreservingAdaptiveOrderPrim::reconstruct( ghost_zone_size(), true); } -template +template void PositivityPreservingAdaptiveOrderPrim::reconstruct_fd_neighbor( - const gsl::not_null*> vars_on_face, + const gsl::not_null*> vars_on_face, const Variables>& subcell_volume_prims, const EquationsOfState::EquationOfState& eos, const Element<3>& element, @@ -241,38 +243,12 @@ bool operator!=(const PositivityPreservingAdaptiveOrderPrim& lhs, } #define THERMO_DIM(data) BOOST_PP_TUPLE_ELEM(0, data) -#define TAGS_LIST(data) \ - tmpl::list, Tags::TildeB, \ - Tags::TildePhi, hydro::Tags::RestMassDensity, \ - hydro::Tags::ElectronFraction, \ - hydro::Tags::SpecificInternalEnergy, \ - hydro::Tags::SpatialVelocity, \ - hydro::Tags::MagneticField, \ - hydro::Tags::DivergenceCleaningField, \ - hydro::Tags::LorentzFactor, \ - hydro::Tags::Pressure, \ - hydro::Tags::Temperature, \ - hydro::Tags::LorentzFactorTimesSpatialVelocity, \ - ::Tags::Flux, Frame::Inertial>, \ - ::Tags::Flux, Frame::Inertial>, \ - ::Tags::Flux, Frame::Inertial>, \ - ::Tags::Flux, tmpl::size_t<3>, \ - Frame::Inertial>, \ - ::Tags::Flux, tmpl::size_t<3>, \ - 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>> #define INSTANTIATION(r, data) \ template void PositivityPreservingAdaptiveOrderPrim::reconstruct( \ - gsl::not_null, 3>*> \ + gsl::not_null, 3>*> \ vars_on_lower_face, \ - gsl::not_null, 3>*> \ + gsl::not_null, 3>*> \ vars_on_upper_face, \ const gsl::not_null< \ std::optional, 3>>*> \ @@ -285,7 +261,7 @@ bool operator!=(const PositivityPreservingAdaptiveOrderPrim& lhs, const Mesh<3>& subcell_mesh) const; \ template void \ PositivityPreservingAdaptiveOrderPrim::reconstruct_fd_neighbor( \ - gsl::not_null*> vars_on_face, \ + gsl::not_null*> vars_on_face, \ const Variables>& subcell_volume_prims, \ const EquationsOfState::EquationOfState& eos, \ const Element<3>& element, \ @@ -297,7 +273,6 @@ bool operator!=(const PositivityPreservingAdaptiveOrderPrim& lhs, GENERATE_INSTANTIATIONS(INSTANTIATION, (1, 2, 3)) #undef INSTANTIATION -#undef TAGS_LIST #undef THERMO_DIM } // namespace grmhd::ValenciaDivClean::fd diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/PositivityPreservingAdaptiveOrder.hpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/PositivityPreservingAdaptiveOrder.hpp index 44039dbb450a..555134afedd0 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/PositivityPreservingAdaptiveOrder.hpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/PositivityPreservingAdaptiveOrder.hpp @@ -14,6 +14,7 @@ #include "Domain/Tags.hpp" #include "Evolution/DgSubcell/Tags/GhostDataForReconstruction.hpp" #include "Evolution/DgSubcell/Tags/Mesh.hpp" +#include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Reconstructor.hpp" #include "NumericalAlgorithms/FiniteDifference/FallbackReconstructorType.hpp" #include "Options/Auto.hpp" @@ -158,10 +159,12 @@ class PositivityPreservingAdaptiveOrderPrim : public Reconstructor { evolution::dg::subcell::Tags::GhostDataForReconstruction, evolution::dg::subcell::Tags::Mesh>; - template + template void reconstruct( - gsl::not_null, dim>*> vars_on_lower_face, - gsl::not_null, dim>*> vars_on_upper_face, + gsl::not_null, dim>*> + vars_on_lower_face, + gsl::not_null, dim>*> + vars_on_upper_face, gsl::not_null, dim>>*> reconstruction_order, const Variables>& volume_prims, @@ -171,9 +174,9 @@ class PositivityPreservingAdaptiveOrderPrim : public Reconstructor { ghost_data, const Mesh& subcell_mesh) const; - template + template void reconstruct_fd_neighbor( - gsl::not_null*> vars_on_face, + gsl::not_null*> vars_on_face, const Variables>& subcell_volume_prims, const EquationsOfState::EquationOfState& eos, const Element& element, diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.hpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.hpp index e45fbc3c2411..ba9b6f7999bb 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.hpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.hpp @@ -7,8 +7,13 @@ #include #include +#include "DataStructures/DataBox/Prefixes.hpp" #include "DataStructures/Tensor/TypeAliases.hpp" #include "Domain/Structure/DirectionalIdMap.hpp" +#include "Evolution/Systems/GrMhd/ValenciaDivClean/TagsDeclarations.hpp" +#include "PointwiseFunctions/GeneralRelativity/TagsDeclarations.hpp" +#include "PointwiseFunctions/Hydro/TagsDeclarations.hpp" +#include "Utilities/TMPL.hpp" /// \cond class DataVector; @@ -33,9 +38,49 @@ class EquationOfState; namespace evolution::dg::subcell { class GhostData; } // namespace evolution::dg::subcell +namespace evolution::dg::Actions::detail { +template +struct NormalVector; +} // namespace evolution::dg::Actions::detail /// \endcond namespace grmhd::ValenciaDivClean::fd { +/// \brief The list of tags used by `reconstruct_prims_work` and +/// `reconstruct_fd_neighbor_work` +using tags_list_for_reconstruct = tmpl::list< + grmhd::ValenciaDivClean::Tags::TildeD, + grmhd::ValenciaDivClean::Tags::TildeYe, + grmhd::ValenciaDivClean::Tags::TildeTau, + grmhd::ValenciaDivClean::Tags::TildeS, + grmhd::ValenciaDivClean::Tags::TildeB, + grmhd::ValenciaDivClean::Tags::TildePhi, + hydro::Tags::RestMassDensity, + hydro::Tags::ElectronFraction, + hydro::Tags::SpecificInternalEnergy, + hydro::Tags::SpatialVelocity, + hydro::Tags::MagneticField, + hydro::Tags::DivergenceCleaningField, + hydro::Tags::LorentzFactor, hydro::Tags::Pressure, + hydro::Tags::Temperature, + hydro::Tags::LorentzFactorTimesSpatialVelocity, + ::Tags::Flux, + Frame::Inertial>, + ::Tags::Flux, + Frame::Inertial>, + ::Tags::Flux, + Frame::Inertial>, + ::Tags::Flux, + tmpl::size_t<3>, Frame::Inertial>, + ::Tags::Flux, + tmpl::size_t<3>, 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>>; + /*! * \brief Reconstructs the `PrimTagsForReconstruction` (usually * \f$\rho, p, Wv^i, B^i\f$, and \f$\Phi\f$), and if `compute_conservatives` is @@ -49,11 +94,12 @@ namespace grmhd::ValenciaDivClean::fd { * others, e.g. to guarantee the reconstructed solution is positive. */ template + size_t ThermodynamicDim, typename F, typename PrimsTagsSentByNeighbor> void reconstruct_prims_work( - gsl::not_null, 3>*> vars_on_lower_face, - gsl::not_null, 3>*> vars_on_upper_face, + gsl::not_null, 3>*> + vars_on_lower_face, + gsl::not_null, 3>*> + vars_on_upper_face, const F& reconstruct, const Variables& volume_prims, const EquationsOfState::EquationOfState& eos, const Element<3>& element, @@ -80,7 +126,7 @@ template void reconstruct_fd_neighbor_work( - gsl::not_null*> vars_on_face, + gsl::not_null*> vars_on_face, const F0& reconstruct_lower_neighbor, const F1& reconstruct_upper_neighbor, const Variables& subcell_volume_prims, const EquationsOfState::EquationOfState& eos, diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.tpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.tpp index 31b58b85baf2..738179d5188a 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.tpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.tpp @@ -3,6 +3,8 @@ #pragma once +#include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.hpp" + #include #include #include @@ -24,6 +26,7 @@ #include "Evolution/Systems/GrMhd/ValenciaDivClean/ConservativeFromPrimitive.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp" #include "NumericalAlgorithms/Spectral/Mesh.hpp" +#include "PointwiseFunctions/GeneralRelativity/Tags.hpp" #include "PointwiseFunctions/Hydro/EquationsOfState/EquationOfState.hpp" #include "PointwiseFunctions/Hydro/Tags.hpp" #include "Utilities/ErrorHandling/Assert.hpp" @@ -119,11 +122,12 @@ void compute_conservatives_for_reconstruction( } template + size_t ThermodynamicDim, typename F, typename PrimsTagsSentByNeighbor> void reconstruct_prims_work( - const gsl::not_null, 3>*> vars_on_lower_face, - const gsl::not_null, 3>*> vars_on_upper_face, + const gsl::not_null, 3>*> + vars_on_lower_face, + const gsl::not_null, 3>*> + vars_on_upper_face, const F& reconstruct, const Variables& volume_prims, const EquationsOfState::EquationOfState& eos, const Element<3>& element, @@ -232,10 +236,9 @@ void reconstruct_prims_work( } template + typename PrimsTags, size_t ThermodynamicDim, typename F0, typename F1> void reconstruct_fd_neighbor_work( - const gsl::not_null*> vars_on_face, + const gsl::not_null*> vars_on_face, const F0& reconstruct_lower_neighbor, const F1& reconstruct_upper_neighbor, const Variables& subcell_volume_prims, const EquationsOfState::EquationOfState& eos, diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Wcns5z.cpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Wcns5z.cpp index 09f6a7c661a1..672b54dcc053 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Wcns5z.cpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Wcns5z.cpp @@ -74,10 +74,12 @@ void Wcns5zPrim::pup(PUP::er& p) { // NOLINTNEXTLINE PUP::able::PUP_ID Wcns5zPrim::my_PUP_ID = 0; -template +template void Wcns5zPrim::reconstruct( - const gsl::not_null, 3>*> vars_on_lower_face, - const gsl::not_null, 3>*> vars_on_upper_face, + const gsl::not_null, 3>*> + vars_on_lower_face, + const gsl::not_null, 3>*> + vars_on_upper_face, const Variables>& volume_prims, const EquationsOfState::EquationOfState& eos, const Element<3>& element, @@ -102,9 +104,9 @@ void Wcns5zPrim::reconstruct( ghost_zone_size(), true); } -template +template void Wcns5zPrim::reconstruct_fd_neighbor( - const gsl::not_null*> vars_on_face, + const gsl::not_null*> vars_on_face, const Variables>& subcell_volume_prims, const EquationsOfState::EquationOfState& eos, const Element<3>& element, @@ -154,38 +156,12 @@ bool operator!=(const Wcns5zPrim& lhs, const Wcns5zPrim& rhs) { } #define THERMO_DIM(data) BOOST_PP_TUPLE_ELEM(0, data) -#define TAGS_LIST(data) \ - tmpl::list, Tags::TildeB, \ - Tags::TildePhi, hydro::Tags::RestMassDensity, \ - hydro::Tags::ElectronFraction, \ - hydro::Tags::SpecificInternalEnergy, \ - hydro::Tags::SpatialVelocity, \ - hydro::Tags::MagneticField, \ - hydro::Tags::DivergenceCleaningField, \ - hydro::Tags::LorentzFactor, \ - hydro::Tags::Pressure, \ - hydro::Tags::Temperature, \ - hydro::Tags::LorentzFactorTimesSpatialVelocity, \ - ::Tags::Flux, Frame::Inertial>, \ - ::Tags::Flux, Frame::Inertial>, \ - ::Tags::Flux, Frame::Inertial>, \ - ::Tags::Flux, tmpl::size_t<3>, \ - Frame::Inertial>, \ - ::Tags::Flux, tmpl::size_t<3>, \ - 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>> #define INSTANTIATION(r, data) \ template void Wcns5zPrim::reconstruct( \ - gsl::not_null, 3>*> \ + gsl::not_null, 3>*> \ vars_on_lower_face, \ - gsl::not_null, 3>*> \ + gsl::not_null, 3>*> \ vars_on_upper_face, \ const Variables>& volume_prims, \ const EquationsOfState::EquationOfState& eos, \ @@ -194,7 +170,7 @@ bool operator!=(const Wcns5zPrim& lhs, const Wcns5zPrim& rhs) { ghost_data, \ const Mesh<3>& subcell_mesh) const; \ template void Wcns5zPrim::reconstruct_fd_neighbor( \ - gsl::not_null*> vars_on_face, \ + gsl::not_null*> vars_on_face, \ const Variables>& subcell_volume_prims, \ const EquationsOfState::EquationOfState& eos, \ const Element<3>& element, \ @@ -206,7 +182,6 @@ bool operator!=(const Wcns5zPrim& lhs, const Wcns5zPrim& rhs) { GENERATE_INSTANTIATIONS(INSTANTIATION, (1, 2, 3)) #undef INSTANTIATION -#undef TAGS_LIST #undef THERMO_DIM } // namespace grmhd::ValenciaDivClean::fd diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Wcns5z.hpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Wcns5z.hpp index 4e03b1b9f1ac..9ab5ca0d6d8c 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Wcns5z.hpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Wcns5z.hpp @@ -14,6 +14,7 @@ #include "Domain/Tags.hpp" #include "Evolution/DgSubcell/Tags/GhostDataForReconstruction.hpp" #include "Evolution/DgSubcell/Tags/Mesh.hpp" +#include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Reconstructor.hpp" #include "NumericalAlgorithms/FiniteDifference/FallbackReconstructorType.hpp" #include "Options/String.hpp" @@ -132,10 +133,12 @@ class Wcns5zPrim : public Reconstructor { evolution::dg::subcell::Tags::GhostDataForReconstruction, evolution::dg::subcell::Tags::Mesh>; - template + template void reconstruct( - gsl::not_null, dim>*> vars_on_lower_face, - gsl::not_null, dim>*> vars_on_upper_face, + gsl::not_null, dim>*> + vars_on_lower_face, + gsl::not_null, dim>*> + vars_on_upper_face, const Variables>& volume_prims, const EquationsOfState::EquationOfState& eos, const Element& element, @@ -143,9 +146,9 @@ class Wcns5zPrim : public Reconstructor { ghost_data, const Mesh& subcell_mesh) const; - template + template void reconstruct_fd_neighbor( - gsl::not_null*> vars_on_face, + gsl::not_null*> vars_on_face, const Variables>& subcell_volume_prims, const EquationsOfState::EquationOfState& eos, const Element& element, diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/NeighborPackagedData.hpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/NeighborPackagedData.hpp index 40398385dbbd..fd00bf165f33 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/NeighborPackagedData.hpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/NeighborPackagedData.hpp @@ -36,6 +36,7 @@ #include "Evolution/DiscontinuousGalerkin/Actions/PackageDataImpl.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/BoundaryCorrections/BoundaryCorrection.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/BoundaryCorrections/Factory.hpp" +#include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Reconstructor.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Tag.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/Subcell/ComputeFluxes.hpp" @@ -70,10 +71,6 @@ struct NeighborPackagedData { const std::vector>& mortars_to_reconstruct_to) { using evolved_vars_tag = typename System::variables_tag; using evolved_vars_tags = typename evolved_vars_tag::tags_list; - using prim_tags = typename System::primitive_variables_tag::tags_list; - using recons_prim_tags = tmpl::push_back< - prim_tags, - hydro::Tags::LorentzFactorTimesSpatialVelocity>; using fluxes_tags = db::wrap_tags_in<::Tags::Flux, evolved_vars_tags, tmpl::size_t<3>, Frame::Inertial>; @@ -122,14 +119,7 @@ struct NeighborPackagedData { if (typeid(boundary_correction) == typeid(DerivedCorrection)) { using dg_package_data_temporary_tags = typename DerivedCorrection::dg_package_data_temporary_tags; - using dg_package_data_argument_tags = - tmpl::append, - gr::Tags::SqrtDetSpatialMetric, - gr::Tags::InverseSpatialMetric, - evolution::dg::Actions::detail::NormalVector<3>>>>; + using dg_package_data_argument_tags = fd::tags_list_for_reconstruct; const auto& element = db::get>(box); const auto& eos = get(box); diff --git a/tests/Unit/Helpers/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/PrimReconstructor.hpp b/tests/Unit/Helpers/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/PrimReconstructor.hpp index 3fd929ae5437..26ce7751bfa3 100644 --- a/tests/Unit/Helpers/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/PrimReconstructor.hpp +++ b/tests/Unit/Helpers/Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/PrimReconstructor.hpp @@ -3,6 +3,7 @@ #pragma once +#include "Evolution/Systems/GrMhd/GhValenciaDivClean/FiniteDifference/ReconstructWork.hpp" #include "Framework/TestingFramework.hpp" #include @@ -200,9 +201,6 @@ void test_prim_reconstructor_impl( using prims_tags = hydro::grmhd_tags; using cons_tags = typename ghmhd::System::variables_tag::tags_list; - using flux_tags = - db::wrap_tags_in<::Tags::Flux, typename ghmhd::System::flux_variables, - tmpl::size_t<3>, Frame::Inertial>; using spacetime_tags = ::grmhd::GhValenciaDivClean::Tags::spacetime_reconstruction_tags; @@ -223,25 +221,10 @@ void test_prim_reconstructor_impl( (subcell_mesh.extents(0) + 1) * subcell_mesh.extents().slice_away(0).product(); - using fd_package_data_argument_tags = tmpl::remove_duplicates>, - flux_tags, - tmpl::list>>>; - using dg_package_data_argument_tags = tmpl::remove_duplicates>, - flux_tags, - tmpl::list>>>; + using fd_package_data_argument_tags = + ::grmhd::GhValenciaDivClean::fd::tags_list_for_reconstruct; + using dg_package_data_argument_tags = + ::grmhd::GhValenciaDivClean::fd::tags_list_for_reconstruct_fd_neighbor; std::array, 3> vars_on_lower_face = make_array<3>( diff --git a/tests/Unit/Helpers/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/PrimReconstructor.hpp b/tests/Unit/Helpers/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/PrimReconstructor.hpp index 6dc5d881d439..a410baf59d81 100644 --- a/tests/Unit/Helpers/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/PrimReconstructor.hpp +++ b/tests/Unit/Helpers/Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/PrimReconstructor.hpp @@ -28,6 +28,7 @@ #include "Evolution/DgSubcell/SliceData.hpp" #include "Evolution/DiscontinuousGalerkin/Actions/NormalCovectorAndMagnitude.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/ConservativeFromPrimitive.hpp" +#include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/ReconstructWork.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Reconstructor.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/System.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp" @@ -106,8 +107,7 @@ void test_prim_reconstructor_impl( using prims_tags = hydro::grmhd_tags; using cons_tags = typename mhd::System::variables_tag::tags_list; - using flux_tags = db::wrap_tags_in<::Tags::Flux, cons_tags, tmpl::size_t<3>, - Frame::Inertial>; + using prim_tags_for_reconstruction = tmpl::list; @@ -157,18 +157,9 @@ void test_prim_reconstructor_impl( (subcell_mesh.extents(0) + 1) * subcell_mesh.extents().slice_away(0).product(); - using dg_package_data_argument_tags = tmpl::append< - cons_tags, - tmpl::push_back< - prims_tags, - hydro::Tags::LorentzFactorTimesSpatialVelocity>, - flux_tags, - tmpl::remove_duplicates, gr::Tags::Shift, - gr::Tags::SpatialMetric, - gr::Tags::SqrtDetSpatialMetric, - gr::Tags::InverseSpatialMetric, - evolution::dg::Actions::detail::NormalVector<3>>>>>; + using dg_package_data_argument_tags = + ::grmhd::ValenciaDivClean::fd::tags_list_for_reconstruct; + tnsr::ii lower_face_spatial_metric{ reconstructed_num_pts, 0.0}; tnsr::ii upper_face_spatial_metric{