~max-mcginley/third-order-lie-map/generator

« back to all changes in this revision

Viewing changes to max_globals.hh

  • Committer: Max McGinley
  • Date: 2015-09-10 17:13:14 UTC
  • Revision ID: max.mcginley@stfc.ac.uk-20150910171314-dsy6iqs2u3qhm3u4
More tests added

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#include <string>
5
5
#include <iostream>
6
6
#include <cmath>
7
 
 
8
 
static const double stepSizePlot = 10.0;
9
 
 
10
 
static const char* lattice_locale = "lattices";
11
 
 
12
 
static std::string lattice_filepath(const char* name) {return std::string(lattice_locale) + std::string("/") + std::string(name) + std::string("/StepPi.") + std::string(name) + std::string(".dat");}
13
 
static const int numberOfParticles = 96;
14
 
 
15
 
static const double stepSize = 2.0;
16
 
static const double posScale = 0.001;
17
 
static const double momScale = 0.001;
18
 
 
19
 
static const double lengthScale = 1.0/299.792; //One millimeter in terms of base units ns ie 1/c in ns mm^-1
20
 
static const double lightSpeed = 299792458.;
21
 
static const double kiloTeslaScale = 89856.7; // One kilotesla. Energy is in MeV. Base units are 1ns and 1Mev. 1kT = 10e3 kg A^-1 s^-2 = kiloTeslaScale * MeV ns^-1
22
 
static const double sigma = 2000.; //a convenient length scale, in mm
23
 
static const double muonMass = 105.65837;
24
 
static const double refMomentum = 200.;
25
 
static const double refEnergy = std::sqrt(refMomentum*refMomentum + muonMass*muonMass);
 
7
#include <vector>
 
8
 
 
9
extern const double stepSizePlot;
 
10
 
 
11
extern const char* lattice_locale;
 
12
 
 
13
std::string lattice_filepath(const char* name);
 
14
extern const int numberOfParticles;
 
15
 
 
16
extern const double stepSize;
 
17
extern const double posScale;
 
18
extern const double momScale;
 
19
 
 
20
extern const double lengthScale; //One millimeter in terms of base units ns ie 1/c in ns mm^-1
 
21
extern const double lightSpeed;
 
22
extern const double kiloTeslaScale; // One kilotesla. Energy is in MeV. Base units are 1ns and 1Mev. 1kT = 10e3 kg A^-1 s^-2 = kiloTeslaScale * MeV ns^-1
 
23
extern const double sigma; //a convenient length scale, in mm
 
24
extern const double muonMass;
 
25
extern const double refMomentum;
 
26
extern const double refEnergy;
26
27
 
27
28
//Constants for tabulating Bfield data
28
 
static const double stepSizeFieldPlot = 0.03125;
29
 
static const double zRoundingValueB = 64.0; //Rounds z to the nearest 1/<value>. Ensure <val> > 1.0/stepSizeFieldPlot   
30
 
static const double reducedStep = 0.25;
31
 
static const double zRoundingValue2 = 8.0;
 
29
extern const double stepSizeFieldPlot;
 
30
extern const double zRoundingValueB; //Rounds z to the nearest 1/<value>. Ensure <val> > 1.0/stepSizeFieldPlot  
 
31
extern const double reducedStep;
 
32
extern const double zRoundingValue2;
 
33
extern const double muonCharge;
32
34
 
33
35
//equation parameters
34
 
static const double peakB = 0.002;
35
 
static const double bumpLength = 3000.0;
 
36
extern const double peakB;
 
37
extern const double bumpLength;
36
38
 
37
 
static const int numberOfEmittanceParticles = 10000;
38
 
static const double defaultPosMomRation = std::sqrt(sigma/refMomentum);
39
 
static const int inOutValues = 40;
40
 
static const double maxEmittanceIn = 1200.0;
 
39
extern const int numberOfEmittanceParticles;
 
40
extern const double defaultPosMomRation;
 
41
extern const int inOutValues;
 
42
extern const double maxEmittanceIn;
41
43
 
42
44
//Encoded index values for the non-zero coefficients of the H4 expression
43
 
static const int hamiltonianCoefficientCodes[19] = {256, 1152, 2048, 641, 200, 1537, 1096, 130, 1040, 1026, 144, 585, 515, 74, 529, 88, 4, 18, 32};
44
 
 
45
 
static bool streaming = true;
46
 
 
47
 
static void turnOffStream() {streaming = false;}
48
 
static void turnOnStream() {streaming = true;}
49
 
 
50
 
static std::ostream& getCurrentStream() {
51
 
        //if (streaming) return std::cout;
52
 
        return std::cerr;
53
 
}
 
45
extern const std::vector<std::vector<int> > hamiltonianCoefficientCodes;
 
46
 
 
47
extern bool streaming;
 
48
 
 
49
extern void turnOffStream();
 
50
extern void turnOnStream();
 
51
 
 
52
extern std::ostream& getCurrentStream();
54
53
 
55
54
#endif