WarpX
FieldProbe.H
Go to the documentation of this file.
1 /* Copyright 2021 Lorenzo Giacomel, Neil Zaim, Yinjian Zhao
2  * Elisa Rheaume, Axel Huebl
3  *
4  * This file is part of WarpX.
5  *
6  * License: BSD-3-Clause-LBNL
7  */
8 
9 #ifndef WARPX_DIAGNOSTICS_REDUCEDDIAGS_FIELDPROBE_H_
10 #define WARPX_DIAGNOSTICS_REDUCEDDIAGS_FIELDPROBE_H_
11 
12 #include "ReducedDiags.H"
14 
15 #include <AMReX.H>
16 #include <AMReX_Vector.H>
17 
18 #include <unordered_map>
19 #include <string>
20 #include <vector>
21 
25 enum struct DetectorGeometry
26 {
27  Point = 0,
28  Line,
29  Plane
30 };
31 
36 class FieldProbe : public ReducedDiags
37 {
38 public:
39 
44  FieldProbe (std::string rd_name);
45 
49  void InitData () override final;
50 
53  void LoadBalance () override final;
54 
60  void ComputeDiags (int step) override final;
61 
62  /*
63  * Define constants used throughout FieldProbe
64  */
65 
67  static constexpr int noutputs = FieldProbePIdx::nattribs + 3;
68 
69 private:
70  amrex::Real x_probe, y_probe, z_probe;
71  amrex::Real x1_probe, y1_probe, z1_probe;
72  amrex::Real target_normal_x, target_normal_y, target_normal_z;
73  amrex::Real target_up_x, target_up_y, target_up_z;
74  amrex::Real detector_radius;
75 
77  long m_valid_particles {0};
78 
80  int m_last_compute_step = 0;
81 
84 
86  int m_resolution = 0;
87 
90 
93 
96 
98  bool m_field_probe_integrate = false;
99 
101  int interp_order = 1;
102 
104  bool raw_fields = false;
105 
107  bool do_moving_window_FP = false;
108 
112  virtual void WriteToFile (int step) const override;
113 
116  bool ProbeInDomain () const;
117 };
118 
119 #endif // WARPX_DIAGNOSTICS_REDUCEDDIAGS_FIELDPROBE_H_
DetectorGeometry
Definition: FieldProbe.H:25
Definition: ReducedDiags.H:23
amrex::Vector< amrex::Real > m_data
Empty vector for to which data is pushed.
Definition: FieldProbe.H:89
Definition: FieldProbe.H:36
Definition: FieldProbeParticleContainer.H:30
amrex::Real target_up_z
Definition: FieldProbe.H:73
amrex::Real target_normal_z
Definition: FieldProbe.H:72
amrex::Real z_probe
Definition: FieldProbe.H:70
FieldProbeParticleContainer m_probe
this is the particle container in which probe particles are stored
Definition: FieldProbe.H:95
amrex::Vector< amrex::Real > m_data_out
Empty array to be used by IOProcessor node to store and output data.
Definition: FieldProbe.H:92
Definition: FieldProbeParticleContainer.H:39
amrex::Real z1_probe
Definition: FieldProbe.H:71
amrex::Real detector_radius
Definition: FieldProbe.H:74