|
SpECTRE
v2026.04.01
|
The importers namespace holds functionality for importing data into SpECTRE. We currently support loading volume data files in the same format that is written by the observers.
The importers::ElementDataReader parallel component is responsible for loading volume data, interpolating it, and distributing it to elements of one or multiple array parallel components. As a first step, make sure you have added the importers::ElementDataReader to your Metavariables::component_list. Also make sure you have a Parallel::Phase in which you will perform registration with the importer, and another in which you want to load the data. Here's an example for such Metavariables:
To load volume data from a file, write an action in which you invoke importers::Actions::ReadAllVolumeDataAndDistribute on the importers::ElementDataReader. For simple use cases we provide importers::Actions::ReadVolumeData, which can be added to the phase_dependent_action_list of your element array and which will generate input-file options for you. Here's an example that will be explained in more detail below:
The parameters passed to importers::Actions::ReadAllVolumeDataAndDistribute specify the volume data to load. See the documentation of importers::Actions::ReadAllVolumeDataAndDistribute for details. In the example above, we use importers::Actions::ReadVolumeData to generate the input-file options for us and place them in an option group:
This results in a section in the input file that may look like this: