aboutsummaryrefslogtreecommitdiff
path: root/Source/AcceleratorLattice/AcceleratorLattice.cpp
diff options
context:
space:
mode:
authorGravatar Axel Huebl <axel.huebl@plasma.ninja> 2023-04-10 13:16:06 -0700
committerGravatar GitHub <noreply@github.com> 2023-04-10 20:16:06 +0000
commitd75ce5579090337658d7b1fe3ad64545a1a24b26 (patch)
treea684d600ececaf88f18deeb12dd5488fc7be1519 /Source/AcceleratorLattice/AcceleratorLattice.cpp
parent4ef28deda80a2a51896ee5fccb71b013ceddd8a0 (diff)
downloadWarpX-d75ce5579090337658d7b1fe3ad64545a1a24b26.tar.gz
WarpX-d75ce5579090337658d7b1fe3ad64545a1a24b26.tar.zst
WarpX-d75ce5579090337658d7b1fe3ad64545a1a24b26.zip
Lattice: Line Docs & Rename (#3815)
* Lattice: Line Docs & Rename Rename the `lattice` element type to `line` and add documentation for it. * Add `{}` for Dave :)
Diffstat (limited to 'Source/AcceleratorLattice/AcceleratorLattice.cpp')
-rw-r--r--Source/AcceleratorLattice/AcceleratorLattice.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/AcceleratorLattice/AcceleratorLattice.cpp b/Source/AcceleratorLattice/AcceleratorLattice.cpp
index 1c22e6244..e05167c26 100644
--- a/Source/AcceleratorLattice/AcceleratorLattice.cpp
+++ b/Source/AcceleratorLattice/AcceleratorLattice.cpp
@@ -1,7 +1,10 @@
-/* Copyright 2022 David Grote
+/* Copyright 2022-2023 The Regents of the University of California, through Lawrence
+ * Berkeley National Laboratory (subject to receipt of any required
+ * approvals from the U.S. Dept. of Energy). All rights reserved.
*
* This file is part of WarpX.
*
+ * Authors: David Grote, Axel HUebl
* License: BSD-3-Clause-LBNL
*/
#include "AcceleratorLattice.H"
@@ -11,6 +14,9 @@
#include <AMReX_REAL.H>
+#include <algorithm>
+
+
AcceleratorLattice::AcceleratorLattice ()
{
@@ -35,6 +41,13 @@ AcceleratorLattice::ReadLattice (std::string const & root_name, amrex::ParticleR
m_lattice_defined = true;
}
+ bool reverse = false;
+ pp_lattice.queryAdd("reverse", reverse);
+
+ if (reverse) {
+ std::reverse(lattice_elements.begin(), lattice_elements.end());
+ }
+
// Loop through lattice elements
for (std::string const & element_name : lattice_elements) {
// Check the element type
@@ -52,7 +65,7 @@ AcceleratorLattice::ReadLattice (std::string const & root_name, amrex::ParticleR
else if (element_type == "plasmalens") {
h_plasmalens.AddElement(pp_element, z_location);
}
- else if (element_type == "lattice") {
+ else if (element_type == "line") {
ReadLattice(element_name, z_location);
}
else {