SpECTRE  v2024.03.19
observers::ThreadedActions::WriteReductionDataRow Struct Reference

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>

Static Public Member Functions

template<typename ParallelComponent , typename DbTagsList , typename Metavariables , typename ArrayIndex , typename... Ts, typename DataBox = db::DataBox<DbTagsList>>
static void apply (db::DataBox< DbTagsList > &box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &, const gsl::not_null< Parallel::NodeLock * >, const std::string &subfile_name, std::vector< std::string > &&legend, std::tuple< Ts... > &&reduction_data)
 

Detailed Description

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 doubles 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.

The documentation for this struct was generated from the following file: