SpECTRE
v2024.09.29
|
Write a single row of data to the reductions file without the need to register or reduce anything, e.g. from a singleton component or from a specific chare. More...
#include <ReductionActions.hpp>
Public Types | |
using | return_type = void |
Static Public Member Functions | |
template<typename ParallelComponent , typename DbTagsList , typename Metavariables , typename ArrayIndex , typename... Ts> | |
static void | apply (db::DataBox< DbTagsList > &box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &, const gsl::not_null< Parallel::NodeLock * > node_lock, const std::string &subfile_name, std::vector< std::string > legend, std::tuple< Ts... > &&reduction_data) |
The apply call for the threaded action. | |
template<typename ParallelComponent , typename DbTagList , typename Metavariables , typename... Ts> | |
static return_type | apply (db::DataBox< DbTagList > &box, const gsl::not_null< Parallel::NodeLock * >, Parallel::GlobalCache< Metavariables > &cache, const std::string &subfile_name, std::vector< std::string > legend, std::tuple< Ts... > &&reduction_data) |
The apply call for the local synchronous action. | |
Write a single row of data to the reductions file without the need to register or reduce anything, e.g. from a singleton component or from a specific chare.
Use observers::Actions::ContributeReductionData instead if you need to perform a reduction before writing to the file.
Invoke this action on the observers::ObserverWriter component on node 0. Pass the following arguments when invoking this action:
subfile_name
: the name of the h5::Dat
subfile in the HDF5 file. Include a leading slash, e.g., /element_data
.legend
: a std::vector<std::string>
of column labels for the quantities being observed (e.g. {"Time", "L1ErrorDensity", "L2ErrorDensity"}
).reduction_data
: a std::tuple<...>
with the data to write. The tuple can hold either double
s or std::vector<double>
s and is flattened before it is written to the file to form a single row of values. The total number of values must match the length of the legend
.