Load numeric data from volume data files.
This class loads all requested tags from volume data files using spectre::Exporter::interpolate_to_points
. This is an easy and useful alternative to importers::ElementDataReader
to load numeric data with the following advantages:
- No need to work with parallel components, actions, or phases to load numeric data. Also, no need to parse numeric data options separately from analytic data options. Just include this class in the list of analytic data classes for the executable.
- The data is interpolated and returned in serial, just like analytic data.
- The data can be re-interpolated to any set of points on request, which is an easy way to handle AMR or other domain changes.
However, it also comes with the following caveats:
- The volume data files must have datasets with the same names as the tags being loaded. For example, if the tag being loaded is
gr::Tags::Shift
, then the volume data files must have datasets named Shift_x
, Shift_y
, and Shift_z
. If you need processing of the data before it can be used, e.g. to load some datasets and compute other derived quantities from them, then consider writing a custom class or use importers::ElementDataReader
.
- Reading in data on the same grid that it was written on may not give you the same data back, at least not on Gauss-Lobatto grids. This is because grid points on element boundaries are disambiguated by
block_logical_coordinates
and element_logical_coordinates
, so a boundary point may be written by one element but read back in from its neighbor. To avoid this, consider using importers::ElementDataReader
which has functionality to read in data on the same grid that it was written on. This is not possible with this class because it is not aware of the element structure (it operates in a pointwise manner).
- Large datasets may not fit in memory. Each element will open the H5 files and interpolate data from them, so this may not fit in memory if the datasets are large and/or many elements are doing this at the same time. To avoid this, consider using
importers::ElementDataReader
which reads one H5 file at a time on the node level.