Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add twiss injection source #5426

Open
wants to merge 25 commits into
base: development
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
555fefc
Add `twiss` injection source
bnara Oct 29, 2024
9b2aa78
Give descriptive name to lambda function.
bnara Oct 30, 2024
97cf416
Pushed particles are equally weighted, so remove weight from argument…
bnara Oct 30, 2024
2ef6800
-Wswitch: add missing switch case
bnara Oct 31, 2024
a781ee8
-Wshadow: avoid shadowing unrelated class variable in argument list
bnara Oct 31, 2024
5895cda
-Wunused-variable: sigma_u not needed here
bnara Oct 31, 2024
b58b978
misc-const-correctness: fine to make these const
bnara Oct 31, 2024
7574566
clang-tidy: readability-braces-around-statements
bnara Oct 31, 2024
d42685b
Fix switch syntax
bnara Oct 31, 2024
0282325
clean -Wshadow
bnara Oct 31, 2024
710ed13
-Wimplicit-fallthrough: switch fallthrough is intentional
bnara Oct 31, 2024
9d5f0da
clang-tidy: caught and fixed unintentionally repeated code
bnara Oct 31, 2024
47d987e
Add alternative beam orientation method using Euler rotation.
bnara Nov 5, 2024
44e336b
Add `inf` predefined constant to parser
bnara Nov 5, 2024
9127a24
Docs: Euler angles are given in radians
bnara Nov 6, 2024
af9f87d
Generalize planar and ellipsoidal cuts to 6D phase-space
bnara Nov 6, 2024
26c4a12
Docs: Fix typo in list of odd-parity symmetry transformations.
bnara Nov 7, 2024
870b031
Docs: Add two missing commas.
bnara Nov 7, 2024
e828daf
Merge branch 'ECP-WarpX:development' into development
bnara Nov 18, 2024
5fbd4ad
Include dispersion eta when relating Twiss alpha to focal distance.
bnara Nov 19, 2024
d9bb50d
Merge branch 'ECP-WarpX:development' into development
bnara Nov 25, 2024
fe20946
Merge branch 'ECP-WarpX:development' into development
bnara Nov 25, 2024
51716e8
Merge branch 'ECP-WarpX:development' into development
bnara Nov 26, 2024
fe2b5d1
Merge branch 'ECP-WarpX:development' into development
bnara Dec 4, 2024
bbe0c84
Merge branch 'ECP-WarpX:development' into development
bnara Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Give descriptive name to lambda function.
  • Loading branch information
bnara committed Oct 30, 2024
commit 9b2aa78e95fc10b49b021512c49a86b392ecd0d9
34 changes: 17 additions & 17 deletions Source/Particles/PhysicalParticleContainer.cpp
Original file line number Diff line number Diff line change
@@ -748,7 +748,7 @@ void PhysicalParticleContainer::AddTwiss (PlasmaInjector const& plasma_injector)
const amrex::XDim3 u = plasma_injector.getMomentum(0_rt, 0_rt, 0_rt);
const Real gamma = std::sqrt(1_rt + (u.x*u.x + u.y*u.y + u.z*u.z));

auto doit = [&](
auto transform_and_push = [&](
amrex::Real x, amrex::Real y, amrex::Real z,
amrex::Real ux, amrex::Real uy, amrex::Real uz, amrex::Real w) {

@@ -795,28 +795,28 @@ void PhysicalParticleContainer::AddTwiss (PlasmaInjector const& plasma_injector)
switch (symmetrization_order) {
case 16:
// One-axis reflections
doit(-x, y, z, u.x, u.y, u.z, weight);
doit( x,-y, z, u.x, u.y, u.z, weight);
doit( x, y, z,-u.x, u.y, u.z, weight);
doit( x, y, z, u.x,-u.y, u.z, weight);
transform_and_push(-x, y, z, u.x, u.y, u.z, weight);
transform_and_push( x,-y, z, u.x, u.y, u.z, weight);
transform_and_push( x, y, z,-u.x, u.y, u.z, weight);
transform_and_push( x, y, z, u.x,-u.y, u.z, weight);
// Three-axis reflections
doit( x,-y, z,-u.x,-u.y, u.z, weight);
doit(-x, y, z,-u.x,-u.y, u.z, weight);
doit(-x,-y, z, u.x,-u.y, u.z, weight);
doit(-x,-y, z,-u.x, u.y, u.z, weight);
transform_and_push( x,-y, z,-u.x,-u.y, u.z, weight);
transform_and_push(-x, y, z,-u.x,-u.y, u.z, weight);
transform_and_push(-x,-y, z, u.x,-u.y, u.z, weight);
transform_and_push(-x,-y, z,-u.x, u.y, u.z, weight);
case 8:
// Two-axis reflections
doit(-x,-y, z, u.x, u.y, u.z, weight);
doit(-x, y, z,-u.x, u.y, u.z, weight);
doit(-x, y, z, u.x,-u.y, u.z, weight);
doit( x,-y, z,-u.x, u.y, u.z, weight);
doit( x,-y, z, u.x,-u.y, u.z, weight);
doit( x, y, z,-u.x,-u.y, u.z, weight);
transform_and_push(-x,-y, z, u.x, u.y, u.z, weight);
transform_and_push(-x, y, z,-u.x, u.y, u.z, weight);
transform_and_push(-x, y, z, u.x,-u.y, u.z, weight);
transform_and_push( x,-y, z,-u.x, u.y, u.z, weight);
transform_and_push( x,-y, z, u.x,-u.y, u.z, weight);
transform_and_push( x, y, z,-u.x,-u.y, u.z, weight);
// Four-axis reflections
doit(-x,-y, z,-u.x,-u.y, u.z, weight);
transform_and_push(-x,-y, z,-u.x,-u.y, u.z, weight);
case 1:
// Identity
doit( x, y, z, u.x, u.y, u.z, weight);
transform_and_push( x, y, z, u.x, u.y, u.z, weight);
}
}
}
Loading