Commit afd07af3 authored by gsell's avatar gsell
Browse files

cleanup unused tests in optimizer

parent 1c35e1a4
// g++ Tests/generatesim.cpp -I .
#include "Util/GenerateSimulation.h"
#include <string>
#include <iostream>
#include <map>
int main(int argc, char** argv) {
std::map<std::string, std::string> userVars;
userVars.insert(std::pair<string, string>("NSLICE", "200"));
GenerateSimulation *gs = new GenerateSimulation("Tests/gentest.tmpl", "Tests/gentest.data", userVars);
gs->writeInputFile("Tests/gentest.in");
delete gs;
return 0;
}
# FinPhase3.data
#
# checked by Hao Zha in 15:33, 21/02/2011, with the data from *110217_1512.snap
# add quadrupoles by Hao Zha in 17:09, 27/02/2011. The data were from *110217_1512.snap
#
# CTF3 GUN
#
FINSS_RGUN_dphi -3.30 # Gun phase [deg] w.r.t autophase -3.25
FINSS_RGUN_volt 100.0 # Gun voltage [MV]
D_LAG_RGUN 0.0
#
#
# Traveling Wave Stuctures
#
FINSB01_RACC_dphi 0.0 # TW-Structure phase w.r.t autophase [deg]
FINSB02_RACC_dphi 0.0 # TW-Structure phase w.r.t autophase [deg]
FINSB03_RACC_dphi 0.0 # TW-Structure phase w.r.t autophase [deg]
FINSB04_RACC_dphi -34.2 # TW-Structure phase w.r.t autophase [deg]
FINXB_RACC_dphi 0.0 # X-band phase w.r.t autophase [deg]
FIND1_RTDC_dphi 0.0 # TDC at low energy
F10D1_RTDC_dphi 0.0 # TDC ay higher energy
D_LAG_B01 0.0
D_LAG_B02 0.0
#
FINSB01_RACC_volt 19 # TW-Structure voltage [MV]
FINSB02_RACC_volt 25 # TW-Structure voltage [MV]
FINSB03_RACC_volt 25 # TW-Structure voltage [MV]
FINSB04_RACC_volt 0.0 # TW-Structure voltage [MV]
#
FIND1_RTDC_volt 0.0 # TDC voltage [MV]
F10D1_RTDC_volt 0.0 # TDC voltage [MV]
#
FINXB_RACC_volt 0.0 # TW-Structure voltage [MV]
#
#
FIND1_MSOL10_i 116.5
#
# Solenoids over the
# first 2 TW Stuctures
#
FINSB01_MSOL10_ks 0.04 #
FINSB01_MSOL20_ks 0.04 #
FINSB01_MSOL30_ks 0.08 #
FINSB01_MSOL40_ks 0.08 #
#
FINSB02_MSOL10_ks 0.068 #
FINSB02_MSOL20_ks 0.068 #
FINSB02_MSOL30_ks 0.068 #
FINSB02_MSOL40_ks 0.068 #
#
FINSB03_MSOL10_ks 0.02 #
FINSB03_MSOL20_ks 0.02 #
FINSB03_MSOL30_ks 0.02 #
FINSB03_MSOL40_ks 0.02 #
#
FINSB04_MSOL10_ks 0.0 #
FINSB04_MSOL20_ks 0.0 #
FINSB04_MSOL30_ks 0.0 #
FINSB04_MSOL40_ks 0.0 #
#
#
FINXB_MQUA10_k1 -0.3663 #
FINXB_MQUA20_k1 2.8417 #
FINXB_MQUA30_k1 -2.7941 #
FINXB_MQUA40_k1 2.1990 #
FINXB_MQUA50_k1 -1.3724 # Hao : the original line is 'FINXB_MQUA10_k1', is this a spell mistake ?
F10D1_MQUA10_k1 0.0 #
F10D1_MQUA15_k1 0.0 #
F10D1_MQUA20_k1 0.0 #
F10D1_MQUA25_k1 0.0 #
F10D1_MQUA30_k1 0.0 #
F10D1_MQUA35_k1 0.0 #
F10D1_MQUA40_k1 0.0 #
F10D1_MQUA45_k1 0.0 #
F10D1_MQUA50_k1 0.0 #
F10D1_MQUA55_k1 0.0 #
F10D1_MQUA60_k1 0.0 #
F10D1_MQUA65_k1 0.0 #
F10D1_MQUA70_k1 0.0 #
F10D1_MQUA75_k1 0.0 #
F10D1_MQUA80_k1 0.0 #
F10D1_MQUA85_k1 0.0 #
F10D1_MQUA90_k1 0.0 #
F10D1_MQUA95_k1 0.0 #
#
#
TFWHM 6.03 # Laser fwhm time [ps]
TRISE 0.432 # Laser rise time [ps] Simona: it was 4.32
TFALL 0.432 # Laser fall time [ps] Simona: it was 4.32
#
SIGX 275 # Laser spot size (x) [um]
SIGY 275 # Laser spot size (y) [um]
#
EKIN 0.63 # kinetic energy of electrons at emission [eV]
QBUNCH 200 # Bunch charge [pC]
#
NBIN 5 # Number of energy bins (gun)
#
MX 32 # Mesh size in X Simona: it was 64
MY 32 # Mesh size in Y Simona: it was 64
MT 512 # Mesh size in T/Z Simona: it was 1024
#
NPART 5000000 # Number of simulation particles
#
DT 5.0 # time step in beamline [ps]
DTGUN 0.1 # time step in gun [ps]
#
ZSTOP 13.0 # z where simulation stops [m]
ZSTOPGUN 0.2 # z where simulation of the gun stops [m]
#
CORES 32 # number of cores (cpus) to use
#
FREQ 2997.912 # rf frequency Mhz
#
H5PSFQ 500 # h5 phase space dump frequency Simona: it was 500
#
USEET -1 # flag for envelope-tracker (-1 == OPAL-t 1 == OPAL-e)
#
NSLICE 100 # number of slices for opal-e
#
FTOSCAMPLITUDE 1 # amplidude
#
FTOSCPERIODS 10 # periods
OPTION, ECHO=FALSE;
OPTION, TFS=FALSE;
OPTION, INFO=FALSE;
OPTION, PSDUMPFREQ=10000000000;
OPTION, STATDUMPFREQ=10000000000;
// Now template file is according to the HL Phase2 from the Wicki, 16/2/2011 H. Zha, A. Adelmann
// add third track for drift AA
// add quadrupoles, 17:39, 27/02/2011, Hao Zha
// modify many errors, 03/03/2011, Hao Zha
// add a negitive offset for each TW solenoid, 09/03/2011, Hao Zha
// change the variable of gun solenoid from B field to current, 09/03/2011, Hao Zha
// modify the formular for gun solenoid according to the Wiki page, 15/03/2011, Hao Zha
// TYPE=NOAP prevents from beign autophased
TITLE, STRING="SwissFEL Injector, Phase 3 (January 2011) 1D TWS fieldmap";
REPARTFREQ = 500;
MINSTEPFORREBIN = 1000;
QB = _QBUNCH_;
BFREQ = _FREQ_;
BCURRENT = QB*BFREQ*1e6;
// Hao : I assume that this variable would be 0.0 when I check the ELEMEDGE of each element
TWFMAPSHIFT = 0.075; //To be compatible with ASTRA , Hao : modify it to align center, old = 0.05
TWSOLSHIFT = -0.375; //To align field center
USE_ET = 1;
//d1: DVAR, ELEMENT="", VARIABLE="D_LAG_RGUN";
//d2: DVAR, ELEMENT="", VARIABLE="D_LAG_B01";
//d3: DVAR, ELEMENT="", VARIABLE="D_LAG_B02";
//obj1: OBJECTIVE, EXPR="energy*-1";
//obj2: OBJECTIVE, EXPR="emit_x";
//objs: OBJECTIVES = (obj1, obj2);
//dvars: DVARS = (d1, d2, d3);
//constrs: CONSTRAINTS = ();
//opt: OPTIMIZE, OBJECTIVES=objs, DVARS=dvars, CONSTRAINTS=constrs;
IF (USE_ET > 0) {
OPTION, AUTOPHASE=0;
FINSS_RGUN_dphi = 2.22808 + _D_LAG_RGUN_;
FINSB01_RACC_dphi = 0.608548 + _D_LAG_B01_;
FINSB02_RACC_dphi = 0.583172 + _D_LAG_B02_;
FINSB03_RACC_dphi = _FINSB03_RACC_dphi_/180.0*PI;
FINSB04_RACC_dphi = _FINSB04_RACC_dphi_/180.0*PI;
FINXB_RACC_dphi = _FINXB_RACC_dphi_/180.0*PI;
FIND1_RTDC_dphi = _FIND1_RTDC_dphi_/180.0*PI;
F10D1_RTDC_dphi = _F10D1_RTDC_dphi_/180.0*PI;
//FINSS_RGUN_dphi = 0;
//FINSB01_RACC_dphi = 0;
//FINSB02_RACC_dphi = 0;
//FINSB03_RACC_dphi = 0;
//FINSB04_RACC_dphi = 0;
//FINXB_RACC_dphi = 0;
//FIND1_RTDC_dphi = 0;
//F10D1_RTDC_dphi = 0;
}
else {
OPTION, AUTOPHASE=0;
FINSS_RGUN_dphi = _FINSS_RGUN_dphi_/180.0*PI;
FINSB01_RACC_dphi = _FINSB01_RACC_dphi_/180.0*PI;
FINSB02_RACC_dphi = _FINSB02_RACC_dphi_/180.0*PI;
FINSB03_RACC_dphi = _FINSB03_RACC_dphi_/180.0*PI;
FINSB04_RACC_dphi = _FINSB04_RACC_dphi_/180.0*PI;
FINXB_RACC_dphi = _FINXB_RACC_dphi_/180.0*PI;
FIND1_RTDC_dphi = _FIND1_RTDC_dphi_/180.0*PI;
F10D1_RTDC_dphi = _F10D1_RTDC_dphi_/180.0*PI;
}
// -----------------------------------------------------------------------------------------
// RF-COMPONENTS
// -----------------------------------------------------------------------------------------
// Hao: the L and ELEMEDGE of these elements were checked in 9:53 AM, 16-02-2011 from HI.Liste @ Phase 2
// Hao : I assume that the variable TWFMAOSHIFT would be 0.0 when I check the ELEMEDGE of each element
FINSS_RGUN: RFCAVITY, L = 0.25, VOLT = _FINSS_RGUN_volt_, FMAPFN = "FINSS-RGUN.dat",
ELEMEDGE = 0.0, TYPE = "STANDING", FREQ = _FREQ_,
LAG = FINSS_RGUN_dphi;// + _D_LAG_RGUN_;
// Hao: old L = 0.34986
FINSB01_RACC: TRAVELINGWAVE, L = 4.15, VOLT = _FINSB01_RACC_volt_, FMAPFN = "TWS_PSI_Sband_ASTRA.dat",
ELEMEDGE = 2.95+TWFMAPSHIFT, NUMCELLS = 120, MODE = 1/3,
ACCURACY = 39, FREQ = 2998.0, LAG = FINSB01_RACC_dphi;// + _D_LAG_B01_;
FINSB02_RACC: TRAVELINGWAVE, L = 4.15, VOLT = _FINSB02_RACC_volt_, FMAPFN = "TWS_PSI_Sband_ASTRA.dat",
ELEMEDGE = 7.95+TWFMAPSHIFT, NUMCELLS = 120, MODE = 1/3,
ACCURACY = 39, FREQ = 2998.0, LAG = FINSB02_RACC_dphi;// + _D_LAG_B02_;
FINSB03_RACC: TRAVELINGWAVE, L = 4.15, VOLT = _FINSB03_RACC_volt_, FMAPFN = "TWS_PSI_Sband_ASTRA.dat",
ELEMEDGE = 12.95+TWFMAPSHIFT, NUMCELLS = 120, MODE = 1/3,
ACCURACY = 39, FREQ = 2998.0, LAG = FINSB03_RACC_dphi;
FINSB04_RACC: TRAVELINGWAVE, L = 4.15, VOLT = _FINSB04_RACC_volt_, FMAPFN = "TWS_PSI_Sband_ASTRA.dat",// Hao : add quadrupoles
ELEMEDGE = 17.95+TWFMAPSHIFT, NUMCELLS = 120, MODE = 1/3,
ACCURACY = 39, FREQ = 2998.0, LAG = FINSB04_RACC_dphi; // Hao: this element cann't be found
FINXB_RACC: TRAVELINGWAVE, L = 0.965, VOLT = _FINXB_RACC_volt_, FMAPFN = "FINSB01-RACC.T7",
ELEMEDGE = 24.95+TWFMAPSHIFT, NUMCELLS = 120, MODE = 1/3,
ACCURACY = 39, FREQ = 11000.0, LAG = FINXB_RACC_dphi; // Hao: this element cann't be found
FIND1_RTDC: RFCavity, TYPE=NOAP, L = 0.1, VOLT = _FIND1_RTDC_volt_, FMAPFN = "FIND1_RTDC.h5part",
ELEMEDGE = 0.9665, TYPE = "STANDING", FREQ = 3003.13,
LAG = FIND1_RTDC_dphi;
F10D1_RTDC: RFCavity, TYPE=NOAP, L = 0.4388, VOLT = _F10D1_RTDC_volt_, FMAPFN = "FIND1_RTDC.h5part",
ELEMEDGE = 42.4711, TYPE = "STANDING", FREQ = 3003.13,
LAG = F10D1_RTDC_dphi; // Hao: old L = 0.441
// --------------------------------------------------------------------------------------------------------------
// SOLENOIDS
// --------------------------------------------------------------------------------------------------------------
// Hao: the L and ELEMEDGE of these elements were checked in 9:58 AM, 16-02-2011 from HI.Liste @ Phase 2
FIND1_MSOL10: SOLENOID, L = 0.26, KS = _FIND1_MSOL10_i_*0.38704/220 + 0.0022, FMAPFN = "NEW_SINGLE_SOL_NOFRINGE_OPAL.dat", ELEMEDGE = 0.3; // Hao: old L = 0.6, ELEMEDGE = 0.3
FINSB01_MSOL10: SOLENOID, L = 0.75, KS = _FINSB01_MSOL10_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 3.375 + TWSOLSHIFT;
FINSB01_MSOL20: SOLENOID, L = 0.75, KS = _FINSB01_MSOL20_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 4.225 + TWSOLSHIFT;
FINSB01_MSOL30: SOLENOID, L = 0.75, KS = _FINSB01_MSOL30_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 5.075 + TWSOLSHIFT;
FINSB01_MSOL40: SOLENOID, L = 0.75, KS = _FINSB01_MSOL40_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 5.925 + TWSOLSHIFT;
FINSB02_MSOL10: SOLENOID, L = 0.75, KS = _FINSB02_MSOL10_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 8.375 + TWSOLSHIFT;
FINSB02_MSOL20: SOLENOID, L = 0.75, KS = _FINSB02_MSOL20_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 9.225 + TWSOLSHIFT;
FINSB02_MSOL30: SOLENOID, L = 0.75, KS = _FINSB02_MSOL30_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 10.075 + TWSOLSHIFT;
FINSB02_MSOL40: SOLENOID, L = 0.75, KS = _FINSB02_MSOL40_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 10.925 + TWSOLSHIFT;
FINSB03_MSOL10: SOLENOID, L = 0.75, KS = _FINSB03_MSOL10_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 13.375 + TWSOLSHIFT;
FINSB03_MSOL20: SOLENOID, L = 0.75, KS = _FINSB03_MSOL20_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 14.225 + TWSOLSHIFT;
FINSB03_MSOL30: SOLENOID, L = 0.75, KS = _FINSB03_MSOL30_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 15.075 + TWSOLSHIFT;
FINSB03_MSOL40: SOLENOID, L = 0.75, KS = _FINSB03_MSOL40_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 15.925 + TWSOLSHIFT;
FINSB04_MSOL10: SOLENOID, L = 0.75, KS = _FINSB04_MSOL10_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 18.375 + TWSOLSHIFT; // Hao: this element cann't be found
FINSB04_MSOL20: SOLENOID, L = 0.75, KS = _FINSB04_MSOL20_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 19.225 + TWSOLSHIFT; // Hao: this element cann't be found
FINSB04_MSOL30: SOLENOID, L = 0.75, KS = _FINSB04_MSOL30_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 20.075 + TWSOLSHIFT; // Hao: this element cann't be found
FINSB04_MSOL40: SOLENOID, L = 0.75, KS = _FINSB04_MSOL40_ks_, FMAPFN = "INSB_MSLAC_Bz_NOFRINGE_OPAL.dat", ELEMEDGE = 20.925 + TWSOLSHIFT; // Hao: this element cann't be found
END: SOLENOID, L=0.01, KS = 0.0, ELEMEDGE=70., FMAPFN="INSB_MSLAC_Bz_NOFRINGE_OPAL.dat"; // Hao: this element cann't be found
// --------------------------------------------------------------------------------------------------------------
// QUADRUPOLES
// --------------------------------------------------------------------------------------------------------------
// Hao: the L and ELEMEDGE of these elements were checked in 10:01 AM, 16-02-2011 from HI.Liste @ Phase 2
FINXB_MQUA10: QUADRUPOLE, L = 0.15, K1= _FINXB_MQUA10_k1_, ELEMEDGE = 22.93;
FINXB_MQUA20: QUADRUPOLE, L = 0.15, K1= _FINXB_MQUA20_k1_, ELEMEDGE = 23.28;
FINXB_MQUA30: QUADRUPOLE, L = 0.15, K1= _FINXB_MQUA30_k1_, ELEMEDGE = 23.63;
FINXB_MQUA40: QUADRUPOLE, L = 0.15, K1= _FINXB_MQUA40_k1_, ELEMEDGE = 27.01;
FINXB_MQUA50: QUADRUPOLE, L = 0.15, K1= _FINXB_MQUA50_k1_, ELEMEDGE = 27.36; // Hao: the K1 of this must be MQUA50 ?
F10D1_MQUA10: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA10_k1_, ELEMEDGE = 39.652;
F10D1_MQUA15: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA15_k1_, ELEMEDGE = 40.011;
F10D1_MQUA20: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA20_k1_, ELEMEDGE = 40.611;
F10D1_MQUA25: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA25_k1_, ELEMEDGE = 41.211;
F10D1_MQUA30: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA30_k1_, ELEMEDGE = 41.811;
F10D1_MQUA35: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA35_k1_, ELEMEDGE = 43.511;
F10D1_MQUA40: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA40_k1_, ELEMEDGE = 44.087;
F10D1_MQUA45: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA45_k1_, ELEMEDGE = 44.687;
F10D1_MQUA50: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA50_k1_, ELEMEDGE = 45.437;
F10D1_MQUA55: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA55_k1_, ELEMEDGE = 46.037;
F10D1_MQUA60: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA60_k1_, ELEMEDGE = 47.043;
F10D1_MQUA65: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA65_k1_, ELEMEDGE = 48.543;
F10D1_MQUA70: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA70_k1_, ELEMEDGE = 50.043;
F10D1_MQUA75: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA75_k1_, ELEMEDGE = 51.543;
F10D1_MQUA80: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA80_k1_, ELEMEDGE = 53.043;
F10D1_MQUA85: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA85_k1_, ELEMEDGE = 54.543;
F10D1_MQUA90: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA90_k1_, ELEMEDGE = 56.043;
F10D1_MQUA95: QUADRUPOLE, L = 0.15, K1= _F10D1_MQUA95_k1_, ELEMEDGE = 57.543;
// --------------------------------------------------------------------------------------------------------------
// SCREENS
// --------------------------------------------------------------------------------------------------------------
// Hao, Andreas: these SCREENS were created in 10:20 AM, 16-02-2011 from HI.Liste @ Phase 2
FIND1_DSCR10: MONITOR, L=0.01, ELEMEDGE=0.902, OUTFN="FIND1_DSCR10.h5";
FIND1_DSCR20: MONITOR, L=0.01, ELEMEDGE=1.1259, OUTFN="FIND1_DSCR20.h5";
FIND100_DSCR10: MONITOR, L=0.01, ELEMEDGE=2.249, OUTFN="FIND100_DSCR10.h5";
FIND100_DSCR20: MONITOR, L=0.01, ELEMEDGE=2.735, OUTFN="FIND100_DSCR20.h5";
FINSB01_DSCR10: MONITOR, L=0.01, ELEMEDGE=7.5875, OUTFN="FINSB01_DSCR10.h5";
FINSB02_DSCR10: MONITOR, L=0.01, ELEMEDGE=12.5505, OUTFN="FINSB02_DSCR10.h5";
FINSB03_DSCR10: MONITOR, L=0.01, ELEMEDGE=17.5505, OUTFN="FINSB03_DSCR10.h5";
FINSB04_DSCR10: MONITOR, L=0.01, ELEMEDGE=22.5505, OUTFN="FINSB04_DSCR10.h5";
FINXB_DSCR10: MONITOR, L=0.01, ELEMEDGE=24.653, OUTFN="FINXB_DSCR10.h5";
FINXB_DSCR20: MONITOR, L=0.01, ELEMEDGE=26.212, OUTFN="FINXB_DSCR20.h5";
FINXB_DSCR30: MONITOR, L=0.01, ELEMEDGE=33.2775, OUTFN="FINXB_DSCR30.h5";
F10D1_DSCR10: MONITOR, L=0.01, ELEMEDGE=40.305, OUTFN="F10D1_DSCR10.h5";
F10D1_DSCR20: MONITOR, L=0.01, ELEMEDGE=42.272, OUTFN="F10D1_DSCR20.h5";
F10D1_DSCR30: MONITOR, L=0.01, ELEMEDGE=43.129, OUTFN="F10D1_DSCR30.h5";
F10D1_DSCR40: MONITOR, L=0.01, ELEMEDGE=46.615, OUTFN="F10D1_DSCR40.h5";
F10D1_DSCR45: MONITOR, L=0.01, ELEMEDGE=47.868, OUTFN="F10D1_DSCR45.h5";
F10D1_DSCR50: MONITOR, L=0.01, ELEMEDGE=49.368, OUTFN="F10D1_DSCR50.h5";
F10D1_DSCR55: MONITOR, L=0.01, ELEMEDGE=50.868, OUTFN="F10D1_DSCR55.h5";
F10D1_DSCR60: MONITOR, L=0.01, ELEMEDGE=52.368, OUTFN="F10D1_DSCR60.h5";
F10D1_DSCR65: MONITOR, L=0.01, ELEMEDGE=53.868, OUTFN="F10D1_DSCR65.h5";
F10D1_DSCR70: MONITOR, L=0.01, ELEMEDGE=55.368, OUTFN="F10D1_DSCR70.h5";
F10D1_DSCR75: MONITOR, L=0.01, ELEMEDGE=56.868, OUTFN="F10D1_DSCR75.h5";
F10D100_DSCR10: MONITOR, L=0.01, ELEMEDGE=60.824, OUTFN="F10D100_DSCR10.h5";
F10D101_DSCR10: MONITOR, L=0.01, ELEMEDGE=60.824, OUTFN="F10D101_DSCR10.h5";
SCREEN_END: MONITOR, L=0.01, ELEMEDGE=22.90, OUTFN="SCREEN_END.h5"; //Simona: added a screen at the end of the simulation
Screens: Line = (FIND1_DSCR10, FIND1_DSCR20, FIND100_DSCR10, FIND100_DSCR20,
FINSB01_DSCR10, FINSB02_DSCR10, FINSB03_DSCR10, FINSB04_DSCR10,
F10D1_DSCR45, F10D1_DSCR50, F10D1_DSCR55, F10D1_DSCR60, // Hao : add more screens
F10D1_DSCR65, F10D1_DSCR70, F10D1_DSCR75,SCREEN_END); //Simona: added a screen at 22.90 m
// --------------------------------------------------------------------------------------------------------------
if (USE_ET > 0) {
InjectorPhase3: Line = (FINSS_RGUN,FIND1_MSOL10,
FINSB01_RACC,FINSB01_MSOL10,FINSB01_MSOL20,FINSB01_MSOL30,FINSB01_MSOL40,
FINSB02_RACC,FINSB02_MSOL10,FINSB02_MSOL20,FINSB02_MSOL30,FINSB02_MSOL40,
FINXB_MQUA10, FINXB_MQUA20, FINXB_MQUA30, FINXB_MQUA40, FINXB_MQUA50, // Hao : add quadrupoles
F10D1_MQUA10, F10D1_MQUA15, F10D1_MQUA20, F10D1_MQUA25, F10D1_MQUA30, // Hao : add quadrupoles
F10D1_MQUA35, F10D1_MQUA40, F10D1_MQUA45, F10D1_MQUA50, F10D1_MQUA55, // Hao : add quadrupoles
F10D1_MQUA60, F10D1_MQUA65, F10D1_MQUA70, F10D1_MQUA75, F10D1_MQUA80, // Hao : add quadrupoles
F10D1_MQUA85, F10D1_MQUA90, F10D1_MQUA95,
END);
}
else {
InjectorPhase3: Line = (FINSS_RGUN,FIND1_MSOL10,
FINSB01_RACC,FINSB01_MSOL10,FINSB01_MSOL20,FINSB01_MSOL30,FINSB01_MSOL40,
FINSB02_RACC,FINSB02_MSOL10,FINSB02_MSOL20,FINSB02_MSOL30,FINSB02_MSOL40,
FINXB_MQUA10, FINXB_MQUA20, FINXB_MQUA30, FINXB_MQUA40, FINXB_MQUA50, // Hao : add quadrupoles
F10D1_MQUA10, F10D1_MQUA15, F10D1_MQUA20, F10D1_MQUA25, F10D1_MQUA30, // Hao : add quadrupoles
F10D1_MQUA35, F10D1_MQUA40, F10D1_MQUA45, F10D1_MQUA50, F10D1_MQUA55, // Hao : add quadrupoles
F10D1_MQUA60, F10D1_MQUA65, F10D1_MQUA70, F10D1_MQUA75, F10D1_MQUA80, // Hao : add quadrupoles
F10D1_MQUA85, F10D1_MQUA90, F10D1_MQUA95,
Screens,
END);
}
if (USE_ET > 0) {
Dist1: DISTRIBUTION, DISTRIBUTION = "GUNGAUSSFLATTOPTH",
SIGMAX = 2*_SIGX_, SIGMAPX = 0.0, CORRX = 0.0,
SIGMAY = 2*_SIGY_, SIGMAPY = 0.0, CORRY = 0.0,
SIGMAT = 0.0, PT = 0.0, SIGMAPT = 0.0, CORRT = 0.0,
TRISE = _TRISE_, TFALL = _TFALL_, TPULSEFWHM = _TFWHM_,
EKIN = _EKIN_, NBIN = _NBIN_;
}
else{
Dist1: DISTRIBUTION, DISTRIBUTION = "GUNGAUSSFLATTOPTH",
SIGMAX = 2*_SIGX_, SIGMAPX = 0.0, CORRX = 0.0,
SIGMAY = 2*_SIGY_, SIGMAPY = 0.0, CORRY = 0.0,
SIGMAT = 0.0, PT = 0.0, SIGMAPT = 0.0, CORRT = 0.0,
TRISE = _TRISE_, TFALL = _TFALL_, TPULSEFWHM = _TFWHM_,
EKIN = _EKIN_, NBIN = _NBIN_,
FTOSCAMPLITUDE=_FTOSCAMPLITUDE_ ,FTOSCPERIODS=_FTOSCPERIODS_;
}
Fs1: FIELDSOLVER, FSTYPE=FFT, MX=_MX_, MY=_MY_, MT=_MT_,
PARFFTX=true, PARFFTY=true, PARFFTT=true,
BCFFTX=open, BCFFTY=open, BCFFTT=open,
BBOXINCR=1, GREENSF=INTEGRATED;
if (USE_ET > 0) {
beam1: BEAM, PARTICLE=ELECTRON, pc=P0, NSLICE=_NSLICE_, BFREQ=BFREQ, BCURRENT=BCURRENT, CHARGE=-1;
SELECT, LINE = InjectorPhase3;
TRACK, LINE=InjectorPhase3, BEAM=beam1, MAXSTEPS=1000000, DT=_DT_, ZSTOP=_ZSTOP_;
RUN, METHOD = "PARALLEL-SLICE", BEAM = beam1, FIELDSOLVER = Fs1, DISTRIBUTION = Dist1;
ENDTRACK;
// TRACK, LINE=InjectorPhase3, BEAM=beam1, MAXSTEPS=1000000, DT=_DT_, ZSTOP=_ZSTOP_;
// RUN, METHOD = "PARALLEL-SLICE", BEAM=beam1, FIELDSOLVER=Fs1;
// ENDTRACK;
}
else {
beam1: BEAM, PARTICLE=ELECTRON, pc=P0, NPART=_NPART_, BFREQ=BFREQ, BCURRENT=BCURRENT, CHARGE=-1;
SELECT, LINE = InjectorPhase3;
TRACK, LINE=InjectorPhase3, BEAM=beam1, MAXSTEPS=1000000, DT=_DTGUN_, ZSTOP=_ZSTOPGUN_;
RUN, METHOD = "PARALLEL-T", BEAM = beam1, FIELDSOLVER = Fs1, DISTRIBUTION = Dist1;
ENDTRACK;
TRACK, LINE=InjectorPhase3, BEAM=beam1, MAXSTEPS=1000000, DT=_DT_, ZSTOP=_ZSTOP_;
RUN, METHOD = "PARALLEL-T", BEAM=beam1, FIELDSOLVER=Fs1;
ENDTRACK;
}
QUIT;
#include "Simulation/OpalSimulation.h"
#include "Util/Types.h"
#include <string>
#include <iostream>
#include <map>
int main(int argc, char** argv) {
Param_t params;
params.insert(std::pair<std::string, double>("QBUNCH", 1e-10));
params.insert(std::pair<std::string, double>("NSLICE", 100));
reqVars_t requestedVars;
reqVarInfo_t v1 = {EVALUATE, 0.0, 1};
reqVarInfo_t v2 = {EVALUATE, 0.0, 1};
requestedVars.insert(std::pair< std::string, reqVarInfo_t >("E", v1));
requestedVars.insert(std::pair< std::string, reqVarInfo_t >("dE", v2));
OpalSimulation *sim = new OpalSimulation(params, requestedVars, "test-sim");
//FIXME: use scheduler, see how blocking works
sim->run();
sim->collectResults();
reqVars_t res = sim->getResults();
reqVars_t::iterator it;
for(it = res.begin(); it != res.end(); it++)
std::cout << it->first << " = " << it->second.value << std::endl;
return 0;
}
#include "Simulation/OpalSimulation.h"
#include "Util/Types.h"
#include <string>
#include <iostream>
#include <map>
void test_callback(reqVars_t res);
int main(int argc, char** argv) {
Param_t params;
params.insert(std::pair<std::string, double>("QBUNCH", 1e-10));
params.insert(std::pair<std::string, double>("NSLICE", 100));
reqVars_t requestedVars;
reqVarInfo_t v1 = {EVALUATE, 0.0, 1};
reqVarInfo_t v2 = {EVALUATE, 0.0, 1};
requestedVars.insert(std::pair< std::string, reqVarInfo_t >("E", v1));
requestedVars.insert(std::pair< std::string, reqVarInfo_t >("dE", v2));
SimulationScheduler *scheduler = SimulationScheduler::Instance();
scheduler_m->dispatchSimulation("test-sim", params, requestedVars, test_callback);
reqVars_t::iterator it;
for(it = res.begin(); it != res.end(); it++)
std::cout << it->first << " = " << it->second.value << std::endl;
return 0;
}
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