ImpactX
Loading...
Searching...
No Matches
CovarianceMatrix.H
Go to the documentation of this file.
1/* Copyright 2022-2024 The Regents of the University of California, through Lawrence
2 * Berkeley National Laboratory (subject to receipt of any required
3 * approvals from the U.S. Dept. of Energy). All rights reserved.
4 *
5 * This file is part of ImpactX.
6 *
7 * Authors: Chad Mitchell, Axel Huebl
8 * License: BSD-3-Clause-LBNL
9 */
10#ifndef IMPACTX_DISTRIBUTION_COVARIANCE_MATRIX_H
11#define IMPACTX_DISTRIBUTION_COVARIANCE_MATRIX_H
12
13#include <AMReX_REAL.H>
14#include <AMReX_SmallMatrix.H>
15
16
17namespace impactx
18{
21
24
39 {
40 Map6x6 Omega = Map6x6::Zero();
41 for (int i = 0; i < 3; ++i) {
42 Omega(2*i+1, 2*i+2) = 1;
43 Omega(2*i+2, 2*i+1) = -1;
44 }
45 return Omega;
46 }
47
48
52 struct Envelope
53 {
56
57 Envelope () = default;
58
66
71 Envelope &
73 {
74 m_beam_intensity = intensity;
75
76 return *this;
77 }
78
85 {
86 return m_beam_intensity;
87 }
88
93 Envelope &
100
105 {
106 return m_env;
107 }
108
109 };
110
111
112} // namespace impactx::distribution
113
114#endif // IMPACTX_DISTRIBUTION_COVARIANCE_MATRIX_H
amrex_particle_real ParticleReal
Definition CovarianceMatrixMath.H:25
amrex::SmallMatrix< amrex::ParticleReal, 6, 6, amrex::Order::F, 1 > Map6x6
Definition CovarianceMatrix.H:20
Map6x6 symplectic_form()
Definition CovarianceMatrix.H:38
Map6x6 CovarianceMatrix
Definition CovarianceMatrix.H:23
static constexpr __host__ __device__ SmallMatrix< T, NRows, NCols, ORDER, StartIndex > Zero() noexcept
Definition CovarianceMatrix.H:53
amrex::ParticleReal m_beam_intensity
optional: charge in A (for 3D space charge) or current in A (for 2D space charge)
Definition CovarianceMatrix.H:55
amrex::ParticleReal beam_intensity() const
Definition CovarianceMatrix.H:84
Envelope()=default
CovarianceMatrix m_env
the 6x6 beam covariance matrix
Definition CovarianceMatrix.H:54
Envelope & set_beam_intensity(amrex::ParticleReal const intensity)
Definition CovarianceMatrix.H:72
Envelope & set_covariance_matrix(CovarianceMatrix const &covariance_matrix)
Definition CovarianceMatrix.H:94
Envelope(CovarianceMatrix const &env, amrex::ParticleReal const beam_intensity)
Definition CovarianceMatrix.H:59
CovarianceMatrix covariance_matrix() const
Definition CovarianceMatrix.H:104