Commit 4beb353e authored by albajacas_a's avatar albajacas_a

Merge branch '97-there-is-no-test-for-multigauss-distribution' into 'master'

Resolve "There is no test for MultiGauss distribution"

Closes #97

See merge request !25
parents e4278128 16b3964c
......@@ -55,6 +55,7 @@ RegressionTests/Degrader-2/Degrader-2.h5
RegressionTests/Distribution-Binomial-1/Distribution-Binomial-1.h5
RegressionTests/Distribution-Gauss-1/Distribution-Gauss-1.h5
RegressionTests/Distribution-Gauss-2/Distribution-Gauss-2.h5
RegressionTests/Distribution-MultiGauss/Distribution-MultiGauss.h5
RegressionTests/EGunCTF3-1/EGunCTF3-1.h5
RegressionTests/EGunCTF3-2/EGunCTF3-2.h5
RegressionTests/Elliptic-1/ELCO.h5
......
OPTION, PSDUMPFREQ = 100000000;
OPTION, STATDUMPFREQ = 1000;
OPTION, BOUNDPDESTROYFQ=10; // Delete lost particles, if any
OPTION, VERSION=10900;
REAL REPARTFREQ=1000000;
Title, string="UNDULATOR";
//----------------------------------------------------------------------------
//Global Parameters
REAL rf_freq = 1.0; //RF frequency. (Hz)
REAL n_particles = 1e6; //Number of particles in simulation.
REAL beam_bunch_charge = .3e-09; //Charge of bunch. (C)
//Initial Momentum Calculation
REAL gamma = 43e-3 / EMASS; // Energy in GeV
REAL beta = sqrt(1-(1/gamma^2));
REAL P0 = gamma*beta*EMASS; //inital z momentum
//Printing initial energy and momentum to terminal output.
value , {gamma, P0};
// Drift in the beginning
DR1: DRIFT, L = .1, ELEMEDGE = 0.0;
DRIVE: Line = (DR1);
//----------------------------------------------------------------------------
// INITIAL DISTRIBUTION
Dist: DISTRIBUTION, TYPE = MULTIGAUSS,
SIGMAR = 1e-3,
SIGMAZ = 1e-4 / 2.355, // FWHM = 2.355 * sigma
CUTOFFLONG = 4.0, // In units of SIGZ
SEPPEAKS = 1.2e-4,
NPEAKS = 4;
//----------------------------------------------------------------------------
// Define Field solvers
// The mesh sizes should be a factor of 2
// for most efficient space charge calculation.
FS_SC: Fieldsolver, FSTYPE = FFT,
MX = 8, MY = 8, MT = 8, // SC grid size is 8^3
PARFFTX = true,
PARFFTY = true,
PARFFTT = true,
BCFFTX = open,
BCFFTY = open,
BCFFTT = open,
BBOXINCR = 1,
GREENSF = INTEGRATED;
//----------------------------------------------------------------------------
// Electron Beam Definition
BEAM1: BEAM, PARTICLE = ELECTRON, GAMMA = gamma, NPART = n_particles,
BFREQ = 1, BCURRENT = beam_bunch_charge * 1e6 , CHARGE = -1;
//----------------------------------------------------------------------------
// Simulate the beamline using TRACK and RUN.
TRACK, LINE = DRIVE, BEAM = BEAM1, MAXSTEPS = 1000000, DT = 1E-11, ZSTOP= 0.5;
RUN, METHOD = "PARALLEL-T", BEAM = BEAM1,
FIELDSOLVER = FS_SC, DISTRIBUTION = Dist;
ENDTRACK;
Quit;
#!/bin/bash
mpirun -np 4 $OPAL_EXE_PATH/opal Distribution-MultiGauss.in --commlib mpi --info 3 --warn 0 "$@" 2>&1
"Distribution-MultiGauss"
stat "rms_x" last 1E-7 #this is a comment
stat "rms_y" last 1E-7 #this is a comment
stat "rms_s" last 1E-7 #this is a comment
\ No newline at end of file
SDDS1
&description
text="Processor statistics 'Distribution-MultiGauss.in' 08/09/202011:35:04",
contents="lbal parameters"
&end
&parameter
name=processors,
type=long,
description="Number of Cores used"
&end
&parameter
name=revision,
type=string,
description="git revision of opal"
&end
&parameter
name=flavor,
type=string,
description="OPAL flavor that wrote file"
&end
&column
name=t,
type=double,
units=ns,
description="1 Time"
&end
&column
name="processor-0",
type=long,
units=1,
description="2 Number of particles of processor 0"
&end
&data
mode=ascii,
no_row_counts=1
&end
1
OPAL 2.3.0 git rev. #40634beaad6e3b782bed353b206083821fbae5f4
opal-t
1.669999999999996e+00 1000000
156d1a9a1c4bba17e14dd80c9d61cbaa Distribution-MultiGauss.lbal
7550f8deef74c6221d1ed7903557d834 Distribution-MultiGauss.out
SDDS1
&description
text="Statistics data 'Distribution-MultiGauss.in' 08/09/2020 11:35:04",
contents="stat parameters"
&end
&parameter
name=processors,
type=long,
description="Number of Cores used"
&end
&parameter
name=revision,
type=string,
description="git revision of opal"
&end
&parameter
name=flavor,
type=string,
description="OPAL flavor that wrote file"
&end
&column
name=t,
type=double,
units=ns,
description="1 Time"
&end
&column
name=s,
type=double,
units=m,
description="2 Path length"
&end
&column
name=numParticles,
type=long,
units=1,
description="3 Number of Macro Particles"
&end
&column
name=charge,
type=double,
units=1,
description="4 Bunch Charge"
&end
&column
name=energy,
type=double,
units=MeV,
description="5 Mean Bunch Energy"
&end
&column
name=rms_x,
type=double,
units=m,
description="6 RMS Beamsize in x"
&end
&column
name=rms_y,
type=double,
units=m,
description="7 RMS Beamsize in y"
&end
&column
name=rms_s,
type=double,
units=m,
description="8 RMS Beamsize in s"
&end
&column
name=rms_px,
type=double,
units=1,
description="9 RMS Normalized Momenta in x"
&end
&column
name=rms_py,
type=double,
units=1,
description="10 RMS Normalized Momenta in y"
&end
&column
name=rms_ps,
type=double,
units=1,
description="11 RMS Normalized Momenta in s"
&end
&column
name=emit_x,
type=double,
units=m,
description="12 Normalized Emittance x"
&end
&column
name=emit_y,
type=double,
units=m,
description="13 Normalized Emittance y"
&end
&column
name=emit_s,
type=double,
units=m,
description="14 Normalized Emittance s"
&end
&column
name=mean_x,
type=double,
units=m,
description="15 Mean Beam Position in x"
&end
&column
name=mean_y,
type=double,
units=m,
description="16 Mean Beam Position in y"
&end
&column
name=mean_s,
type=double,
units=m,
description="17 Mean Beam Position in s"
&end
&column
name=ref_x,
type=double,
units=m,
description="18 x coordinate of reference particle in lab cs"
&end
&column
name=ref_y,
type=double,
units=m,
description="19 y coordinate of reference particle in lab cs"
&end
&column
name=ref_z,
type=double,
units=m,
description="20 z coordinate of reference particle in lab cs"
&end
&column
name=ref_px,
type=double,
units=1,
description="21 x momentum of reference particle in lab cs"
&end
&column
name=ref_py,
type=double,
units=1,
description="22 y momentum of reference particle in lab cs"
&end
&column
name=ref_pz,
type=double,
units=1,
description="23 z momentum of reference particle in lab cs"
&end
&column
name=max_x,
type=double,
units=m,
description="24 Max Beamsize in x"
&end
&column
name=max_y,
type=double,
units=m,
description="25 Max Beamsize in y"
&end
&column
name=max_s,
type=double,
units=m,
description="26 Max Beamsize in s"
&end
&column
name=xpx,
type=double,
units=1,
description="27 Correlation xpx"
&end
&column
name=ypy,
type=double,
units=1,
description="28 Correlation ypy"
&end
&column
name=zpz,
type=double,
units=1,
description="29 Correlation zpz"
&end
&column
name=Dx,
type=double,
units=m,
description="30 Dispersion in x"
&end
&column
name=DDx,
type=double,
units=1,
description="31 Derivative of dispersion in x"
&end
&column
name=Dy,
type=double,
units=m,
description="32 Dispersion in y"
&end
&column
name=DDy,
type=double,
units=1,
description="33 Derivative of dispersion in y"
&end
&column
name=Bx_ref,
type=double,
units=T,
description="34 Bx-Field component of ref particle"
&end
&column
name=By_ref,
type=double,
units=T,
description="35 By-Field component of ref particle"
&end
&column
name=Bz_ref,
type=double,
units=T,
description="36 Bz-Field component of ref particle"
&end
&column
name=Ex_ref,
type=double,
units=MV/m,
description="37 Ex-Field component of ref particle"
&end
&column
name=Ey_ref,
type=double,
units=MV/m,
description="38 Ey-Field component of ref particle"
&end
&column
name=Ez_ref,
type=double,
units=MV/m,
description="39 Ez-Field component of ref particle"
&end
&column
name=dE,
type=double,
units=MeV,
description="40 energy spread of the beam"
&end
&column
name=dt,
type=double,
units=ns,
description="41 time step size"
&end
&column
name=partsOutside,
type=double,
units=1,
description="42 outside n*sigma of the beam"
&end
&data
mode=ascii,
no_row_counts=1
&end
1
OPAL 2.3.0 git rev. #40634beaad6e3b782bed353b206083821fbae5f4
opal-t
1.669999999999996e+00 5.006180519134570e-01 1000000 -2.999999999960692e-10 4.248901147146854e+01 5.015703566855674e-04 5.015940108374535e-04 1.408689831825089e-04 5.243331748280753e-04 5.243562669084204e-04 1.142075097101782e-02 6.268560817656018e-08 6.267793818411121e-08 1.513125808895554e-07 3.822314429223886e-10 6.915133334456825e-11 -1.804217969891483e-12 0.000000000000000e+00 0.000000000000000e+00 5.006180519134570e-01 0.000000000000000e+00 0.000000000000000e+00 8.414295883499398e+01 1.003602232121907e-03 1.003319399313483e-03 3.471242506126186e-04 9.711775060297045e-01 9.711899967955003e-01 9.955673483234164e-01 3.313916675289808e-08 1.079223987587600e-05 2.985983911975861e-09 1.951383895632064e-06 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 5.835579654129191e-03 1.000000000000000e-02 0
c345bee2cf44597099678007139066f0 Distribution-MultiGauss.stat
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment