![]() |
Block-Structured AMR Software Framework
|
Metadata prefix of an AMReX particle "Header" file. More...
#include <AMReX_ParticleHeader.H>
Public Member Functions | |
| void | parse (std::istream &is) |
| Parse the metadata prefix from an input stream. | |
Static Public Member Functions | |
| static ParticleHeader | read (const std::string &dir, const std::string &file) |
| Read and parse the "Header" file of a particle plotfile/checkpoint. | |
Public Attributes | |
| std::string | version |
| raw version string, e.g. "Version_Two_Dot_One_double" | |
| std::string | how |
| precision the particle data was written in: "single" or "double" | |
| bool | convert_ids = false |
| whether particle ids need to be converted (Version_Two_Dot_One and later) | |
| int | dim = 0 |
| AMREX_SPACEDIM the file was written with. | |
| int | num_real = 0 |
| number of real components (pure SoA: excludes the AMREX_SPACEDIM positions) | |
| Vector< std::string > | real_comp_names |
| names of the real components, size() == num_real | |
| int | num_int = 0 |
| number of integer components | |
| Vector< std::string > | int_comp_names |
| names of the integer components, size() == num_int | |
| bool | is_checkpoint = false |
| true if the file is a checkpoint (full restart), false for a plotfile | |
| Long | num_particles = 0 |
| total number of particles in the file | |
| Long | next_id = 0 |
| the next particle id to hand out (maxnextid) | |
| int | finest_level = 0 |
| finest level present in the file | |
Metadata prefix of an AMReX particle "Header" file.
This is the single source of truth for parsing the leading metadata of a particle plotfile/checkpoint "Header" file, as written by WriteBinaryParticleData. It is used both by ParticleContainer::Restart (to read a file into a container) and standalone (e.g. from language bindings) to discover the on-disk layout - number and names of the real/int components, the precision, and whether the file is a checkpoint - before constructing or configuring a container to read it.
The component counts follow the same convention as the on-disk format: for pure Struct-of-Arrays particles the AMREX_SPACEDIM position components are implicit and num_real counts only the remaining (runtime) real components.
| void amrex::ParticleHeader::parse | ( | std::istream & | is | ) |
Parse the metadata prefix from an input stream.
Consumes exactly the leading metadata block (version through finest level), leaving the stream positioned right after the finest-level entry and before the per-level grid table. This lets ParticleContainer::Restart continue reading the grid offsets from the same stream.
| is | input stream positioned at the start of a particle Header |
|
static |
Read and parse the "Header" file of a particle plotfile/checkpoint.
Collective: the file is read on the I/O process and broadcast.
| dir | plotfile/checkpoint directory |
| file | particle sub-directory name (e.g. "particle0") |
| bool amrex::ParticleHeader::convert_ids = false |
whether particle ids need to be converted (Version_Two_Dot_One and later)
| int amrex::ParticleHeader::dim = 0 |
AMREX_SPACEDIM the file was written with.
| int amrex::ParticleHeader::finest_level = 0 |
finest level present in the file
| std::string amrex::ParticleHeader::how |
precision the particle data was written in: "single" or "double"
| Vector<std::string> amrex::ParticleHeader::int_comp_names |
names of the integer components, size() == num_int
| bool amrex::ParticleHeader::is_checkpoint = false |
true if the file is a checkpoint (full restart), false for a plotfile
| Long amrex::ParticleHeader::next_id = 0 |
the next particle id to hand out (maxnextid)
| int amrex::ParticleHeader::num_int = 0 |
number of integer components
| Long amrex::ParticleHeader::num_particles = 0 |
total number of particles in the file
| int amrex::ParticleHeader::num_real = 0 |
number of real components (pure SoA: excludes the AMREX_SPACEDIM positions)
| Vector<std::string> amrex::ParticleHeader::real_comp_names |
names of the real components, size() == num_real
| std::string amrex::ParticleHeader::version |
raw version string, e.g. "Version_Two_Dot_One_double"