WarpX
Loading...
Searching...
No Matches
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
14
15#include <memory>
16#include <string>
17
18/* \brief AcceleratorLattice contains the lattice elements
19 */
21{
22public:
23
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 */
37
38 /* Flags where any lattice elements have been specified by the user */
39 bool m_lattice_defined = false;
40
51 int lev,
52 amrex::Real gamma_boost,
54 amrex::BoxArray const & ba,
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 */
85
86};
87
88#endif // WARPX_ACCELERATORLATTICE_ACCELERATORLATTICE_H_
std::unique_ptr< amrex::LayoutData< LatticeElementFinder > > m_element_finder
Definition AcceleratorLattice.H:68
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
void ReadLattice(std::string const &root_name, amrex::ParticleReal &z_location)
Read in the MAD like lattice description.
Definition AcceleratorLattice.cpp:39
HardEdgedPlasmaLens h_plasmalens
Definition AcceleratorLattice.H:84
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
Drift h_drift
Definition AcceleratorLattice.H:82
bool m_lattice_defined
Definition AcceleratorLattice.H:39
HardEdgedQuadrupole h_quad
Definition AcceleratorLattice.H:83
AcceleratorLattice()
Definition AcceleratorLattice.cpp:20
int m_level
Definition AcceleratorLattice.H:36
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
Definition WarpXParticleContainer.H:117
Definition Drift.H:16
Definition HardEdgedPlasmaLens.H:26
Definition HardEdgedQuadrupole.H:26
The lattice element finder class that can be trivially copied to the device. This only has simple dat...
Definition LatticeElementFinder.H:108