aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Docs/source/usage/parameters.rst41
-rw-r--r--Source/Diagnostics/ReducedDiags/BeamRelevant.cpp20
2 files changed, 38 insertions, 23 deletions
diff --git a/Docs/source/usage/parameters.rst b/Docs/source/usage/parameters.rst
index 6d293b52f..bf6772ee2 100644
--- a/Docs/source/usage/parameters.rst
+++ b/Docs/source/usage/parameters.rst
@@ -2454,39 +2454,42 @@ Reduced Diagnostics
sum of the particles' weight of each species.
* ``BeamRelevant``
- This type computes properties of a particle beam relevant for particle accelerators,
- like position, momentum, emittance, etc.
+ This type computes properties of a particle beam relevant for particle accelerators, like position, momentum, emittance, etc.
- ``<reduced_diags_name>.species`` must be provided,
- such that the diagnostics are done for this (beam-like) species only.
+ ``<reduced_diags_name>.species`` must be provided, such that the diagnostics are done for this (beam-like) species only.
+
+ The output columns (for 3D-XYZ) are the following, where the average is done over the whole species (typical usage: the particle beam is in a separate species):
+
+ [0]: simulation step (iteration).
- The output columns (for 3D-XYZ) are the following, where the average is done over
- the whole species (typical usage: the particle beam is in a separate species):
+ [1]: time (s).
- [1], [2], [3]: The mean values of beam positions (m)
- :math:`\langle x \rangle`, :math:`\langle y \rangle`,
+ [2], [3], [4]: The mean values of beam positions (m)
+ :math:`\langle x \rangle`,
+ :math:`\langle y \rangle`,
:math:`\langle z \rangle`.
- [4], [5], [6]: The mean values of beam relativistic momenta (kg m/s)
- :math:`\langle p_x \rangle`, :math:`\langle p_y \rangle`,
+ [5], [6], [7]: The mean values of beam relativistic momenta (kg m/s)
+ :math:`\langle p_x \rangle`,
+ :math:`\langle p_y \rangle`,
:math:`\langle p_z \rangle`.
- [7]: The mean Lorentz factor :math:`\langle \gamma \rangle`.
+ [8]: The mean Lorentz factor :math:`\langle \gamma \rangle`.
- [8], [9], [10]: The RMS values of beam positions (m)
+ [9], [10], [11]: The RMS values of beam positions (m)
:math:`\delta_x = \sqrt{ \langle (x - \langle x \rangle)^2 \rangle }`,
:math:`\delta_y = \sqrt{ \langle (y - \langle y \rangle)^2 \rangle }`,
:math:`\delta_z = \sqrt{ \langle (z - \langle z \rangle)^2 \rangle }`.
- [11], [12], [13]: The RMS values of beam relativistic momenta (kg m/s)
+ [12], [13], [14]: The RMS values of beam relativistic momenta (kg m/s)
:math:`\delta_{px} = \sqrt{ \langle (p_x - \langle p_x \rangle)^2 \rangle }`,
:math:`\delta_{py} = \sqrt{ \langle (p_y - \langle p_y \rangle)^2 \rangle }`,
:math:`\delta_{pz} = \sqrt{ \langle (p_z - \langle p_z \rangle)^2 \rangle }`.
- [14]: The RMS value of the Lorentz factor
+ [15]: The RMS value of the Lorentz factor
:math:`\sqrt{ \langle (\gamma - \langle \gamma \rangle)^2 \rangle }`.
- [15], [16], [17]: beam projected transverse RMS normalized emittance (m)
+ [16], [17], [18]: beam projected transverse RMS normalized emittance (m)
:math:`\epsilon_x = \dfrac{1}{mc} \sqrt{\delta_x^2 \delta_{px}^2 -
\Big\langle (x-\langle x \rangle) (p_x-\langle p_x \rangle) \Big\rangle^2}`,
:math:`\epsilon_y = \dfrac{1}{mc} \sqrt{\delta_y^2 \delta_{py}^2 -
@@ -2494,12 +2497,16 @@ Reduced Diagnostics
:math:`\epsilon_z = \dfrac{1}{mc} \sqrt{\delta_z^2 \delta_{pz}^2 -
\Big\langle (z-\langle z \rangle) (p_z-\langle p_z \rangle) \Big\rangle^2}`.
- [18]: The charge of the beam (C).
+ [19], [20]: beta function for the transverse directions (m)
+ :math:`\beta_x = \dfrac{{\delta_x}^2}{\epsilon_x}`,
+ :math:`\beta_y = \dfrac{{\delta_y}^2}{\epsilon_y}`.
+
+ [21]: The charge of the beam (C).
For 2D-XZ,
:math:`\langle y \rangle`,
:math:`\delta_y`, and
- :math:`\epsilon_y` will not be outputed.
+ :math:`\epsilon_y` will not be outputted.
* ``LoadBalanceCosts``
This type computes the cost, used in load balancing, for each box on the domain.
diff --git a/Source/Diagnostics/ReducedDiags/BeamRelevant.cpp b/Source/Diagnostics/ReducedDiags/BeamRelevant.cpp
index 03ce90ac3..4b4d404ba 100644
--- a/Source/Diagnostics/ReducedDiags/BeamRelevant.cpp
+++ b/Source/Diagnostics/ReducedDiags/BeamRelevant.cpp
@@ -48,8 +48,9 @@ BeamRelevant::BeamRelevant (std::string rd_name)
// 10,11,12: rms px,py,pz
// 13: rms gamma
// 14,15,16: emittance x,y,z
- // 17: charge
- m_data.resize(18, 0.0_rt);
+ // 17,18: beta-function x,y
+ // 19: charge
+ m_data.resize(20, 0.0_rt);
#elif (defined WARPX_DIM_XZ)
// 0, 1: mean x,z
// 2, 3, 4: mean px,py,pz
@@ -58,8 +59,9 @@ BeamRelevant::BeamRelevant (std::string rd_name)
// 8, 9,10: rms px,py,pz
// 11: rms gamma
// 12,13: emittance x,z
- // 14: charge
- m_data.resize(15, 0.0_rt);
+ // 14: beta-function x
+ // 15: charge
+ m_data.resize(16, 0.0_rt);
#elif (defined WARPX_DIM_1D_Z)
// 0 : mean z
// 1,2,3 : mean px,py,pz
@@ -101,6 +103,8 @@ BeamRelevant::BeamRelevant (std::string rd_name)
ofs << "[" << c++ << "]emittance_x(m)"; ofs << m_sep;
ofs << "[" << c++ << "]emittance_y(m)"; ofs << m_sep;
ofs << "[" << c++ << "]emittance_z(m)"; ofs << m_sep;
+ ofs << "[" << c++ << "]beta_x(m)"; ofs << m_sep;
+ ofs << "[" << c++ << "]beta_y(m)"; ofs << m_sep;
ofs << "[" << c++ << "]charge(C)"; ofs << std::endl;
#elif (defined WARPX_DIM_XZ)
int c = 0;
@@ -121,6 +125,7 @@ BeamRelevant::BeamRelevant (std::string rd_name)
ofs << "[" << c++ << "]gamma_rms()"; ofs << m_sep;
ofs << "[" << c++ << "]emittance_x(m)"; ofs << m_sep;
ofs << "[" << c++ << "]emittance_z(m)"; ofs << m_sep;
+ ofs << "[" << c++ << "]beta_x(m)"; ofs << m_sep;
ofs << "[" << c++ << "]charge(C)"; ofs << std::endl;
#elif (defined WARPX_DIM_1D_Z)
int c = 0;
@@ -369,7 +374,9 @@ void BeamRelevant::ComputeDiags (int step)
m_data[14] = std::sqrt(x_ms*ux_ms-xux*xux) / PhysConst::c;
m_data[15] = std::sqrt(y_ms*uy_ms-yuy*yuy) / PhysConst::c;
m_data[16] = std::sqrt(z_ms*uz_ms-zuz*zuz) / PhysConst::c;
- m_data[17] = charge;
+ m_data[17] = (PhysConst::c * x_ms) / std::sqrt(x_ms*ux_ms-xux*xux);
+ m_data[18] = (PhysConst::c * y_ms) / std::sqrt(y_ms*uy_ms-yuy*yuy);
+ m_data[19] = charge;
#elif (defined WARPX_DIM_XZ)
m_data[0] = x_mean;
m_data[1] = z_mean;
@@ -385,7 +392,8 @@ void BeamRelevant::ComputeDiags (int step)
m_data[11] = std::sqrt(gm_ms);
m_data[12] = std::sqrt(x_ms*ux_ms-xux*xux) / PhysConst::c;
m_data[13] = std::sqrt(z_ms*uz_ms-zuz*zuz) / PhysConst::c;
- m_data[14] = charge;
+ m_data[14] = (PhysConst::c * x_ms) / std::sqrt(x_ms*ux_ms-xux*xux);
+ m_data[15] = charge;
amrex::ignore_unused(y_mean, y_ms, yuy);
#elif (defined WARPX_DIM_1D_Z)
m_data[0] = z_mean;