Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 21bbba12 authored by adelmann's avatar adelmann :reminder_ribbon:
Browse files

more tests

parent 65c4276d
No related branches found
No related tags found
No related merge requests found
/*
Test simple Gaussian distribution
*/
OPTION, PSDUMPFREQ = 10; // 6d data written every 10th time step (h5).
OPTION, STATDUMPFREQ = 1; // Beam Stats written every time step (stat).
OPTION, BOUNDPDESTROYFQ = 10; // Delete lost particles, if any out of 10 \sigma
OPTION, AUTOPHASE = 4; // Autophase is on, and phase of max energy
// gain will be found automatically for cavities.
OPTION, VERSION=10900;
Title, string="Test simple Gaussian distribution ";
Value,{OPALVERSION};
// ----------------------------------------------------------------------------
// Global Parameters
REAL rf_freq = 1.3e9; // RF frequency. (Hz)
REAL n_particles = 1E6; // Number of particles in simulation.
REAL beam_bunch_charge = 1e-9; // Charge of bunch. (C)
// ----------------------------------------------------------------------------
// Initial Momentum Calculation
REAL Edes = 1; //initial energy in GeV
REAL gamma = (Edes+EMASS)/EMASS;
REAL beta = sqrt(1-(1/gamma^2));
REAL P0 = gamma*beta*EMASS; //inital z momentum
//Printing initial energy and momentum to terminal output.
value, {Edes, P0};
D1: DRIFT, L = 1.0, ELEMEDGE = 0.0;
BEAM1: BEAM, PARTICLE = ELECTRON, pc = P0, NPART = n_particles,
BFREQ = rf_freq, BCURRENT = beam_bunch_charge * rf_freq * 1E6, CHARGE = -1;
FS1: Fieldsolver, NX=32, NY=32, NZ=32, TYPE=FFT, PARFFTX = true, PARFFTY = true, PARFFTZ = false,
BCFFTX=OPEN, BCFFTY=OPEN, BCFFTZ=OPEN,
BBOXINCR = 1, GREENSF = INTEGRATED;
Dist1: DISTRIBUTION, TYPE= GAUSS, SIGMAX=1, SIGMAY=1, SIGMAZ=1, SIGMAPX=1, SIGMAPY=1, SIGMAPZ=1;
myLine: Line = (D1);
TRACK, LINE = myLine, BEAM = BEAM1, MAXSTEPS = 1, DT = {1e-12}, ZSTOP=1.0;
RUN, METHOD = "PARALLEL", BEAM = BEAM1, FIELDSOLVER = FS1, DISTRIBUTION = Dist1;
ENDTRACK;
QUIT;
/*
Test simple Gaussian distribution in a drift with space charge
*/
OPTION, PSDUMPFREQ = 10; // 6d data written every 10th time step (h5).
OPTION, STATDUMPFREQ = 1; // Beam Stats written every time step (stat).
OPTION, BOUNDPDESTROYFQ = 10; // Delete lost particles, if any out of 10 \sigma
OPTION, AUTOPHASE = 4; // Autophase is on, and phase of max energy
// gain will be found automatically for cavities.
OPTION, VERSION=10900;
Title, string="Test simple Gaussian distribution ";
Value,{OPALVERSION};
// ----------------------------------------------------------------------------
// Global Parameters
REAL rf_freq = 1.3e9; // RF frequency. (Hz)
REAL n_particles = 1E5; // Number of particles in simulation.
REAL beam_bunch_charge = 1e-9; // Charge of bunch. (C)
// ----------------------------------------------------------------------------
// Initial Momentum Calculation
REAL Edes = 1; //initial energy in GeV
REAL gamma = (Edes+EMASS)/EMASS;
REAL beta = sqrt(1-(1/gamma^2));
REAL P0 = gamma*beta*EMASS; //inital z momentum
//Printing initial energy and momentum to terminal output.
value, {Edes, P0};
D1: DRIFT, L = 1.0, ELEMEDGE = 0.0;
BEAM1: BEAM, PARTICLE = ELECTRON, pc = P0, NPART = n_particles,
BFREQ = rf_freq, BCURRENT = beam_bunch_charge * rf_freq * 1E6, CHARGE = -1;
FS1: Fieldsolver, NX=32, NY=32, NZ=32, TYPE=FFT, PARFFTX = true, PARFFTY = true, PARFFTZ = false,
BCFFTX=OPEN, BCFFTY=OPEN, BCFFTZ=OPEN,
BBOXINCR = 1, GREENSF = INTEGRATED;
Dist1: DISTRIBUTION, TYPE= GAUSS, SIGMAX=1, SIGMAY=1, SIGMAZ=1, SIGMAPX=1, SIGMAPY=1, SIGMAPZ=1;
myLine: Line = (D1);
TRACK, LINE = myLine, BEAM = BEAM1, MAXSTEPS = 10, DT = {1e-12}, ZSTOP=1.0;
RUN, METHOD = "PARALLEL", BEAM = BEAM1, FIELDSOLVER = FS1, DISTRIBUTION = Dist1;
ENDTRACK;
QUIT;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment