Skip to content

Commit 344f2b3

Browse files
authored
Merge pull request #70 from ECP-WarpX/hdf5_io
HDF5 IO for the Boosted Frame Diagnostics
2 parents 0605ce2 + 96a9672 commit 344f2b3

File tree

5 files changed

+845
-26
lines changed

5 files changed

+845
-26
lines changed

Source/Diagnostics/BoostedFrameDiagnostic.H

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <AMReX_VisMF.H>
77
#include <AMReX_PlotFileUtil.H>
88
#include <AMReX_ParallelDescriptor.H>
9+
#include <AMReX_Geometry.H>
910

1011
#include "MultiParticleContainer.H"
1112
#include "WarpXConst.H"
@@ -36,9 +37,13 @@ class BoostedFrameDiagnostic {
3637
amrex::Real current_z_lab;
3738
amrex::Real current_z_boost;
3839
int file_num;
40+
int initial_i;
41+
const BoostedFrameDiagnostic& my_bfd;
3942

40-
LabSnapShot(amrex::Real t_lab_in, amrex::Real zmin_lab_in,
41-
amrex::Real zmax_lab_in, int file_num_in);
43+
LabSnapShot(amrex::Real t_lab_in, amrex::Real t_boost,
44+
amrex::Real zmin_lab_in,
45+
amrex::Real zmax_lab_in, int file_num_in,
46+
const BoostedFrameDiagnostic& bfd);
4247

4348
///
4449
/// This snapshot is at time t_lab, and the simulation is at time t_boost.
@@ -64,11 +69,13 @@ class BoostedFrameDiagnostic {
6469
amrex::Real dt_snapshots_lab_;
6570
amrex::Real dt_boost_;
6671
int N_snapshots_;
67-
int Nz_lab_;
72+
unsigned Nx_lab_;
73+
unsigned Ny_lab_;
74+
unsigned Nz_lab_;
6875
int boost_direction_;
6976

7077
amrex::Vector<std::unique_ptr<amrex::MultiFab> > data_buffer_;
71-
amrex::Vector<amrex::Vector<WarpXParticleContainer::DiagnosticParticleData> > particles_buffer_;
78+
amrex::Vector<amrex::Vector<WarpXParticleContainer::DiagnosticParticleData> > particles_buffer_;
7279
int num_buffer_ = 256;
7380
int max_box_size_ = 256;
7481
amrex::Vector<int> buff_counter_;
@@ -77,13 +84,18 @@ class BoostedFrameDiagnostic {
7784

7885
void writeParticleData(const WarpXParticleContainer::DiagnosticParticleData& pdata,
7986
const std::string& name, const int i_lab);
80-
81-
public:
8287

88+
#ifdef WARPX_USE_HDF5
89+
void writeParticleDataHDF5(const WarpXParticleContainer::DiagnosticParticleData& pdata,
90+
const std::string& name, const std::string& species_name);
91+
#endif
92+
public:
93+
8394
BoostedFrameDiagnostic(amrex::Real zmin_lab, amrex::Real zmax_lab,
8495
amrex::Real v_window_lab, amrex::Real dt_snapshots_lab,
8596
int N_snapshots, amrex::Real gamma_boost,
86-
amrex::Real t_boost, amrex::Real dt_boost, int boost_direction);
97+
amrex::Real t_boost, amrex::Real dt_boost, int boost_direction,
98+
const amrex::Geometry& geom);
8799

88100
void Flush(const amrex::Geometry& geom);
89101

0 commit comments

Comments
 (0)