#include <WarpXOpenPMD.H>
|
| WarpXOpenPMDPlot (openPMD::IterationEncoding ie, const std::string &filetype, const std::string &operator_type, const std::map< std::string, std::string > &operator_parameters, const std::string &engine_type, const std::map< std::string, std::string > &engine_parameters, const std::vector< bool > &fieldPMLdirections, const std::string &authors) |
|
| ~WarpXOpenPMDPlot () |
|
| WarpXOpenPMDPlot (WarpXOpenPMDPlot const &)=delete |
|
WarpXOpenPMDPlot & | operator= (WarpXOpenPMDPlot const &)=delete |
|
| WarpXOpenPMDPlot (WarpXOpenPMDPlot &&)=default |
|
WarpXOpenPMDPlot & | operator= (WarpXOpenPMDPlot &&)=default |
|
void | SetStep (int ts, const std::string &dirPrefix, int file_min_digits, bool isBTD=false) |
|
void | CloseStep (bool isBTD=false, bool isLastBTDFlush=false) |
|
void | WriteOpenPMDParticles (const amrex::Vector< ParticleDiag > &particle_diags, amrex::Real time, bool use_pinned_pc=false, bool isBTD=false, bool isLastBTDFlush=false) |
|
void | WriteOpenPMDFieldsAll (const std::vector< std::string > &varnames, const amrex::Vector< amrex::MultiFab > &mf, amrex::Vector< amrex::Geometry > &geom, int output_levels, int iteration, double time, bool isBTD=false, const amrex::Geometry &full_BTD_snapshot=amrex::Geometry()) const |
|
std::string | OpenPMDFileType () |
|
|
void | Init (openPMD::Access access, bool isBTD) |
|
openPMD::Iteration | GetIteration (int const iteration, bool const isBTD) const |
|
void | SetupFields (openPMD::Container< openPMD::Mesh > &meshes, amrex::Geometry &full_geom) const |
|
void | SetupMeshComp (openPMD::Mesh &mesh, amrex::Geometry const &full_geom, std::string const &comp_name, std::string const &field_name, amrex::MultiFab const &mf, bool var_in_theta_mode) const |
|
void | GetMeshCompNames (int meshLevel, const std::string &varname, std::string &field_name, std::string &comp_name, bool var_in_theta_mode) const |
|
void | SetupPos (openPMD::ParticleSpecies &currSpecies, const unsigned long long &np, bool isBTD=false) |
|
void | SetConstParticleRecordsEDPIC (openPMD::ParticleSpecies &currSpecies, const unsigned long long &np, amrex::ParticleReal charge, amrex::ParticleReal mass) |
|
void | SetupRealProperties (ParticleContainer const *pc, openPMD::ParticleSpecies &currSpecies, const amrex::Vector< int > &write_real_comp, const amrex::Vector< std::string > &real_comp_names, const amrex::Vector< int > &write_int_comp, const amrex::Vector< std::string > &int_comp_names, unsigned long long np, bool isBTD=false) const |
|
void | SaveRealProperty (ParticleIter &pti, openPMD::ParticleSpecies &currSpecies, unsigned long long offset, const amrex::Vector< int > &write_real_comp, const amrex::Vector< std::string > &real_comp_names, const amrex::Vector< int > &write_int_comp, const amrex::Vector< std::string > &int_comp_names) const |
|
void | DumpToFile (ParticleContainer *pc, const std::string &name, int iteration, const amrex::Vector< int > &write_real_comp, const amrex::Vector< int > &write_int_comp, const amrex::Vector< std::string > &real_comp_names, const amrex::Vector< std::string > &int_comp_names, amrex::ParticleReal charge, amrex::ParticleReal mass, bool isBTD=false, bool isLastBTDFlush=false) |
|
std::string | GetFileName (std::string &filepath) |
|
Writer logic for openPMD particles and fields
◆ ParticleContainer
◆ ParticleIter
◆ WarpXOpenPMDPlot() [1/3]
WarpXOpenPMDPlot::WarpXOpenPMDPlot |
( |
openPMD::IterationEncoding |
ie, |
|
|
const std::string & |
filetype, |
|
|
const std::string & |
operator_type, |
|
|
const std::map< std::string, std::string > & |
operator_parameters, |
|
|
const std::string & |
engine_type, |
|
|
const std::map< std::string, std::string > & |
engine_parameters, |
|
|
const std::vector< bool > & |
fieldPMLdirections, |
|
|
const std::string & |
authors |
|
) |
| |
Initialize openPMD I/O routines
- Parameters
-
ie | iteration encoding from openPMD: "group, file, variable" |
filetype | file backend, e.g. "bp" or "h5" |
operator_type | openPMD-api backend operator (compressor) for ADIOS2 |
operator_parameters | openPMD-api backend operator parameters for ADIOS2 |
engine_type | ADIOS engine for output |
engine_parameters | map of parameters for the engine |
fieldPMLdirections | PML field solver, |
- See also
- WarpX::getPMLdirections()
- Parameters
-
authors | a string specifying the authors of the simulation (can be empty) |
◆ ~WarpXOpenPMDPlot()
WarpXOpenPMDPlot::~WarpXOpenPMDPlot |
( |
| ) |
|
◆ WarpXOpenPMDPlot() [2/3]
◆ WarpXOpenPMDPlot() [3/3]
◆ CloseStep()
void WarpXOpenPMDPlot::CloseStep |
( |
bool |
isBTD = false , |
|
|
bool |
isLastBTDFlush = false |
|
) |
| |
Close the step
Signal that no further updates will be written for the step.
◆ DumpToFile()
void WarpXOpenPMDPlot::DumpToFile |
( |
ParticleContainer * |
pc, |
|
|
const std::string & |
name, |
|
|
int |
iteration, |
|
|
const amrex::Vector< int > & |
write_real_comp, |
|
|
const amrex::Vector< int > & |
write_int_comp, |
|
|
const amrex::Vector< std::string > & |
real_comp_names, |
|
|
const amrex::Vector< std::string > & |
int_comp_names, |
|
|
amrex::ParticleReal |
charge, |
|
|
amrex::ParticleReal |
mass, |
|
|
bool |
isBTD = false , |
|
|
bool |
isLastBTDFlush = false |
|
) |
| |
|
private |
This function saves the plot file
- Parameters
-
[in] | pc | WarpX particle container |
[in] | name | species name |
[in] | iteration | timestep |
[in] | write_real_comp | The real attribute ids, from WarpX |
[in] | real_comp_names | The real attribute names, from WarpX |
[in] | write_int_comp | The int attribute ids, from WarpX |
[in] | int_comp_names | The int attribute names, from WarpX |
[in] | charge | Charge of the particles (note: fix for ions) |
[in] | mass | Mass of the particles |
[in,out] | ParticleFlushOffset | previously flushed number of particles in BTD |
[in] | isBTD | is this a backtransformed diagnostics (BTD) write? |
[in] | isLastBTDFlush | is this the last time we will flush this BTD station? |
◆ GetFileName()
std::string WarpXOpenPMDPlot::GetFileName |
( |
std::string & |
filepath | ) |
|
|
private |
Get the openPMD-api filename for openPMD::Series
No need for ts in the file name, openPMD handles steps (iterations).
- Parameters
-
[in,out] | filepath | the path and filename for openPMD::Series passes a prefix path in and appends the filename |
- Returns
- pure filename w/o path
◆ GetIteration()
Get the openPMD::Iteration object of the current Series
We use this helper function to differentiate between efficient, temporally sequentially increasing writes to iteration numbers and random-access writes to iterations, e.g., as needed for back-transformed diagnostics.
- Parameters
-
[in] | iteration | iteration number (lab-frame for BTD) |
[in] | isBTD | is this a backtransformed diagnostics write? |
- Returns
- the iteration object
◆ GetMeshCompNames()
void WarpXOpenPMDPlot::GetMeshCompNames |
( |
int |
meshLevel, |
|
|
const std::string & |
varname, |
|
|
std::string & |
field_name, |
|
|
std::string & |
comp_name, |
|
|
bool |
var_in_theta_mode |
|
) |
| const |
|
private |
Get Component Names from WarpX name
Get component names of a field for openPMD-api book-keeping Level is reflected as _lvl<meshLevel>
- Parameters
-
[in] | meshLevel | level of mesh |
[in] | varname | name from WarpX |
[out] | field_name | field name for openPMD-api output |
[in] | comp_name | comp name for openPMD-api output |
[in] | var_in_theta_mode | indicate if this field will be output with theta modes (instead of a reconstructed 2D slice) |
◆ Init()
◆ OpenPMDFileType()
std::string WarpXOpenPMDPlot::OpenPMDFileType |
( |
| ) |
|
|
inline |
Return OpenPMD File type ("bp" or "h5" or "json")
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ SaveRealProperty()
This function saves the values of the entries for particle properties
- Parameters
-
[in] | pti | WarpX particle iterator |
[in] | currSpecies | The openPMD species to save to |
[in] | offset | offset to start saving the particle iterator contents |
[in] | write_real_comp | The real attribute ids, from WarpX |
[in] | real_comp_names | The real attribute names, from WarpX |
[in] | write_int_comp | The int attribute ids, from WarpX |
[in] | int_comp_names | The int attribute names, from WarpX |
◆ SetConstParticleRecordsEDPIC()
void WarpXOpenPMDPlot::SetConstParticleRecordsEDPIC |
( |
openPMD::ParticleSpecies & |
currSpecies, |
|
|
const unsigned long long & |
np, |
|
|
amrex::ParticleReal |
charge, |
|
|
amrex::ParticleReal |
mass |
|
) |
| |
|
private |
This function sets constant particle records and ED-PIC attributes.
Sets the entries for storing particle position offset, constant records (charge, mass) and ED-PIC attributes.
- Parameters
-
[in] | currSpecies | Corresponding openPMD species |
[in] | np | Number of particles |
[in] | charge | Charge of the particles (note: fix for ions) |
[in] | mass | Mass of the particles |
◆ SetStep()
void WarpXOpenPMDPlot::SetStep |
( |
int |
ts, |
|
|
const std::string & |
dirPrefix, |
|
|
int |
file_min_digits, |
|
|
bool |
isBTD = false |
|
) |
| |
Set Iteration Step for the series
- Note
- If an iteration has been written, then it will give a warning
◆ SetupFields()
This function does initial setup for the fields when interation is newly created
- Parameters
-
[in] | meshes | The meshes in a series |
[in] | full_geom | The geometry |
◆ SetupMeshComp()
void WarpXOpenPMDPlot::SetupMeshComp |
( |
openPMD::Mesh & |
mesh, |
|
|
amrex::Geometry const & |
full_geom, |
|
|
std::string const & |
comp_name, |
|
|
std::string const & |
field_name, |
|
|
amrex::MultiFab const & |
mf, |
|
|
bool |
var_in_theta_mode |
|
) |
| const |
|
private |
◆ SetupPos()
void WarpXOpenPMDPlot::SetupPos |
( |
openPMD::ParticleSpecies & |
currSpecies, |
|
|
const unsigned long long & |
np, |
|
|
bool |
isBTD = false |
|
) |
| |
|
private |
This function sets up the entries for storing the particle positions and global IDs
- Parameters
-
[in] | currSpecies | Corresponding openPMD species |
[in] | np | Number of particles |
[in] | isBTD | Is this a back-transformed diagnostics output? |
◆ SetupRealProperties()
This function sets up the entries for particle properties
- Parameters
-
[in] | pc | The particle container of the species |
[in] | currSpecies | The openPMD species |
[in] | write_real_comp | The real attribute ids, from WarpX |
[in] | real_comp_names | The real attribute names, from WarpX |
[in] | write_int_comp | The int attribute ids, from WarpX |
[in] | int_comp_names | The int attribute names, from WarpX |
[in] | np | Number of particles |
[in] | isBTD | whether this is a back-transformed diagnostic |
◆ WriteOpenPMDFieldsAll()
Write out all openPMD fields for all active MR levels
- Parameters
-
varnames | variable names in each multifab |
mf | multifab for each level |
geom | for each level |
output_levels | the finest level to output, <= maxLevel |
iteration | the current iteration or reconstructed labframe station number |
time | the current simulation time in the lab frame |
isBTD | true if this is part of a back-transformed diagnostics (BTD) station flush; in BTD, we write multiple times to the same iteration |
full_BTD_snapshot | the geometry of the full lab frame for BTD |
Write Field with all mesh levels
◆ WriteOpenPMDParticles()
void WarpXOpenPMDPlot::WriteOpenPMDParticles |
( |
const amrex::Vector< ParticleDiag > & |
particle_diags, |
|
|
amrex::Real |
time, |
|
|
bool |
use_pinned_pc = false , |
|
|
bool |
isBTD = false , |
|
|
bool |
isLastBTDFlush = false |
|
) |
| |
◆ m_authors
std::string WarpXOpenPMDPlot::m_authors |
|
private |
◆ m_CurrentStep
int WarpXOpenPMDPlot::m_CurrentStep = -1 |
|
private |
◆ m_dirPrefix
std::string WarpXOpenPMDPlot::m_dirPrefix |
|
private |
This is the output directory
This usually does not yet end in a /
. It does not yet include the file prefix of the openPMD series, which will be appended by the GetFileName function.
◆ m_Encoding
◆ m_fieldPMLdirections
std::vector< bool > WarpXOpenPMDPlot::m_fieldPMLdirections |
|
private |
◆ m_file_min_digits
int WarpXOpenPMDPlot::m_file_min_digits |
|
private |
This is the minimum number of digits in the step number that is used as the suffix for file names when doing file based encoding
◆ m_MPIRank
int WarpXOpenPMDPlot::m_MPIRank = 0 |
|
private |
◆ m_MPISize
int WarpXOpenPMDPlot::m_MPISize = 1 |
|
private |
◆ m_OpenPMDFileType
std::string WarpXOpenPMDPlot::m_OpenPMDFileType = "bp" |
|
private |
◆ m_OpenPMDoptions
std::string WarpXOpenPMDPlot::m_OpenPMDoptions = "{}" |
|
private |
MPI-parallel openPMD backend: bp or h5.
◆ m_Series
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/warpx/checkouts/latest/Source/Diagnostics/WarpXOpenPMD.H
- /home/docs/checkouts/readthedocs.org/user_builds/warpx/checkouts/latest/Source/Diagnostics/WarpXOpenPMD.cpp