diff --git a/src/IO/Observer/ReductionActions.cpp b/src/IO/Observer/ReductionActions.cpp index 48167ec716c2..ea7677d412ba 100644 --- a/src/IO/Observer/ReductionActions.cpp +++ b/src/IO/Observer/ReductionActions.cpp @@ -21,4 +21,10 @@ void append_to_reduction_data( all_reduction_data->insert(all_reduction_data->end(), t.begin(), t.end()); } +void append_to_reduction_data( + const gsl::not_null*> all_reduction_data, + const std::array& t) { + all_reduction_data->insert(all_reduction_data->end(), t.begin(), t.end()); +} + } // namespace observers::ThreadedActions::ReductionActions_detail diff --git a/src/IO/Observer/ReductionActions.hpp b/src/IO/Observer/ReductionActions.hpp index 842d643c351c..bfa5e81856f9 100644 --- a/src/IO/Observer/ReductionActions.hpp +++ b/src/IO/Observer/ReductionActions.hpp @@ -229,6 +229,10 @@ void append_to_reduction_data( const gsl::not_null*> all_reduction_data, const std::vector& t); +void append_to_reduction_data( + gsl::not_null*> all_reduction_data, + const std::array& t); + template void write_data(const std::string& subfile_name, const std::string& input_source, diff --git a/src/ParallelAlgorithms/ApparentHorizonFinder/HorizonAliases.hpp b/src/ParallelAlgorithms/ApparentHorizonFinder/HorizonAliases.hpp index b22f4a60351a..ab9d017d107a 100644 --- a/src/ParallelAlgorithms/ApparentHorizonFinder/HorizonAliases.hpp +++ b/src/ParallelAlgorithms/ApparentHorizonFinder/HorizonAliases.hpp @@ -41,9 +41,8 @@ using tags_for_observing = tmpl::list< gr::surfaces::Tags::IrreducibleMassCompute, ylm::Tags::MaxRicciScalarCompute, ylm::Tags::MinRicciScalarCompute, gr::surfaces::Tags::ChristodoulouMassCompute, - gr::surfaces::Tags::DimensionlessSpinMagnitudeCompute - // Needs `ObserveTimeSeriesOnSurface` to be able to write a `std::array` - // gr::surfaces::Tags::DimensionlessSpinVectorCompute + gr::surfaces::Tags::DimensionlessSpinMagnitudeCompute, + gr::surfaces::Tags::DimensionfulSpinVectorCompute >; using surface_tags_for_observing = tmpl::list; diff --git a/src/ParallelAlgorithms/Interpolation/Callbacks/ObserveTimeSeriesOnSurface.hpp b/src/ParallelAlgorithms/Interpolation/Callbacks/ObserveTimeSeriesOnSurface.hpp index 679192322f05..d902c360afb4 100644 --- a/src/ParallelAlgorithms/Interpolation/Callbacks/ObserveTimeSeriesOnSurface.hpp +++ b/src/ParallelAlgorithms/Interpolation/Callbacks/ObserveTimeSeriesOnSurface.hpp @@ -40,9 +40,35 @@ namespace callbacks { namespace detail { +template +struct is_array_of_double : std::false_type {}; + +template +struct is_array_of_double> : std::true_type {}; + template auto make_legend(tmpl::list /* meta */) { - return std::vector{"Time", db::tag_name()...}; + std::vector legend = {"Time"}; + + auto append_tags = [&legend](auto tag) { + using TagType = decltype(tag); + using ReturnType = typename TagType::type; + + if constexpr (is_array_of_double::value) { + constexpr std::array suffix = {"_x", "_y", "_z"}; + for (size_t i = 0; i < std::tuple_size::value; ++i) { + legend.push_back(db::tag_name() + gsl::at(suffix, i)); + } + } + else { + legend.push_back(db::tag_name()); + } + + }; + + (append_tags(Ts{}), ...); + + return legend; } template diff --git a/src/PointwiseFunctions/GeneralRelativity/Surfaces/Spin.cpp b/src/PointwiseFunctions/GeneralRelativity/Surfaces/Spin.cpp index 1b86947e0bbc..cd74d0120fbd 100644 --- a/src/PointwiseFunctions/GeneralRelativity/Surfaces/Spin.cpp +++ b/src/PointwiseFunctions/GeneralRelativity/Surfaces/Spin.cpp @@ -636,7 +636,7 @@ GENERATE_INSTANTIATIONS(INSTANTIATE, GENERATE_INSTANTIATIONS(INSTANTIATE, (Frame::Grid, Frame::Distorted, Frame::Inertial), - (Frame::Inertial)) + (Frame::Inertial, Frame::Distorted)) #undef INSTANTIATE #undef MEASUREMENTFRAME #undef METRICFRAME