Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_ParticleHeader.H
Go to the documentation of this file.
1/* Copyright 2026 The AMReX Community
2 *
3 * License: BSD-3-Clause-LBNL
4 */
5#ifndef AMREX_PARTICLEHEADER_H_
6#define AMREX_PARTICLEHEADER_H_
7#include <AMReX_Config.H>
8
9#include <AMReX_INT.H>
10#include <AMReX_Vector.H>
11
12#include <iosfwd>
13#include <string>
14
15namespace amrex {
16
38{
40 std::string version;
42 std::string how;
44 bool convert_ids = false;
46 int dim = 0;
48 int num_real = 0;
52 int num_int = 0;
56 bool is_checkpoint = false;
62 int finest_level = 0;
63
71 struct GridEntry
72 {
74 int which = 0;
76 int count = 0;
79 };
80
89
100 void parse (std::istream& is);
101
110 void parse_grid_table (std::istream& is);
111
122 static ParticleHeader read (const std::string& dir, const std::string& file);
123};
124
125}
126
127#endif
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition AMReX_Vector.H:29
amrex_long Long
Definition AMReX_INT.H:30
Definition AMReX_Amr.cpp:50
One entry of the per-level grid table.
Definition AMReX_ParticleHeader.H:72
int count
number of particles stored for this grid
Definition AMReX_ParticleHeader.H:76
int which
index of the binary data file (DATA_XXXXX) holding this grid's particles
Definition AMReX_ParticleHeader.H:74
Long where
byte offset of this grid's particle data within the data file
Definition AMReX_ParticleHeader.H:78
Metadata prefix of an AMReX particle "Header" file.
Definition AMReX_ParticleHeader.H:38
static ParticleHeader read(const std::string &dir, const std::string &file)
Read and parse the "Header" file of a particle plotfile/checkpoint.
Definition AMReX_ParticleHeader.cpp:106
void parse_grid_table(std::istream &is)
Parse the per-level grid table into grids.
Definition AMReX_ParticleHeader.cpp:82
int num_int
number of integer components
Definition AMReX_ParticleHeader.H:52
Vector< Vector< GridEntry > > grids
Per level and grid: where each grid's particle data is stored.
Definition AMReX_ParticleHeader.H:88
Long next_id
the next particle id to hand out (maxnextid)
Definition AMReX_ParticleHeader.H:60
int dim
AMREX_SPACEDIM the file was written with.
Definition AMReX_ParticleHeader.H:46
Vector< std::string > real_comp_names
names of the real components, size() == num_real
Definition AMReX_ParticleHeader.H:50
bool is_checkpoint
true if the file is a checkpoint (full restart), false for a plotfile
Definition AMReX_ParticleHeader.H:56
bool convert_ids
whether particle ids need to be converted (Version_Two_Dot_One and later)
Definition AMReX_ParticleHeader.H:44
void parse(std::istream &is)
Parse the metadata prefix from an input stream.
Definition AMReX_ParticleHeader.cpp:16
Vector< std::string > int_comp_names
names of the integer components, size() == num_int
Definition AMReX_ParticleHeader.H:54
int finest_level
finest level present in the file
Definition AMReX_ParticleHeader.H:62
std::string how
precision the particle data was written in: "single" or "double"
Definition AMReX_ParticleHeader.H:42
int num_real
number of real components (pure SoA: excludes the AMREX_SPACEDIM positions)
Definition AMReX_ParticleHeader.H:48
Long num_particles
total number of particles in the file
Definition AMReX_ParticleHeader.H:58
std::string version
raw version string, e.g. "Version_Two_Dot_One_double"
Definition AMReX_ParticleHeader.H:40