injectturninterval = 1 b = Bunch() b.mass(0.93827231) b.macroSize(macrosize) energy = 1.0 #Gev b.getSyncParticle().kinEnergy(energy) paramsDict = {} lostbunch = Bunch() paramsDict["lostbunch"] = lostbunch paramsDict["bunch"] = b lostbunch.addPartAttr("LostParticleAttributes") #=====Make a Teapot style lattice====== teapot_latt = teapot.TEAPOT_Ring() print "Read MAD." teapot_latt.readMAD("MAD_Lattice/RealInjection/SNSring_pyOrbitBenchmark.LAT", "RING") print "Lattice=", teapot_latt.getName( ), " length [m] =", teapot_latt.getLength(), " nodes=", len( teapot_latt.getNodes()) #====Add the injection kickers====== duration = 0.0005 startamp = 1.0 endamp = 0.58 deltapos = 0.001 strength_hkicker10 = 7.211536E-03
import sys from bunch import Bunch from orbit.teapot import teapot from orbit.teapot import TEAPOT_Lattice from orbit.teapot import DriftTEAPOT from orbit.lattice import AccLattice, AccNode, AccActionsContainer from orbit.utils.orbit_mpi_utils import bunch_orbit_to_pyorbit, bunch_pyorbit_to_orbit from orbit.space_charge.directforce2p5d import directforceAccNodes, directforceLatticeModifications from spacecharge import SpaceChargeForceCalc2p5D print "Start." #=====Make a Teapot style lattice====== lattice = teapot.TEAPOT_Ring() print "Read MAD." lattice.readMAD("../MAD_Lattice/SNSring_pyOrbitBenchmark.LAT", "RING") print "Lattice=", lattice.getName(), " length [m] =", lattice.getLength( ), " nodes=", len(lattice.getNodes()) #------------------------------ #Main Bunch init #------------------------------ b = Bunch() print "Read Bunch." runName = "Benchmark_SpaceCharge" total_macroSize = 1.0e+14 b.mass(0.93827231) energy = 1.0 #Gev