SpECTRE  v2024.05.11
TestHelpers::observers::MockWriteReductionDataRow Struct Reference

Action meant to mock WriteReductionDataRow. More...

#include <MockWriteReductionDataRow.hpp>

Static Public Member Functions

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

Detailed Description

Action meant to mock WriteReductionDataRow.

Details

Instead of writing to disk, this action will mutate the MockReductionFileTag stored in the DataBox of the MockObserverWriter with the values passed in. We want to avoid writing to disk in the testing framework because IO is slow and we don't really care that things were written to disk, just that the correct values were recorded.

To check what values were written, get the MockDat file:

auto& mock_h5_file =
ActionTesting::get_databox_tag<mock_observer_writer,
MockReductionFileTag>(runner, 0);
const auto& mock_dat_file = mock_h5_file.get_dat(subfile_path);
CHECK(mock_dat_file.get_legend() == legend);
CHECK(mock_dat_file.get_data() == Matrix{{1.0, 9.3}});
A dynamically sized matrix of doubles with column-major storage.
Definition: Matrix.hpp:19
const auto & get_databox_tag(const MockRuntimeSystem< Metavariables > &runner, const typename Component::array_index &array_index)
Returns the Tag from the DataBox of the parallel component Component with array index array_index....
Definition: MockRuntimeSystemFreeFunctions.hpp:215

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