BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
coolingchannel.h
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef COOLINGCHANNEL_H
20#define COOLINGCHANNEL_H
21
22#include <iomanip>
23#include <iostream>
24#include <list>
25#include <map>
26#include <string>
27
28#include "published.h"
29
30namespace GMAD
31{
38 class CoolingChannel: public Published<CoolingChannel>
39 {
40 public:
41 std::string name;
42
43 std::string surroundingMaterial;
44
45 int nCells;
46 double cellLengthZ;
47
48 int nCoils;
49 std::list<double> coilInnerRadius;
50 std::list<double> coilRadialThickness;
51 std::list<double> coilLengthZ;
52 std::list<double> coilCurrent;
53 std::list<double> coilOffsetZ;
54 std::list<std::string> coilMaterial;
55 bool mirrorCoils;
56 double onAxisTolerance;
57 int nSheets;
58
59 int nDipoles;
60 std::list<double> dipoleAperture;
61 std::list<double> dipoleLengthZ;
62 std::list<double> dipoleFieldStrength;
63 std::list<double> dipoleEngeCoefficient;
64 std::list<double> dipoleOffsetZ;
65
66 int nAbsorbers;
67 std::list<std::string> absorberType;
68 std::list<std::string> absorberMaterial;
69 std::list<double> absorberOffsetZ;
70 std::list<double> absorberCylinderLength;
71 std::list<double> absorberCylinderRadius;
72 std::list<double> absorberWedgeOpeningAngle;
73 std::list<double> absorberWedgeHeight;
74 std::list<double> absorberWedgeRotationAngle;
75 std::list<double> absorberWedgeOffsetX;
76 std::list<double> absorberWedgeOffsetY;
77 std::list<double> absorberWedgeApexToBase;
78
79 int nRFCavities;
80 std::list<double> rfOffsetZ;
81 std::list<double> rfLength;
82 std::list<double> rfVoltage;
83 std::list<double> rfPhase;
84 std::list<double> rfFrequency;
85 std::list<double> rfWindowThickness;
86 std::list<std::string> rfWindowMaterial;
87 std::list<double> rfWindowRadius;
88 std::list<std::string> rfCavityMaterial;
89 std::list<std::string> rfCavityVacuumMaterial;
90 std::list<double> rfCavityRadius;
91 std::list<double> rfCavityThickness;
92 std::list<double> rfTimeOffset;
93
94 std::string integrator;
95 std::string magneticFieldModel;
96 std::string electricFieldModel;
97 std::string dipoleFieldModel;
98
102 void clear();
104 void print()const;
106 template <typename T>
107 void set_value(const std::string& property, T value);
108 // Template overloading for Array pointers
110 void set_value(const std::string& property, Array* value);
111
112 private:
114 void PublishMembers();
115
116 std::map<std::string, std::list<double>*> attribute_map_list_double;
117 std::map<std::string, std::list<std::string>*> attribute_map_list_string;
118 };
119
120 template <typename T>
121 void CoolingChannel::set_value(const std::string& property, T value)
122 {
123#ifdef BDSDEBUG
124 std::cout << "coolingchannel> Setting value " << std::setw(25) << std::left << property << value << std::endl;
125#endif
126 // member method can throw runtime_error, catch and exit gracefully
127 try
128 {set(this,property,value);}
129 catch(const std::runtime_error&)
130 {
131 std::cerr << "Error: coolingchannel> unknown option \"" << property << "\" with value " << value << std::endl;
132 exit(1);
133 }
134 }
135}
136
137#endif
Representation of arrays used in tokens.
Definition array.h:40
Cooling channel parameters.
void print() const
Print some properties.
CoolingChannel()
Constructor.
std::string name
Object name.
void PublishMembers()
publish members
void set_value(const std::string &property, T value)
Set methods by property name and value.
Class that provides introspection to its members.
Definition published.h:49
void set(CoolingChannel *instance, const std::string &name, double value)
Definition published.h:101
Parser namespace for GMAD language. Combination of Geant4 and MAD.