WarpX
BTDiagnostics.H
Go to the documentation of this file.
1 #ifndef WARPX_BTDIAGNOSTICS_H_
2 #define WARPX_BTDIAGNOSTICS_H_
3 
4 #include "Diagnostics.H"
5 
6 class
7 BTDiagnostics final : public Diagnostics
8 {
9 public:
10 
11  BTDiagnostics (int i, std::string name);
12 
13 private:
15  void ReadParameters ();
23  void Flush (int i_buffer) override;
31  bool DoDump (int step, int i_buffer, bool force_flush=false) override;
39  bool DoComputeAndPack (int step, bool force_flush=false) override;
41  void DerivedInitData () override;
48  void InitializeFieldFunctors (int lev) override;
53  void InitializeParticleBuffer () override {}
61  void PrepareFieldDataForOutput () override;
62 
70  bool GetZSliceInDomainFlag (const int i_buffer, const int lev);
71 
77  void InitializeFieldBufferData ( int i_buffer , int lev) override;
81  bool m_do_back_transformed_fields = true;
85  bool m_do_back_transformed_particles = true;
86 
94  amrex::Real m_gamma_boost;
95  amrex::Real m_beta_boost;
101 
103  int m_num_snapshots_lab = std::numeric_limits<int>::lowest();
105  amrex::Real m_dt_snapshots_lab = std::numeric_limits<amrex::Real>::lowest();
109  amrex::Real m_dz_snapshots_lab = 0.0;
110 
112  int m_buffer_size = 256;
114  int m_max_box_size = 256;
115 
117  amrex::Vector<amrex::Real> m_t_lab;
120  amrex::Vector<amrex::RealBox> m_prob_domain_lab;
123  amrex::Vector<amrex::RealBox> m_buffer_domain_lab;
125  amrex::Vector<amrex::IntVect> m_buffer_ncells_lab;
128  amrex::Vector<amrex::Box> m_buffer_box;
131  amrex::Vector<amrex::Real> m_current_z_lab;
134  amrex::Vector<amrex::Real> m_current_z_boost;
141  amrex::Vector<int> m_buffer_counter;
148  amrex::Vector<std::unique_ptr<amrex::MultiFab> > m_cell_centered_data;
154  std::vector<std::string> m_file_name;
158  amrex::Vector< amrex::Vector <std::unique_ptr<ComputeDiagFunctor const> > > m_cell_center_functors;
159 
161  void TMP_writeMetaData ();
168  void TMP_createLabFrameDirectories (int i_buffer, int lev);
173  void TMP_writeLabFrameHeader (int i_buffer);
178  void TMP_FlushLabFrameData ( int i_buffer );
184  void DefineCellCenteredMultiFab(int lev);
191  void DefineFieldBufferMultiFab (const int i_buffer, const int lev);
196  amrex::Real UpdateCurrentZBoostCoordinate(amrex::Real t_lab, amrex::Real t_boost)
197  {
198  amrex::Real current_z_boost = (t_lab / m_gamma_boost - t_boost) * PhysConst::c / m_beta_boost;
199  return current_z_boost;
200  }
205  amrex::Real UpdateCurrentZLabCoordinate(amrex::Real t_lab, amrex::Real t_boost)
206  {
207  amrex::Real current_z_lab = (t_lab - t_boost / m_gamma_boost ) * PhysConst::c / m_beta_boost;
208  return current_z_lab;
209  }
214  amrex::Real dz_lab (amrex::Real dt, amrex::Real ref_ratio);
220  int k_index_zlab (int i_buffer, int lev);
226  bool buffer_full (int i_buffer) {
227  return ( m_buffer_counter[i_buffer] == m_buffer_size );
228  }
229 
234  bool buffer_empty (int i_buffer) {
235  return ( m_buffer_counter[i_buffer] == 0) ;
236  }
237 
241  void ResetBufferCounter(int i_buffer) {
242  m_buffer_counter[i_buffer] = 0;
243  }
248  amrex::Vector< std::string > m_cellcenter_varnames = {"Ex", "Ey", "Ez",
249  "Bx", "By", "Bz",
250  "jx", "jy", "jz", "rho"};
251 
252 };
253 
254 #endif // WARPX_BTDIAGNOSTICS_H_
void ResetBufferCounter(int i_buffer)
Definition: BTDiagnostics.H:241
amrex::Vector< amrex::RealBox > m_prob_domain_lab
Definition: BTDiagnostics.H:120
void InitializeParticleBuffer() override
Definition: BTDiagnostics.H:53
amrex::Vector< int > m_buffer_counter
Definition: BTDiagnostics.H:141
int m_moving_window_dir
Definition: BTDiagnostics.H:100
amrex::Vector< amrex::Real > m_current_z_boost
Definition: BTDiagnostics.H:134
amrex::Vector< amrex::Real > m_t_lab
Definition: BTDiagnostics.H:117
amrex::Vector< amrex::RealBox > m_buffer_domain_lab
Definition: BTDiagnostics.H:123
amrex::Real UpdateCurrentZBoostCoordinate(amrex::Real t_lab, amrex::Real t_boost)
Definition: BTDiagnostics.H:196
amrex::Vector< amrex::Real > m_current_z_lab
Definition: BTDiagnostics.H:131
i
Definition: check_interp_points_and_weights.py:171
amrex::Vector< amrex::Vector< std::unique_ptr< ComputeDiagFunctor const > > > m_cell_center_functors
Definition: BTDiagnostics.H:158
amrex::Vector< amrex::IntVect > m_buffer_ncells_lab
Definition: BTDiagnostics.H:125
name
Definition: run_automated.py:204
amrex::Real m_gamma_boost
Definition: BTDiagnostics.H:94
amrex::Vector< amrex::Box > m_buffer_box
Definition: BTDiagnostics.H:128
bool buffer_full(int i_buffer)
Definition: BTDiagnostics.H:226
amrex::Real UpdateCurrentZLabCoordinate(amrex::Real t_lab, amrex::Real t_boost)
Definition: BTDiagnostics.H:205
bool buffer_empty(int i_buffer)
Definition: BTDiagnostics.H:234
amrex::Vector< std::unique_ptr< amrex::MultiFab > > m_cell_centered_data
Definition: BTDiagnostics.H:148
Definition: BTDiagnostics.H:6
amrex::Real m_beta_boost
Definition: BTDiagnostics.H:95
std::vector< std::string > m_file_name
Definition: BTDiagnostics.H:154
base class for diagnostics. Contains main routines to filter, compute and flush diagnostics.
Definition: Diagnostics.H:17