Skip to content

Commit 7640a00

Browse files
committed
Initial commit; basic structure.
1 parent 8eef6d7 commit 7640a00

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

src/initialization/Algorithms.H

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ namespace impactx
2323
True_3D, /**< 3D beam distribution */
2424
Gauss3D, /**< Assume a 3D Gaussian beam distribution */
2525
Gauss2p5D, /**< Assume a transverse 2D Gaussian beam distribution */
26-
True_2D /**< Averaged 2D transverse beam distribution with a current along s */
26+
True_2D, /**< Averaged 2D transverse beam distribution */
27+
True_2p5D /**< Averaged 2D transverse beam distribution with a current along s */
2728
);
2829

2930
/** Return the currently active space charge algorithm */

src/initialization/Algorithms.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ namespace impactx
7474
{
7575
return SpaceChargeAlgo::True_2D;
7676
}
77+
else if (space_charge == "2p5D")
78+
{
79+
return SpaceChargeAlgo::True_2p5D;
80+
}
7781
else
7882
{
7983
throw std::runtime_error("algo.space_charge = " + space_charge + " is not a valid option");

src/particles/spacecharge/GatherAndPush.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ namespace impactx::particles::spacecharge
8282
amrex::ParticleReal const push_consts = dt * charge * inv_gamma2 / pz_ref_SI;
8383

8484
// gather to each particle and push momentum
85-
if (space_charge == SpaceChargeAlgo::True_2D) {
85+
if (space_charge == SpaceChargeAlgo::True_2D || space_charge == SpaceChargeAlgo::True_2p5D) {
8686
// flatten 3rd dimension
8787
auto prob_lo_2D = gm.ProbLoArray();
8888
prob_lo_2D[2] = 0.0_rt;

src/particles/spacecharge/HandleSpacecharge.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace impactx::particles::spacecharge
4343
// turn off if less than 2 particles
4444
if (amr_data->track_particles.m_particle_container->TotalNumberOfParticles(true, false) < 2) { return; }
4545

46-
if (space_charge != SpaceChargeAlgo::True_2D)
46+
if (space_charge != SpaceChargeAlgo::True_2D && space_charge != SpaceChargeAlgo::True_2p5D)
4747
{
4848
// transform from x',y',t to x,y,z
4949
transformation::CoordinateTransformation(
@@ -60,7 +60,7 @@ namespace impactx::particles::spacecharge
6060
{
6161
Gauss2p5dPush(*amr_data->track_particles.m_particle_container, slice_ds);
6262
}
63-
else if (space_charge == SpaceChargeAlgo::True_3D || space_charge == SpaceChargeAlgo::True_2D)
63+
else if (space_charge == SpaceChargeAlgo::True_3D || space_charge == SpaceChargeAlgo::True_2D || space_charge == SpaceChargeAlgo::True_2p5D)
6464
{
6565
// Note: The following operations assume that
6666
// the particles are in x, y, z coordinates.
@@ -107,7 +107,7 @@ namespace impactx::particles::spacecharge
107107
);
108108
}
109109

110-
if (space_charge != SpaceChargeAlgo::True_2D)
110+
if (space_charge != SpaceChargeAlgo::True_2D && space_charge != SpaceChargeAlgo::True_2p5D)
111111
{
112112
// transform from x,y,z to x',y',t
113113
transformation::CoordinateTransformation(

0 commit comments

Comments
 (0)