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
33{
35 std::string version;
37 std::string how;
39 bool convert_ids = false;
41 int dim = 0;
43 int num_real = 0;
47 int num_int = 0;
51 bool is_checkpoint = false;
57 int finest_level = 0;
58
69 void parse (std::istream& is);
70
80 static ParticleHeader read (const std::string& dir, const std::string& file);
81};
82
83}
84
85#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
Metadata prefix of an AMReX particle "Header" file.
Definition AMReX_ParticleHeader.H:33
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:80
int num_int
number of integer components
Definition AMReX_ParticleHeader.H:47
Long next_id
the next particle id to hand out (maxnextid)
Definition AMReX_ParticleHeader.H:55
int dim
AMREX_SPACEDIM the file was written with.
Definition AMReX_ParticleHeader.H:41
Vector< std::string > real_comp_names
names of the real components, size() == num_real
Definition AMReX_ParticleHeader.H:45
bool is_checkpoint
true if the file is a checkpoint (full restart), false for a plotfile
Definition AMReX_ParticleHeader.H:51
bool convert_ids
whether particle ids need to be converted (Version_Two_Dot_One and later)
Definition AMReX_ParticleHeader.H:39
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:49
int finest_level
finest level present in the file
Definition AMReX_ParticleHeader.H:57
std::string how
precision the particle data was written in: "single" or "double"
Definition AMReX_ParticleHeader.H:37
int num_real
number of real components (pure SoA: excludes the AMREX_SPACEDIM positions)
Definition AMReX_ParticleHeader.H:43
Long num_particles
total number of particles in the file
Definition AMReX_ParticleHeader.H:53
std::string version
raw version string, e.g. "Version_Two_Dot_One_double"
Definition AMReX_ParticleHeader.H:35