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
61 Envelope &
63 {
64 m_beam_intensity = intensity;
65
66 return *this;
67 }
68
75 {
76 return m_beam_intensity;
77 }
78
83 Envelope &
90
95 {
96 return m_env;
97 }
98
99 };
100
101
102} // namespace impactx::distribution
103
104#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:74
CovarianceMatrix m_env
the 6x6 beam covariance matrix
Definition CovarianceMatrix.H:54
Envelope & set_beam_intensity(amrex::ParticleReal const intensity)
Definition CovarianceMatrix.H:62
Envelope & set_covariance_matrix(CovarianceMatrix const &covariance_matrix)
Definition CovarianceMatrix.H:84
CovarianceMatrix covariance_matrix() const
Definition CovarianceMatrix.H:94