WarpX
Toggle main menu visibility
Loading...
Searching...
No Matches
Source
AcceleratorLattice
AcceleratorLattice.H
Go to the documentation of this file.
1
/* Copyright 2022 David Grote
2
*
3
* This file is part of WarpX.
4
*
5
* License: BSD-3-Clause-LBNL
6
*/
7
#ifndef WARPX_ACCELERATORLATTICE_ACCELERATORLATTICE_H_
8
#define WARPX_ACCELERATORLATTICE_ACCELERATORLATTICE_H_
9
10
#include "
LatticeElementFinder.H
"
11
#include "
LatticeElements/Drift.H
"
12
#include "
LatticeElements/HardEdgedQuadrupole.H
"
13
#include "
LatticeElements/HardEdgedPlasmaLens.H
"
14
15
#include <memory>
16
#include <string>
17
18
/* \brief AcceleratorLattice contains the lattice elements
19
*/
20
class
AcceleratorLattice
21
{
22
public
:
23
24
AcceleratorLattice
();
25
32
void
33
ReadLattice
(std::string
const
& root_name,
amrex::ParticleReal
& z_location);
34
35
/* Refinement level at which this accelerator lattice is defined */
36
int
m_level
;
37
38
/* Flags where any lattice elements have been specified by the user */
39
bool
m_lattice_defined
=
false
;
40
50
void
InitElementFinder
(
51
int
lev,
52
amrex::Real
gamma_boost,
53
const
amrex::Vector<amrex::Real>
& time,
54
amrex::BoxArray
const
& ba,
55
amrex::DistributionMapping
const
& dm);
56
63
void
UpdateElementFinder
(
int
lev,
const
amrex::Vector<amrex::Real>
& time);
64
65
/* The lattice element finder handles the lookup that finds the elements at the particle locations.
66
* It should follow the same grid layout as the main grids.
67
*/
68
std::unique_ptr<amrex::LayoutData<LatticeElementFinder>>
m_element_finder
;
69
78
[[nodiscard]]
LatticeElementFinderDevice
79
GetFinderDeviceInstance
(
WarpXParIter
const
& a_pti,
int
a_offset,
const
amrex::Vector<amrex::Real>
& dts)
const
;
80
81
/* All of the available lattice element types */
82
Drift
h_drift
;
83
HardEdgedQuadrupole
h_quad
;
84
HardEdgedPlasmaLens
h_plasmalens
;
85
86
};
87
88
#endif
// WARPX_ACCELERATORLATTICE_ACCELERATORLATTICE_H_
Drift.H
HardEdgedPlasmaLens.H
HardEdgedQuadrupole.H
LatticeElementFinder.H
AcceleratorLattice::m_element_finder
std::unique_ptr< amrex::LayoutData< LatticeElementFinder > > m_element_finder
Definition
AcceleratorLattice.H:68
AcceleratorLattice::GetFinderDeviceInstance
LatticeElementFinderDevice GetFinderDeviceInstance(WarpXParIter const &a_pti, int a_offset, const amrex::Vector< amrex::Real > &dts) const
Return an instance of a lattice finder associated with the grid and that can be used on the device (s...
Definition
AcceleratorLattice.cpp:111
AcceleratorLattice::ReadLattice
void ReadLattice(std::string const &root_name, amrex::ParticleReal &z_location)
Read in the MAD like lattice description.
Definition
AcceleratorLattice.cpp:39
AcceleratorLattice::h_plasmalens
HardEdgedPlasmaLens h_plasmalens
Definition
AcceleratorLattice.H:84
AcceleratorLattice::InitElementFinder
void InitElementFinder(int lev, amrex::Real gamma_boost, const amrex::Vector< amrex::Real > &time, amrex::BoxArray const &ba, amrex::DistributionMapping const &dm)
Initialize the element finder instance at the given level of refinement.
Definition
AcceleratorLattice.cpp:84
AcceleratorLattice::h_drift
Drift h_drift
Definition
AcceleratorLattice.H:82
AcceleratorLattice::m_lattice_defined
bool m_lattice_defined
Definition
AcceleratorLattice.H:39
AcceleratorLattice::h_quad
HardEdgedQuadrupole h_quad
Definition
AcceleratorLattice.H:83
AcceleratorLattice::AcceleratorLattice
AcceleratorLattice()
Definition
AcceleratorLattice.cpp:20
AcceleratorLattice::m_level
int m_level
Definition
AcceleratorLattice.H:36
AcceleratorLattice::UpdateElementFinder
void UpdateElementFinder(int lev, const amrex::Vector< amrex::Real > &time)
Update the element finder, needed when the simulation frame has moved relative to the lab frame.
Definition
AcceleratorLattice.cpp:99
WarpXParIter
Definition
WarpXParticleContainer.H:112
amrex::BoxArray
amrex::DistributionMapping
amrex::Vector
amrex::Real
amrex_real Real
amrex::ParticleReal
amrex_particle_real ParticleReal
Drift
Definition
Drift.H:16
HardEdgedPlasmaLens
Definition
HardEdgedPlasmaLens.H:26
HardEdgedQuadrupole
Definition
HardEdgedQuadrupole.H:26
LatticeElementFinderDevice
The lattice element finder class that can be trivially copied to the device. This only has simple dat...
Definition
LatticeElementFinder.H:108
Generated by
1.17.0