Skip to content

Commit

Permalink
Examples/Tests: New Kin Energy APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Oct 20, 2023
1 parent 5178726 commit d4e8126
Show file tree
Hide file tree
Showing 52 changed files with 80 additions and 80 deletions.
2 changes: 1 addition & 1 deletion examples/cfbend/input_cfbend.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 2.0e3 #2 GeV
beam.kin_energy = 2.0e3 #2 GeV
beam.charge = 1.0e-9
beam.particle = electron
beam.distribution = waterbag
Expand Down
4 changes: 2 additions & 2 deletions examples/cfbend/run_cfbend.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

# load a 5 GeV electron beam with an initial
# normalized transverse rms emittance of 1 um
energy_MeV = 2.0e3 # reference energy
kin_energy_MeV = 2.0e3 # reference energy
bunch_charge_C = 1.0e-9 # used with space charge
npart = 10000 # number of macro particles

# reference particle
ref = sim.particle_container().ref_particle()
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_energy_MeV(energy_MeV)
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_kin_energy_MeV(kin_energy_MeV)

# particle bunch
distr = distribution.Waterbag(
Expand Down
2 changes: 1 addition & 1 deletion examples/cfchannel/input_cfchannel.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 2.0e3
beam.kin_energy = 2.0e3
beam.charge = 1.0e-9
beam.particle = proton
beam.distribution = waterbag
Expand Down
2 changes: 1 addition & 1 deletion examples/cfchannel/input_cfchannel_10nC.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
beam.npart = 10000
#beam.npart = 100000 # optional for increased precision
beam.units = static
beam.energy = 2.0e3
beam.kin_energy = 2.0e3
beam.charge = 1.0e-8
beam.particle = proton
beam.distribution = waterbag
Expand Down
4 changes: 2 additions & 2 deletions examples/cfchannel/run_cfchannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

# load a 2 GeV proton beam with an initial
# normalized transverse rms emittance of 1 um
energy_MeV = 2.0e3 # reference energy
kin_energy_MeV = 2.0e3 # reference energy
bunch_charge_C = 1.0e-9 # used with space charge
npart = 10000 # number of macro particles

# reference particle
ref = sim.particle_container().ref_particle()
ref.set_charge_qe(1.0).set_mass_MeV(938.27208816).set_energy_MeV(energy_MeV)
ref.set_charge_qe(1.0).set_mass_MeV(938.27208816).set_kin_energy_MeV(kin_energy_MeV)

# particle bunch
distr = distribution.Waterbag(
Expand Down
4 changes: 2 additions & 2 deletions examples/cfchannel/run_cfchannel_10nC.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

# load a 2 GeV proton beam with an initial
# normalized transverse rms emittance of 1 um
energy_MeV = 2.0e3 # reference energy
kin_energy_MeV = 2.0e3 # reference energy
bunch_charge_C = 1.0e-8 # used with space charge
npart = 10000 # number of macro particles; use 1e5 for increased precision

# reference particle
ref = sim.particle_container().ref_particle()
ref.set_charge_qe(1.0).set_mass_MeV(938.27208816).set_energy_MeV(energy_MeV)
ref.set_charge_qe(1.0).set_mass_MeV(938.27208816).set_kin_energy_MeV(kin_energy_MeV)

# particle bunch
distr = distribution.Waterbag(
Expand Down
2 changes: 1 addition & 1 deletion examples/chicane/input_chicane.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 5.0e3
beam.kin_energy = 5.0e3
beam.charge = 1.0e-9
beam.particle = electron
beam.distribution = waterbag
Expand Down
4 changes: 2 additions & 2 deletions examples/chicane/run_chicane.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

# load a 5 GeV electron beam with an initial
# normalized transverse rms emittance of 1 um
energy_MeV = 5.0e3 # reference energy
kin_energy_MeV = 5.0e3 # reference energy
bunch_charge_C = 1.0e-9 # used with space charge
npart = 10000 # number of macro particles

# reference particle
ref = sim.particle_container().ref_particle()
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_energy_MeV(energy_MeV)
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_kin_energy_MeV(kin_energy_MeV)

# particle bunch
distr = distribution.Waterbag(
Expand Down
2 changes: 1 addition & 1 deletion examples/compression/input_compression.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 20.0
beam.kin_energy = 20.0
beam.charge = 1.0e-9
beam.particle = electron
beam.distribution = waterbag
Expand Down
4 changes: 2 additions & 2 deletions examples/compression/run_compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
# load a 250 MeV proton beam with an initial
# unnormalized rms emittance of 1 mm-mrad in all
# three phase planes
energy_MeV = 20.0 # reference energy
kin_energy_MeV = 20.0 # reference energy
bunch_charge_C = 1.0e-9 # used with space charge
npart = 10000 # number of macro particles

# reference particle
ref = sim.particle_container().ref_particle()
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_energy_MeV(energy_MeV)
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_kin_energy_MeV(kin_energy_MeV)

# particle bunch
distr = distribution.Waterbag(
Expand Down
2 changes: 1 addition & 1 deletion examples/cyclotron/input_cyclotron.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 4.0e-3
beam.kin_energy = 4.0e-3
beam.charge = 1.0e-9
beam.particle = proton
beam.distribution = waterbag
Expand Down
4 changes: 2 additions & 2 deletions examples/cyclotron/run_cyclotron.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
sim.init_grids()

# load initial beam
energy_MeV = 4.0e-3 # reference energy
kin_energy_MeV = 4.0e-3 # reference energy
bunch_charge_C = 1.0e-9 # used with space charge
npart = 10000 # number of macro particles

# reference particle
ref = sim.particle_container().ref_particle()
ref.set_charge_qe(1.0).set_mass_MeV(938.27208816).set_energy_MeV(energy_MeV)
ref.set_charge_qe(1.0).set_mass_MeV(938.27208816).set_kin_energy_MeV(kin_energy_MeV)

# particle bunch
distr = distribution.Waterbag(
Expand Down
2 changes: 1 addition & 1 deletion examples/distgen/input_gaussian.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 2.0e3
beam.kin_energy = 2.0e3
beam.charge = 1.0e-9
beam.particle = electron
beam.distribution = gaussian
Expand Down
2 changes: 1 addition & 1 deletion examples/distgen/input_kurth4d.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 2.0e3
beam.kin_energy = 2.0e3
beam.charge = 1.0e-9
beam.particle = proton
beam.distribution = kurth4d
Expand Down
2 changes: 1 addition & 1 deletion examples/distgen/input_kvdist.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 2.0e3
beam.kin_energy = 2.0e3
beam.charge = 1.0e-9
beam.particle = electron
beam.distribution = kvdist
Expand Down
2 changes: 1 addition & 1 deletion examples/distgen/input_semigaussian.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 2.0e3
beam.kin_energy = 2.0e3
beam.charge = 1.0e-9
beam.particle = electron
beam.distribution = gaussian
Expand Down
2 changes: 1 addition & 1 deletion examples/expanding_beam/input_expanding.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000 # outside tests, use 1e5 or more
beam.units = static
beam.energy = 250.0
beam.kin_energy = 250.0
beam.charge = 1.0e-9
beam.particle = electron
beam.distribution = kurth6d
Expand Down
4 changes: 2 additions & 2 deletions examples/expanding_beam/run_expanding.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@

# load a 2 GeV electron beam with an initial
# unnormalized rms emittance of 2 nm
energy_MeV = 250 # reference energy
kin_energy_MeV = 250 # reference energy
bunch_charge_C = 1.0e-9 # used with space charge
npart = 10000 # number of macro particles (outside tests, use 1e5 or more)

# reference particle
ref = sim.particle_container().ref_particle()
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_energy_MeV(energy_MeV)
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_kin_energy_MeV(kin_energy_MeV)

# particle bunch
distr = distribution.Kurth6D(
Expand Down
2 changes: 1 addition & 1 deletion examples/fodo/input_fodo.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 2.0e3
beam.kin_energy = 2.0e3
beam.charge = 1.0e-9
beam.particle = electron
beam.distribution = waterbag
Expand Down
4 changes: 2 additions & 2 deletions examples/fodo/run_fodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

# load a 2 GeV electron beam with an initial
# unnormalized rms emittance of 2 nm
energy_MeV = 2.0e3 # reference energy
kin_energy_MeV = 2.0e3 # reference energy
bunch_charge_C = 1.0e-9 # used with space charge
npart = 10000 # number of macro particles

# reference particle
ref = sim.particle_container().ref_particle()
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_energy_MeV(energy_MeV)
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_kin_energy_MeV(kin_energy_MeV)

# particle bunch
distr = distribution.Waterbag(
Expand Down
2 changes: 1 addition & 1 deletion examples/fodo/run_fodo_madx.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

# load a 2 GeV electron beam with an initial
# unnormalized rms emittance of 2 nm
energy_MeV = 2.0e3 # reference energy
kin_energy_MeV = 2.0e3 # reference energy
bunch_charge_C = 1.0e-9 # used with space charge
npart = 10000 # number of macro particles

Expand Down
4 changes: 2 additions & 2 deletions examples/fodo/run_fodo_programmable.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@

# load a 2 GeV electron beam with an initial
# unnormalized rms emittance of 2 nm
energy_MeV = 2.0e3 # reference energy
kin_energy_MeV = 2.0e3 # reference energy
bunch_charge_C = 1.0e-9 # used with space charge
npart = 10000 # number of macro particles

# reference particle
ref = sim.particle_container().ref_particle()
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_energy_MeV(energy_MeV)
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_kin_energy_MeV(kin_energy_MeV)

# particle bunch
distr = distribution.Waterbag(
Expand Down
2 changes: 1 addition & 1 deletion examples/fodo_chromatic/input_fodo_chr.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 2.0e3
beam.kin_energy = 2.0e3
beam.charge = 1.0e-9
beam.particle = electron
beam.distribution = waterbag
Expand Down
4 changes: 2 additions & 2 deletions examples/fodo_chromatic/run_fodo_chr.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

# load a 2 GeV electron beam with an initial
# unnormalized rms emittance of 2 nm
energy_MeV = 2.0e3 # reference energy
kin_energy_MeV = 2.0e3 # reference energy
bunch_charge_C = 1.0e-9 # used with space charge
npart = 10000 # number of macro particles

# reference particle
ref = sim.particle_container().ref_particle()
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_energy_MeV(energy_MeV)
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_kin_energy_MeV(kin_energy_MeV)

# particle bunch
distr = distribution.Waterbag(
Expand Down
2 changes: 1 addition & 1 deletion examples/fodo_rf/input_fodo_rf.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 250.0
beam.kin_energy = 250.0
beam.charge = 1.0e-9
beam.particle = proton
beam.distribution = waterbag
Expand Down
4 changes: 2 additions & 2 deletions examples/fodo_rf/run_fodo_rf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
# load a 250 MeV proton beam with an initial
# unnormalized rms emittance of 1 mm-mrad in all
# three phase planes
energy_MeV = 250.0 # reference energy
kin_energy_MeV = 250.0 # reference energy
bunch_charge_C = 1.0e-9 # used with space charge
npart = 10000 # number of macro particles

# reference particle
ref = sim.particle_container().ref_particle()
ref.set_charge_qe(1.0).set_mass_MeV(938.27208816).set_energy_MeV(energy_MeV)
ref.set_charge_qe(1.0).set_mass_MeV(938.27208816).set_kin_energy_MeV(kin_energy_MeV)

# particle bunch
distr = distribution.Waterbag(
Expand Down
2 changes: 1 addition & 1 deletion examples/iota_lattice/input_iotalattice.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 2.5
beam.kin_energy = 2.5
beam.charge = 1.0e-9
beam.particle = proton
beam.distribution = waterbag
Expand Down
4 changes: 2 additions & 2 deletions examples/iota_lattice/run_iotalattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
sim.init_grids()

# init particle beam
energy_MeV = 2.5
kin_energy_MeV = 2.5
bunch_charge_C = 1.0e-9 # used with space charge
npart = 10000

# reference particle
ref = sim.particle_container().ref_particle()
ref.set_charge_qe(1.0).set_mass_MeV(938.27208816).set_energy_MeV(energy_MeV)
ref.set_charge_qe(1.0).set_mass_MeV(938.27208816).set_kin_energy_MeV(kin_energy_MeV)

# particle bunch
distr = distribution.Waterbag(
Expand Down
2 changes: 1 addition & 1 deletion examples/iota_lens/input_iotalens.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 2.5
beam.kin_energy = 2.5
beam.charge = 1.0e-9
beam.particle = proton
beam.distribution = waterbag
Expand Down
4 changes: 2 additions & 2 deletions examples/iota_lens/run_iotalens.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
sim.init_grids()

# load a 2.5 MeV proton beam
energy_MeV = 2.5 # reference energy
kin_energy_MeV = 2.5 # reference energy
bunch_charge_C = 1.0e-9 # used with space charge
npart = 10000 # number of macro particles

# reference particle
ref = sim.particle_container().ref_particle()
ref.set_charge_qe(1.0).set_mass_MeV(938.27208816).set_energy_MeV(energy_MeV)
ref.set_charge_qe(1.0).set_mass_MeV(938.27208816).set_kin_energy_MeV(kin_energy_MeV)

# particle bunch
distr = distribution.Waterbag(
Expand Down
2 changes: 1 addition & 1 deletion examples/kicker/input_kicker.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################################
beam.npart = 10000
beam.units = static
beam.energy = 2.0e3
beam.kin_energy = 2.0e3
beam.charge = 1.0e-9
beam.particle = electron
beam.distribution = waterbag
Expand Down
4 changes: 2 additions & 2 deletions examples/kicker/run_kicker.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

# load a 2 GeV electron beam with an initial
# unnormalized rms emittance of nm
energy_MeV = 2.0e3 # reference energy
kin_energy_MeV = 2.0e3 # reference energy
bunch_charge_C = 1.0e-9 # used without space charge
npart = 10000 # number of macro particles

# reference particle
ref = sim.particle_container().ref_particle()
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_energy_MeV(energy_MeV)
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_kin_energy_MeV(kin_energy_MeV)

# particle bunch
distr = distribution.Waterbag(
Expand Down
2 changes: 1 addition & 1 deletion examples/kurth/input_kurth_10nC_periodic.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
beam.npart = 10000
#beam.npart = 100000 #optional for increased precision
beam.units = static
beam.energy = 2.0e3
beam.kin_energy = 2.0e3
beam.charge = 1.0e-8
beam.particle = proton
beam.distribution = kurth6d
Expand Down
Loading

0 comments on commit d4e8126

Please sign in to comment.