Commit afd07af3 authored by gsell's avatar gsell

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
This diff is collapsed.
#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