7 #ifndef WARPX_BTDIAGNOSTICS_H_
8 #define WARPX_BTDIAGNOSTICS_H_
36 bool m_plot_raw_fields =
false;
38 bool m_plot_raw_fields_guards =
false;
40 void ReadParameters ();
50 void Flush (
int i_buffer,
bool force_flush)
override;
59 bool DoDump (
int step,
int i_buffer,
bool force_flush=
false)
override;
67 bool DoComputeAndPack (
int step,
bool force_flush=
false)
override;
69 void DerivedInitData ()
override;
76 void InitializeFieldFunctors (
int lev)
override;
83 void InitializeFieldFunctorsRZopenPMD (
int lev)
override;
95 void AddRZModesToOutputNames (
const std::string&
field,
int ncomp,
bool cellcenter_data);
100 void InitializeParticleBuffer ()
override;
104 void PrepareBufferData ()
override;
106 void UpdateBufferData ()
override;
114 void PrepareFieldDataForOutput ()
override;
116 void PrepareParticleDataForOutput()
override;
126 bool GetZSliceInDomainFlag (
int i_buffer,
int lev);
134 bool GetKIndexInSnapshotBoxFlag (
int i_buffer,
int lev);
141 void InitializeBufferData (
int i_buffer ,
int lev,
bool restart=
false)
override;
145 bool m_do_back_transformed_fields =
true;
149 bool m_do_back_transformed_particles =
true;
167 int m_num_snapshots_lab = std::numeric_limits<int>::lowest();
169 amrex::Real m_dt_snapshots_lab = std::numeric_limits<amrex::Real>::lowest();
173 amrex::Real m_dz_snapshots_lab = 0.0;
176 int m_buffer_size = 256;
258 void DefineCellCenteredMultiFab(
int lev);
265 void DefineFieldBufferMultiFab (
int i_buffer,
int lev);
273 void DefineSnapshotGeometry (
int i_buffer,
int lev);
281 const amrex::Real current_z_boost = (t_lab / m_gamma_boost - t_boost) *
PhysConst::c / m_beta_boost;
282 return current_z_boost;
290 const amrex::Real current_z_lab = (t_lab - t_boost / m_gamma_boost ) *
PhysConst::c / m_beta_boost;
291 return current_z_lab;
298 amrex::Real dz_lab (amrex::Real
dt, amrex::Real ref_ratio);
304 int k_index_zlab (
int i_buffer,
int lev);
311 return (k_index_zlab(i_buffer,0) == m_buffer_box[i_buffer].smallEnd(m_moving_window_dir));
319 return ( m_buffer_counter[i_buffer] == 0) ;
339 m_buffer_counter[i_buffer] = 0;
345 m_buffer_flush_counter[i_buffer]++;
352 void SetSnapshotFullStatus (
int i_buffer);
360 "jr",
"jt",
"jz",
"rho"};
368 "jx",
"jy",
"jz",
"rho"};
375 void MergeBuffersForPlotfile (
int i_snapshot);
379 void InterleaveBufferAndSnapshotHeader ( std::string buffer_Header,
380 std::string snapshot_Header);
384 void InterleaveFabArrayHeader( std::string Buffer_FabHeaderFilename,
385 std::string snapshot_FabHeaderFilename,
386 std::string newsnapshot_FabFilename);
390 void InterleaveSpeciesHeader(std::string buffer_species_Header_path,
391 std::string snapshot_species_Header_path,
392 std::string species_name,
int new_data_index);
397 void InterleaveParticleDataHeader( std::string buffer_ParticleHdrFilename,
398 std::string snapshot_ParticleHdrFilename);
401 void InitializeParticleFunctors ()
override;
404 void UpdateTotalParticlesFlushed(
int i_buffer);
406 void ResetTotalParticlesInBuffer(
int i_buffer);
408 void ClearParticleBuffer(
int i_buffer);
410 void RedistributeParticleBuffer (
int i_buffer);
411 void UpdateVarnamesForRZopenPMD();
413 amrex::Real
gettlab (
int i_buffer)
override {
return m_t_lab[i_buffer];}
414 void settlab (
int i_buffer, amrex::Real tlab)
override {m_t_lab[i_buffer] = tlab; }
420 void set_flush_counter ([[maybe_unused]]
int i_buffer,
int flush_counter)
override { m_buffer_flush_counter[i_buffer] = flush_counter; }
422 void set_last_valid_Zslice (
int i_buffer,
int last_valid_Zslice)
override { m_lastValidZSlice[i_buffer] = last_valid_Zslice; }
424 void set_snapshot_full (
int i_buffer,
int snapshot_full)
override { m_snapshot_full[i_buffer] = snapshot_full; }
Definition: BTDiagnostics.H:29
amrex::Real m_beta_boost
Definition: BTDiagnostics.H:159
int m_moving_window_dir
Definition: BTDiagnostics.H:164
amrex::Vector< std::unique_ptr< amrex::MultiFab > > m_cell_centered_data
Definition: BTDiagnostics.H:248
void IncrementBufferFlushCounter(int i_buffer)
Definition: BTDiagnostics.H:344
amrex::Real UpdateCurrentZLabCoordinate(amrex::Real t_lab, amrex::Real t_boost)
Definition: BTDiagnostics.H:288
amrex::Vector< amrex::RealBox > m_snapshot_domain_lab
Definition: BTDiagnostics.H:182
amrex::Vector< int > m_lastValidZSlice
Definition: BTDiagnostics.H:234
void set_last_valid_Zslice(int i_buffer, int last_valid_Zslice) override
Definition: BTDiagnostics.H:422
amrex::Vector< amrex::RealBox > m_buffer_domain_lab
Definition: BTDiagnostics.H:185
amrex::Vector< int > m_buffer_counter
Definition: BTDiagnostics.H:220
amrex::Vector< amrex::Real > m_old_z_boost
Definition: BTDiagnostics.H:202
void set_snapshot_full(int i_buffer, int snapshot_full) override
Definition: BTDiagnostics.H:424
amrex::Vector< int > m_snapshot_full
Definition: BTDiagnostics.H:229
int get_snapshot_full_flag(int i_buffer) override
Definition: BTDiagnostics.H:423
void NullifyFirstFlush(int i_buffer)
Definition: BTDiagnostics.H:328
amrex::Vector< amrex::Vector< std::unique_ptr< ComputeDiagFunctor const > > > m_cell_center_functors
Definition: BTDiagnostics.H:252
amrex::Real gettlab(int i_buffer) override
Definition: BTDiagnostics.H:413
utils::parser::BTDIntervalsParser m_intervals
Definition: BTDiagnostics.H:42
void settlab(int i_buffer, amrex::Real tlab) override
Definition: BTDiagnostics.H:414
amrex::Vector< amrex::Real > m_current_z_lab
Definition: BTDiagnostics.H:196
amrex::Real get_snapshot_domain_hi(int i_buffer, int idim) override
Definition: BTDiagnostics.H:418
bool buffer_full(int i_buffer)
Definition: BTDiagnostics.H:310
amrex::Vector< int > m_field_buffer_multifab_defined
Definition: BTDiagnostics.H:333
amrex::Vector< int > m_max_buffer_multifabs
Definition: BTDiagnostics.H:225
bool buffer_empty(int i_buffer)
Definition: BTDiagnostics.H:318
void set_buffer_k_index_hi(int i_buffer, int kindex) override
Definition: BTDiagnostics.H:416
amrex::Vector< int > m_buffer_flush_counter
Definition: BTDiagnostics.H:237
amrex::Vector< amrex::Box > m_buffer_box
Definition: BTDiagnostics.H:193
amrex::Vector< amrex::Real > m_current_z_boost
Definition: BTDiagnostics.H:199
amrex::Vector< int > m_buffer_k_index_hi
Definition: BTDiagnostics.H:241
amrex::Real m_gamma_boost
Definition: BTDiagnostics.H:158
amrex::Vector< amrex::IntVect > m_snapshot_ncells_lab
Definition: BTDiagnostics.H:187
amrex::Vector< amrex::Vector< amrex::Geometry > > m_geom_snapshot
Definition: BTDiagnostics.H:213
int get_last_valid_Zslice(int i_buffer) override
Definition: BTDiagnostics.H:421
amrex::Real get_snapshot_domain_lo(int i_buffer, int idim) override
Definition: BTDiagnostics.H:417
int get_flush_counter(int i_buffer) override
Definition: BTDiagnostics.H:419
void ResetBufferCounter(int i_buffer)
Definition: BTDiagnostics.H:338
amrex::Vector< int > m_first_flush_after_restart
Definition: BTDiagnostics.H:323
amrex::Vector< amrex::Box > m_snapshot_box
Definition: BTDiagnostics.H:190
amrex::Real UpdateCurrentZBoostCoordinate(amrex::Real t_lab, amrex::Real t_boost)
Definition: BTDiagnostics.H:279
amrex::Vector< amrex::Real > m_t_lab
Definition: BTDiagnostics.H:179
void set_flush_counter([[maybe_unused]] int i_buffer, int flush_counter) override
Definition: BTDiagnostics.H:420
int get_buffer_k_index_hi(int i_buffer) override
Definition: BTDiagnostics.H:415
amrex::Vector< int > m_snapshot_geometry_defined
Definition: BTDiagnostics.H:331
base class for diagnostics. Contains main routines to filter, compute and flush diagnostics.
Definition: Diagnostics.H:31
This class is a parser for multiple slices of the form x,y,z,... where x, y and z are slices of the f...
Definition: IntervalsParser.H:177
static constexpr auto c
vacuum speed of light [m/s]
Definition: constant.H:44
i
Definition: check_interp_points_and_weights.py:174
name
Definition: run_automated.py:229
float dt
Definition: stencil.py:442
string field
Definition: video_yt.py:31