|
SpECTRE
2021.08.02
|
Read a volume data file and distribute the data to all registered elements. More...
#include <ReadVolumeData.hpp>
Static Public Member Functions | |
| template<typename ParallelComponent , typename DataBox , typename Metavariables , typename ArrayIndex , Requires< db::tag_is_retrievable_v< Tags::RegisteredElements, DataBox > and db::tag_is_retrievable_v< Tags::ElementDataAlreadyRead, DataBox > > = nullptr> | |
| static void | apply (DataBox &box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &) noexcept |
Read a volume data file and distribute the data to all registered elements.
This action can be invoked on the importers::ElementDataReader component once all elements have been registered with it. It opens the data file, reads the data for each registered element and uses Parallel::receive_data to distribute the data to the elements. The elements can monitor importers::Tags::VolumeData in their inbox to wait for the data and process it once it's available. You can use importers::Actions::ReceiveVolumeData to wait for the data and move it directly into the DataBox, or implement a specialized action that might verify and post-process the data.
Note that instead of invoking this action directly on the importers::ElementDataReader component you can invoke the iterable action importers::Actions::ReadVolumeData on the elements of an array parallel component.
ImporterOptionsGroup parameter specifies the options group in the input file that provides the following run-time options:
FieldTagsList parameter specifies a typelist of tensor tags that are read from the file and provided to each element. It is assumed that the tensor data is stored in datasets named db::tag_name<Tag>() + suffix, where the suffix is empty for scalars or "_" followed by the Tensor::component_name for each independent tensor component.Parallel::receive_data is invoked on each registered element of the ReceiveComponent to populate importers::Tags::VolumeData in the element's inbox with a tuples::tagged_tuple_from_typelist<FieldTagsList> containing the tensor data for that element. The ReceiveComponent must the the same that was encoded into the observers::ArrayComponentId used to register the elements.