ImpactX
Loading...
Searching...
No Matches
impactx::diagnostics Namespace Reference

Classes

struct  NonlinearLensInvariants
 

Functions

std::tuple< amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal > CubicRootsTrig (amrex::ParticleReal a, amrex::ParticleReal b, amrex::ParticleReal c, amrex::ParticleReal d)
 
std::tuple< amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal > CubicRootsAlg (amrex::ParticleReal a, amrex::ParticleReal b, amrex::ParticleReal c, amrex::ParticleReal d)
 
void DiagnosticOutput (ImpactXParticleContainer const &pc, std::string file_name, int step, bool append)
 
void DiagnosticOutput (Map6x6 const &cm, RefPart const &ref_part, std::string file_name, int step, bool append)
 
void DiagnosticOutput (RefPart const &ref_part, std::string file_name, int step, bool append)
 
std::tuple< amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal > KineticInvariants (amrex::SmallMatrix< amrex::ParticleReal, 6, 6, amrex::Order::F, 1 > const &Sigma)
 
std::tuple< amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal > Eigenemittances (amrex::SmallMatrix< amrex::ParticleReal, 6, 6, amrex::Order::F, 1 > const &Sigma)
 
std::unordered_map< std::string, amrex::ParticleReal > reduced_beam_characteristics (ImpactXParticleContainer const &pc)
 
std::unordered_map< std::string, amrex::ParticleReal > reduced_beam_characteristics (Map6x6 const &cm, RefPart const &ref_part)
 

Function Documentation

◆ CubicRootsAlg()

std::tuple< amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal > impactx::diagnostics::CubicRootsAlg ( amrex::ParticleReal a,
amrex::ParticleReal b,
amrex::ParticleReal c,
amrex::ParticleReal d )

Function to return the roots of a cubic polynomial ax^3 + bx^2 + cx + d. The algebraic form of Cardano's formula is used. This implementation expects three real roots, which is verified by checking the sign of the discriminant.

Parameters
[in]acoefficient of cubic term
[in]bcoefficient of quadratic term
[in]ccoefficient of linear term
[in]dcoefficient of constant term
Returns
tuple of three real roots

◆ CubicRootsTrig()

std::tuple< amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal > impactx::diagnostics::CubicRootsTrig ( amrex::ParticleReal a,
amrex::ParticleReal b,
amrex::ParticleReal c,
amrex::ParticleReal d )

Function to return the roots of a cubic polynomial ax^3 + bx^2 + cx + d. The trigonometric form of Cardano's formula is used. This implementation expects three real roots, which is verified by checking the sign of the discriminant.

Parameters
[in]acoefficient of cubic term
[in]bcoefficient of quadratic term
[in]ccoefficient of linear term
[in]dcoefficient of constant term
Returns
tuple of three real roots

◆ DiagnosticOutput() [1/3]

void impactx::diagnostics::DiagnosticOutput ( ImpactXParticleContainer const & pc,
std::string file_name,
int step = 0,
bool append = false )

ASCII output diagnostics associated with the beam particles.

This prints reduced beam characteristics derived from particles in ASCII.

Parameters
pccontainer of the particles use for diagnostics
file_namethe file name to write to
stepthe global step
appendopen a new file with a fresh header (false) or append data to an existing file (true)

◆ DiagnosticOutput() [2/3]

void impactx::diagnostics::DiagnosticOutput ( Map6x6 const & cm,
RefPart const & ref_part,
std::string file_name,
int step = 0,
bool append = false )

ASCII output diagnostics associated with the covariance matrix.

This prints reduced beam characteristics derived from the envelope description in ASCII.

Parameters
cmcovariance matrix
ref_partreference particle
file_namethe file name to write to
stepthe global step
appendopen a new file with a fresh header (false) or append data to an existing file (true)

◆ DiagnosticOutput() [3/3]

void impactx::diagnostics::DiagnosticOutput ( RefPart const & ref_part,
std::string file_name,
int step = 0,
bool append = false )

ASCII output diagnostics associated with the reference particle.

This prints reference particle properties in ASCII.

Parameters
ref_partreference particle
file_namethe file name to write to
stepthe global step
appendopen a new file with a fresh header (false) or append data to an existing file (true)

◆ Eigenemittances()

std::tuple< amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal > impactx::diagnostics::Eigenemittances ( amrex::SmallMatrix< amrex::ParticleReal, 6, 6, amrex::Order::F, 1 > const & Sigma)

This function returns the three eigenemittances denoted e1, e2, and e3 as constructed from the 6x6 beam covariance matrix. These three quantities are invariant under any linear symplectic transport map, and reduce to the projected normalized rms emittances in the limit of uncoupled transport.

input - Sigma symmetric 6x6 covariance matrix returns - tuple containing eigenemittances e1, e2, and e3

Returns the three eigenemittances denoted e1, e2, and e3 as constructed from the 6x6 beam covariance matrix. These three quantities are invariant under any linear symplectic transport map, and reduce to the projected normalized rms emittances in the limit of uncoupled transport. These quantities are described in:

G. Rangarajan, F. Neri, and A. Dragt, "Generalized Emittance Invariants," in Proc. 1989 IEEE Part. Accel. Conf., Chicago, IL, 1989, doi:10.1109/PAC.1989.73422. A. Dragt, F. Neri, and G. Rangarajan, "General Moment Invariants for Linear Hamiltonian Systems," Phys. Rev. A 45, 2572-2585 (1992), doi:10.1103/PhysRevA.45.2572.

Parameters
[in]Sigmasymmetric 6x6 covariance matrix
Returns
tuple containing eigenemittances e1, e2, and e3

◆ KineticInvariants()

std::tuple< amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal > impactx::diagnostics::KineticInvariants ( amrex::SmallMatrix< amrex::ParticleReal, 6, 6, amrex::Order::F, 1 > const & Sigma)

This function returns the three independent kinetic invariants denoted I2, I4, and I6 as constructed from the 6x6 beam covariance matrix. These three quantities are invariant under any linear symplectic transport map, and are used in the calculation of the three eigenemittances.

input - Sigma symmetric 6x6 covariance matrix returns - tuple containing invariants I2, I4, and I6

Returns the three independent kinematic moment invariants denoted I2, I4, and I6 as constructed from the 6x6 beam covariance matrix. These three quantities are invariant under any linear symplectic transport map, and are used in the calculation of the three eigenemittances, as described in:

G. Rangarajan, F. Neri, and A. Dragt, "Generalized Emittance Invariants," in Proc. 1989 IEEE Part. Accel. Conf., Chicago, IL, 1989, doi:10.1109/PAC.1989.73422. A. Dragt, F. Neri, and G. Rangarajan, "General Moment Invariants for Linear Hamiltonian Systems," Phys. Rev. A 45, 2572-2585 (1992), doi:10.1103/PhysRevA.45.2572.

Parameters
[in]Sigmasymmetric 6x6 covariance matrix
Returns
tuple containing invariants I2, I4, and I6

◆ reduced_beam_characteristics() [1/2]

std::unordered_map< std::string, amrex::ParticleReal > impactx::diagnostics::reduced_beam_characteristics ( ImpactXParticleContainer const & pc)

Compute moments of the beam distribution from particle data

This uses an MPI Allreduce and returns a result on all ranks.

◆ reduced_beam_characteristics() [2/2]

std::unordered_map< std::string, amrex::ParticleReal > impactx::diagnostics::reduced_beam_characteristics ( Map6x6 const & cm,
RefPart const & ref_part )

Compute moments of the beam distribution from covariance matrix