47 #define CHECK_CYC_FSCANF_EOF(arg) if (arg == EOF)\
48 throw GeneralClassicException("Cyclotron::getFieldFromFile",\
49 "fscanf returned EOF at " #arg);
60 fieldType_m(right.fieldType_m),
61 fmapfn_m(right.fmapfn_m),
62 rffrequ_m(right.rffrequ_m),
63 rfphi_m(right.rfphi_m),
64 escale_m(right.escale_m),
65 superpose_m(right.superpose_m),
66 symmetry_m(right.symmetry_m),
67 rinit_m(right.rinit_m),
68 prinit_m(right.prinit_m),
69 phiinit_m(right.phiinit_m),
70 zinit_m(right.zinit_m),
71 pzinit_m(right.pzinit_m),
72 spiralFlag_m(right.spiralFlag_m),
73 trimCoilThreshold_m(right.trimCoilThreshold_m),
74 typeName_m(right.typeName_m),
76 bscale_m(right.bscale_m),
77 trimcoils_m(right.trimcoils_m),
82 fmLowE_m(right.fmLowE_m),
83 fmHighE_m(right.fmHighE_m),
84 RFfilename_m(right.RFfilename_m),
85 RFFCoeff_fn_m(right.RFFCoeff_fn_m),
86 RFVCoeff_fn_m(right.RFVCoeff_fn_m) {
99 double* br,
double* bz) {
101 trimcoil->applyField(r, z, tet_rad, br, bz);
106 const double tet_rad,
107 double& br,
double& bz) {
186 "Cyclotron::getFieldMapFN",
187 "The attribute FMAPFN isn't set for the CYCLOTRON element");
188 }
else if (std::filesystem::exists(
fmapfn_m)) {
192 "Failed to open file '" +
fmapfn_m +
193 "', please check if it exists");
218 "RFPHI not defined for CYCLOTRON");
231 "RFFREQ not defined for CYCLOTRON");
244 "SUPERPOSE not defined for CYCLOTRON");
289 "ESCALE not defined for CYCLOTRON");
322 "MINR must be positive");
331 "The attribute MAXR has to be higher than MINR");
352 "The attribute MAXZ has to be higher than MINZ");
377 static const std::map<std::string, BFieldType> typeStringToBFieldType_s = {
389 "Cyclotron::setBFieldType",
390 "The attribute TYPE isn't set for the CYCLOTRON element");
403 if ( (refZ < minz_m || refZ >
maxz_m) ||
404 (refR < minr_m || refR >
maxr_m) ) {
406 "Cyclotron::checkInitialReferenceParticle",
407 "The initial position of the reference particle (RINIT, ZINIT) "
408 "must be in the range of (MINR, MAXR) and (MINZ, MAXZ)");
413 "PHIINIT is out of [-180, 180)");
419 bool flagNeedUpdate =
false;
425 flagNeedUpdate =
true;
427 <<
" out of the global aperture of cyclotron!" <<
endl;
433 if (flagNeedUpdate) {
435 <<
" out of the field map boundary!" <<
endl;
441 if (flagNeedUpdate) {
448 return flagNeedUpdate;
461 }
else if (R[0] < 0.0) {
475 double brint = 0.0, btint = 0.0, bzint = 0.0;
477 const double rad = std::hypot(R[0],R[1]);
478 if ( this->
interpolate(rad, tet, brint, btint, bzint) ) {
481 double br = - brint * R[2];
484 double bt = - btint / rad * R[2];
504 std::vector<Fieldmap>::const_iterator fi =
RFfields_m.begin();
505 std::vector<double>::const_iterator rffi =
rffrequ_m.begin();
506 std::vector<double>::const_iterator rfphii =
rfphi_m.begin();
507 std::vector<double>::const_iterator escali =
escale_m.begin();
508 std::vector<bool>::const_iterator superposei =
superpose_m.begin();
509 std::vector<std::vector<double>>::const_iterator rffci =
rffc_m.begin();
510 std::vector<std::vector<double>>::const_iterator rfvci =
rfvc_m.begin();
512 double xBegin(0), xEnd(0), yBegin(0), yEnd(0), zBegin(0), zEnd(0);
515 for (; fi !=
RFfields_m.end(); ++fi, ++rffi, ++rfphii, ++escali, ++superposei) {
516 (*fi)->getFieldDimensions(xBegin, xEnd, yBegin, yEnd, zBegin, zEnd);
517 if (fcount > 0 && *superposei ==
false)
continue;
523 if (temp_R(0) < xBegin || temp_R(0) > xEnd ||
524 temp_R(1) < yBegin || temp_R(1) > yEnd ||
525 temp_R(2) < zBegin || temp_R(2) > zEnd)
continue;
527 Vector_t tmpE(0.0, 0.0, 0.0), tmpB(0.0, 0.0, 0.0);
529 if ((*fi)->getFieldstrength(temp_R, tmpE, tmpB))
continue;
533 double frequency = (*rffi);
534 double ebscale = (*escali);
538 for (
const double fcoef : (*rffci)) {
540 frequency += fcoef * powert;
543 for (
const double vcoef : (*rfvci)) {
545 ebscale += vcoef * powert;
551 E += ebscale *
std::cos(phase) * tmpE;
552 B -= ebscale *
std::sin(phase) * tmpB;
560 phase_print =
std::fmod(phase_print, 360) - 360.0;
562 *gmsg <<
endl <<
"Gap 1 phase = " << phase_print <<
" Deg" <<
endl;
563 *gmsg <<
"Gap 1 E-Field = (" << E[0] <<
"/" << E[1] <<
"/" << E[2] <<
")" <<
endl;
564 *gmsg <<
"Gap 1 B-Field = (" << B[0] <<
"/" << B[1] <<
"/" << B[2] <<
")" <<
endl;
565 *gmsg <<
"RF Frequency = " << frequency <<
" MHz" <<
endl;
569 phase_print =
std::fmod(phase_print, 360) - 360.0;
571 *gmsg <<
endl <<
"Gap 2 phase = " << phase_print <<
" Deg" <<
endl;
572 *gmsg <<
"Gap 2 E-Field = (" << E[0] <<
"/" << E[1] <<
"/" << E[2] <<
")" <<
endl;
573 *gmsg <<
"Gap 2 B-Field = (" << B[0] <<
"/" << B[1] <<
"/" << B[2] <<
")" <<
endl;
574 *gmsg <<
"RF Frequency = " << frequency <<
" MHz" <<
endl;
585 const double& tet_rad,
double& br,
586 double& bt,
double& bz) {
594 *gmsg <<
"* Finalize cyclotron " <<
getName() <<
endl;
603 const int krl,
const int lpr) {
605 double C[5][5][3], FAC[3];
706 for (j = 0; j < 5; j++) {
707 result += C[j][krl][kor] * *(f + j * lpr);
710 return result / (FAC[kor] *
std::pow(dx, (kor + 1)));
715 const double& tet_rad,
723 const int ir = (
int)xir;
726 const double wr1 = xir - (double)ir;
728 const double wr2 = 1.0 - wr1;
737 const double wt1 = xit - (double)it;
738 const double wt2 = 1.0 - wt1;
745 int r1t1, r2t1, r1t2, r2t2;
755 r1t1 = it + ntetS * ir - 1;
766 r2t1 =
idx(ir + 1, it);
767 r1t2 =
idx(ir , it + 1);
768 r2t2 =
idx(ir + 1, it + 1);
800 *gmsg <<
"* Read field data from PSI format field map file" <<
endl;
805 *gmsg <<
"* Read data from 450MeV Carbon cyclotron field file" <<
endl;
810 *gmsg <<
"* Read data from 100MeV H- cyclotron CYCIAE-100 field file" <<
endl;
815 *gmsg <<
"* Read AVFEQ data (Riken)" <<
endl;
820 *gmsg <<
"* Read FFA data MSU/FNAL" <<
endl;
825 *gmsg <<
"* Read both median plane B field map and 3D E field map of RF cavity for compact cyclotron" <<
endl;
830 *gmsg <<
"* Read midplane B-field, 3D RF fieldmaps, and text files with RF frequency/Voltage coefficients for Synchrocyclotron" <<
endl;
836 "Unknown TYPE for the CYCLOTRON element");
872 int dkFromEdge = k - kEdge;
873 int index =
idx(i, k);
874 int indexkEdge =
idx(i, kEdge);
890 int irtak = i - iredg;
891 int index =
idx(i, k);
892 int indexredg =
idx(iredg, k);
921 int istart =
idx(i, 0);
959 for (
int i = 0; i < nrad; i++) {
974 this->
read(scaleFactor);
986 *gmsg <<
"* ----------------------------------------------" <<
endl;
987 *gmsg <<
"* READ IN RING FIELD MAP " <<
endl;
988 *gmsg <<
"* (The first data block is useless) " <<
endl;
989 *gmsg <<
"* ----------------------------------------------" <<
endl;
993 f = std::fopen(
fmapfn_m.c_str(),
"r");
996 *gmsg <<
"* Minimal radius of measured field map: " <<
BP_m.
rmin_m <<
" [mm]" <<
endl;
1002 *gmsg <<
"* Stepsize in radial direction: " <<
BP_m.
delr_m <<
" [mm]" <<
endl;
1006 *gmsg <<
"* Minimal angle of measured field map: " <<
BP_m.
tetmin_m <<
" [deg]" <<
endl;
1011 *gmsg <<
"* Stepsize in azimuth direction: " <<
BP_m.
dtet_m <<
" [deg]" <<
endl;
1013 for (
int i = 0; i < 13; i++) {
1026 for (
int i = 0; i < 5; i++) {
1032 for (
int i = 0; i < 4; i++) {
1036 for (
int i = 0; i < lpar; i++) {
1039 for (
int i = 0; i < 6; i++) {
1043 for (
int i = 0; i < 10000; i++) {
1045 if (std::strcmp(fout,
"LREC=") == 0)
break;
1048 for (
int i = 0; i < 5; i++) {
1052 *gmsg <<
"* Total stored grid point number ( ntetS * nrad ): " <<
Bfield_m.
ntot_m <<
endl;
1059 *gmsg <<
"* Read-in loop one block per radius" <<
endl;
1060 *gmsg <<
"* Rescaling of the magnetic fields with factor: " <<
BP_m.
Bfact_m <<
endl;
1063 for (
int dummy = 0; dummy < 6; dummy++) {
1086 *gmsg <<
"* Field Map read successfully!" << endl <<
endl;
1111 std::vector<double> rv;
1112 std::vector<double> thv;
1113 std::vector<double> xv;
1114 std::vector<double> yv;
1115 std::vector<double> bzv;
1118 *gmsg <<
"* ----------------------------------------------" <<
endl;
1119 *gmsg <<
"* READ IN FFA FIELD MAP " <<
endl;
1120 *gmsg <<
"* ----------------------------------------------" <<
endl;
1124 std::ifstream file_to_read(
fmapfn_m.c_str());
1125 const int max_num_of_char_in_a_line = 128;
1126 const int num_of_header_lines = 1;
1129 for (
int i = 0; i < num_of_header_lines; ++i)
1130 file_to_read.ignore(max_num_of_char_in_a_line,
'\n');
1132 while(!file_to_read.eof()) {
1133 double r, th, x, y, bz;
1134 file_to_read >> r >> th >> x >> y >> bz;
1135 if ((
int)th != 360) {
1144 double maxtheta = 360.0;
1147 double rmax = rv.back();
1150 for (vit = rv.begin(); *vit <=
BP_m.
rmin_m; ++vit) {}
1159 *gmsg <<
"* Maximal radius of measured field map: " <<
Units::m2mm * rmax <<
" [mm]" <<
endl;
1161 *gmsg <<
"* Minimal angle of measured field map: " <<
BP_m.
tetmin_m <<
" [deg]" <<
endl;
1162 *gmsg <<
"* Maximal angle of measured field map: " << maxtheta <<
" [deg]" <<
endl;
1166 *gmsg <<
"* Stepsize in azimuth direction: " <<
BP_m.
dtet_m <<
" [deg]" <<
endl;
1171 *gmsg <<
"* Total stored grid point number ( ntetS * nrad ): " <<
Bfield_m.
ntot_m <<
endl;
1178 *gmsg <<
"* Rescaling of the magnetic fields with factor: " <<
BP_m.
Bfact_m <<
endl;
1191 *gmsg <<
"* Number of elements read: " << count <<
endl;
1192 *gmsg <<
"* Field Map read successfully!" << endl <<
endl;
1199 *gmsg <<
"* ----------------------------------------------" <<
endl;
1200 *gmsg <<
"* READ IN AVFEQ CYCLOTRON FIELD MAP " <<
endl;
1201 *gmsg <<
"* ----------------------------------------------" <<
endl;
1219 f = std::fopen(
fmapfn_m.c_str(),
"r");
1222 *gmsg <<
"* Minimal radius of measured field map: " <<
BP_m.
rmin_m <<
" [mm]" <<
endl;
1227 *gmsg <<
"* Maximal radius of measured field map: " << rmax <<
" [mm]" <<
endl;
1231 *gmsg <<
"* Stepsize in radial direction: " <<
BP_m.
delr_m <<
" [mm]" <<
endl;
1235 *gmsg <<
"* Minimal angle of measured field map: " <<
BP_m.
tetmin_m <<
" [deg]" <<
endl;
1239 *gmsg <<
"* Maximal angle of measured field map: " << tetmax <<
" [deg]" <<
endl;
1245 *gmsg <<
"* Stepsize in azimuth direction: " <<
BP_m.
dtet_m <<
" [deg]" <<
endl;
1255 *gmsg <<
"* Total stored grid point number ( ntetS * nrad ): "
1263 *gmsg <<
"* Rescaling of the magnetic fields with factor: " <<
BP_m.
Bfact_m <<
endl;
1281 *gmsg <<
"* Number of elements read: " << count <<
endl;
1282 *gmsg <<
"* Field Map read successfully!" << endl <<
endl;
1289 *gmsg <<
"* ----------------------------------------------" <<
endl;
1290 *gmsg <<
"* READ IN CARBON CYCLOTRON FIELD MAP " <<
endl;
1291 *gmsg <<
"* ----------------------------------------------" <<
endl;
1295 f = std::fopen(
fmapfn_m.c_str(),
"r");
1298 *gmsg <<
"* Minimal radius of measured field map: " <<
BP_m.
rmin_m <<
" [mm]" <<
endl;
1304 *gmsg <<
"* Stepsize in radial direction: " <<
BP_m.
delr_m <<
" [mm]" <<
endl;
1308 *gmsg <<
"* Minimal angle of measured field map: " <<
BP_m.
tetmin_m <<
" [deg]" <<
endl;
1313 *gmsg <<
"* Stepsize in azimuthal direction: " <<
BP_m.
dtet_m <<
" [deg]" <<
endl;
1328 *gmsg <<
"* Adding a guard cell along azimuth" <<
endl;
1329 *gmsg <<
"* Total stored grid point number ((ntet+1) * nrad): " <<
Bfield_m.
ntot_m <<
endl;
1335 *gmsg <<
"* Rescaling of the magnetic fields with factor: " <<
BP_m.
Bfact_m <<
endl;
1349 *gmsg <<
"* Field Map read successfully!" << endl <<
endl;
1359 *gmsg <<
"* ----------------------------------------------" <<
endl;
1360 *gmsg <<
"* READ IN CYCIAE-100 CYCLOTRON FIELD MAP " <<
endl;
1361 *gmsg <<
"* ----------------------------------------------" <<
endl;
1365 f = std::fopen(
fmapfn_m.c_str(),
"r");
1368 *gmsg <<
"* Minimal radius of measured field map: " <<
BP_m.
rmin_m <<
" [mm]" <<
endl;
1372 *gmsg <<
"* Stepsize in radial direction: " <<
BP_m.
delr_m <<
" [mm]" <<
endl;
1376 *gmsg <<
"* Minimal angle of measured field map: " <<
BP_m.
tetmin_m <<
" [deg]" <<
endl;
1381 *gmsg <<
"* Stepsize in azimuth direction: " <<
BP_m.
dtet_m <<
" [deg]" <<
endl;
1394 *gmsg <<
"* Total stored grid point number ( ntetS * nrad ): " <<
Bfield_m.
ntot_m <<
endl;
1400 *gmsg <<
"* Rescaling of the magnetic fields with factor: " <<
BP_m.
Bfact_m <<
endl;
1405 for (
int ii = 0; ii < 13; ii++) {
1408 for (
int k = 0; k < nHalfPoints; k++) {
1422 *gmsg <<
"* Field Map read successfully!" << endl <<
endl;
1431 *gmsg <<
"* Reading '" << fm <<
"'" <<
endl;
1443 std::vector<std::string>::const_iterator fm =
RFfilename_m.begin();
1444 std::vector<std::string>::const_iterator rffcfni =
RFFCoeff_fn_m.begin();
1445 std::vector<std::string>::const_iterator rfvcfni =
RFVCoeff_fn_m.begin();
1448 FILE *rffcf =
nullptr;
1449 FILE *rfvcf =
nullptr;
1452 *gmsg <<
"* ------------------------------------------------------------" <<
endl;
1453 *gmsg <<
"* READ IN 3D RF Fields and Frequency Coefficients " <<
endl;
1454 *gmsg <<
"* ------------------------------------------------------------" <<
endl;
1456 for (; fm !=
RFfilename_m.end(); ++fm, ++rffcfni, ++rfvcfni, ++fcount) {
1463 *gmsg <<
"RF Frequency Coefficient Filename: " << (*rffcfni) <<
endl;
1465 rffcf = std::fopen((*rffcfni).c_str(),
"r");
1467 if (rffcf ==
nullptr) {
1469 "Cyclotron::getFieldFromFile_Synchrocyclotron",
1470 "failed to open file '" + *rffcfni +
"', please check if it exists");
1473 std::vector<double> fcoeff;
1478 *gmsg <<
"* Number of coefficients in file: " << nc <<
endl;
1479 for (
int k = 0; k < nc; k++) {
1481 fcoeff.push_back(value);
1484 rffc_m.push_back(fcoeff);
1489 *gmsg <<
"RF Voltage Coefficient Filename: " << (*rfvcfni) <<
endl;
1491 rfvcf = std::fopen((*rfvcfni).c_str(),
"r");
1492 if (rfvcf ==
nullptr) {
1494 "Cyclotron::getFieldFromFile_Synchrocyclotron",
1495 "failed to open file '" + *rfvcfni +
"', please check if it exists");
1498 std::vector<double> vcoeff;
1501 *gmsg <<
"* Number of coefficients in file: " << nc <<
endl;
1502 for (
int k = 0; k < nc; k++) {
1504 vcoeff.push_back(value);
1507 rfvc_m.push_back(vcoeff);
1526 fp1.open(fname, std::ios::out);
1544 fp2.open(fname, std::ios::out);
1548 Vector_t tmpE(0.0, 0.0, 0.0), tmpB(0.0, 0.0, 0.0);
1550 Vector_t E(0.0, 0.0, 0.0), B(0.0, 0.0, 0.0);
1551 if (!fi->getFieldstrength(tmpR, tmpE, tmpB)) {
1556 fp2 << tmpR <<
" \t E= " << tmpE <<
"\t B= " << tmpB <<
std::endl;
1559 *gmsg <<
"\n* Writing 'gnu.out' and 'eb.out' files of cyclotron field maps\n" <<
endl;
1562 *gmsg <<
"\n* Writing 'gnu.out' file of cyclotron field map\n" <<
endl;
1566 #undef CHECK_CYC_FSCANF_EOF
std::vector< double > dbr_m
void setPHIinit(double phiinit)
static OpalData * getInstance()
std::vector< double > rffrequ_m
virtual double getFMHighE() const
void setFieldMapFN(const std::string &fmapfn)
void setCyclHarm(double h)
void getFieldFromFile_Carbon(const double &scaleFactor)
void setPZinit(double zinit)
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of it
T rad(T x)
Convert degrees to radians.
std::vector< TrimCoil * > trimcoils_m
constexpr double two_pi
The value of .
int idx(int irad, int ktet)
void setEScale(std::vector< double > bs)
void read(const double &scaleFactor)
void setPRinit(double prinit)
std::vector< Fieldmap > RFfields_m
virtual void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField)
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
std::vector< double > dbrtt_m
void getFieldFromFile_Ring(const double &scaleFactor)
void setRfPhi(std::vector< double > f)
ParticleAttrib< Vector_t > P
void setSymmetry(double symmetry)
void setRfFrequ(std::vector< double > f)
virtual std::string getFieldMapFN() const
std::vector< double > dbrrr_m
Vektor< double, 3 > Vector_t
std::vector< double > g3_m
unsigned int getNumberOfTrimcoils() const
bool angleBetweenAngles(const double angle, const double min, const double max)
check if angle (in rad and in range [0,2pi]) is within [min, max]
void setTrimCoilThreshold(double)
ParticleAttrib< short > bunchNum
virtual double getPRinit() const
ParticleAttrib< double > M
std::unique_ptr< LossDataSink > lossDs_m
std::vector< bool > superpose_m
PartBunchBase< double, 3 > * RefPartBunch_m
virtual bool bends() const
void setZinit(double zinit)
virtual double getRmax() const
void getFieldFromFile_Synchrocyclotron(const double &scaleFactor)
virtual const std::string & getName() const
Get element name.
void setRFVCoeffFN(std::vector< std::string > rfv_coeff_fn)
constexpr double pi
The value of .
BFieldType getBFieldType() const
virtual std::vector< bool > getSuperpose() const
Inform & endl(Inform &inf)
std::vector< double > escale_m
PETE_TUTree< FnArcTan, typename T::PETE_Expr_t > atan(const PETE_Expr< T > &l)
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
virtual double getRmin() const
virtual double getRinit() const
std::vector< std::string > RFfilename_m
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
std::vector< double > dbrr_m
bool interpolate(const double &rad, const double &tet_rad, double &br, double &bt, double &bz)
std::vector< double > dbttt_m
std::shared_ptr< _Fieldmap > Fieldmap
void setCyclotronType(const std::string &type)
std::string::iterator iterator
double gutdf5d(double *f, double dx, const int kor, const int krl, const int lpr)
std::vector< double > f3_m
void setBScale(double bs)
virtual void visitCyclotron(const Cyclotron &)=0
Apply the algorithm to a cyclotron.
virtual bool getSpiralFlag() const
void setFMHighE(double e)
std::vector< double > f2_m
std::string getAuxiliaryOutputDirectory() const
get the name of the the additional data directory
virtual double getZinit() const
virtual double getMaxZ() const
Inform & level4(Inform &inf)
std::vector< std::vector< double > > rfvc_m
void setSpiralFlag(bool spiral_flag)
void setTrimCoils(const std::vector< TrimCoil * > &trimcoils)
void writeOutputFieldFiles()
ParticleAttrib< double > Q
void setSuperpose(std::vector< bool > flag)
virtual double getSymmetry() const
void initR(double rmin, double dr, int nrad)
const std::string & getCyclotronType() const
std::vector< double > rarr_m
void applyTrimCoil(const double r, const double z, const double tet_rad, double &br, double &bz)
Apply trim coils (calculate field contributions) with smooth field transition.
virtual double getMaxR() const
Tps< T > cos(const Tps< T > &x)
Cosine.
virtual double getTrimCoilThreshold() const
double trimCoilThreshold_m
std::vector< std::vector< double > > rffc_m
PETE_TBTree< FnFmod, PETE_Scalar< Vektor< T1, Dim > >, typename T2::PETE_Expr_t > fmod(const Vektor< T1, Dim > &l, const PETE_Expr< T2 > &r)
std::vector< std::string > RFVCoeff_fn_m
std::string combineFilePath(std::initializer_list< std::string > ilist)
std::vector< double > dbt_m
virtual bool apply(const size_t &id, const double &t, Vector_t &E, Vector_t &B)
virtual std::vector< double > getEScale() const
void setRfFieldMapFN(std::vector< std::string > rffmapfn)
void setRinit(double rinit)
virtual std::vector< double > getRfPhi() const
std::vector< double > bfld_m
void fp2(BareField< T, 2U > &field, bool docomm=true)
virtual double getCyclHarm() const
virtual double getMinR() const
void applyTrimCoil_m(const double r, const double z, const double tet_rad, double *br, double *bz)
Apply trim coils (calculate field contributions)
virtual void getDimensions(double &zBegin, double &zEnd) const
std::vector< double > dbrrt_m
void fp1(BareField< T, 1U > &field, bool docomm=true)
virtual double getPHIinit() const
constexpr double e
The value of .
std::vector< double > dbrt_m
virtual double getBScale() const
std::vector< double > rfphi_m
void getFieldFromFile_AVFEQ(const double &scaleFactor)
virtual ElementType getType() const
Get element type std::string.
ParticleAttrib< int > Bin
void setRFFCoeffFN(std::vector< std::string > rff_coeff_fn)
#define CHECK_CYC_FSCANF_EOF(arg)
Interface for a single beam element.
std::vector< double > dbtt_m
void checkInitialReferenceParticle(double refR, double refTheta, double refZ)
std::string getOutputFN() const
Get output filename.
Tps< T > pow(const Tps< T > &x, int y)
Integer power.
Tps< T > sin(const Tps< T > &x)
Sine.
void getFieldFromFile_CYCIAE(const double &scaleFactor)
void getFieldFromFile_BandRF(const double &scaleFactor)
virtual std::vector< double > getRfFrequ() const
virtual double getPZinit() const
std::vector< std::string > RFFCoeff_fn_m
static Fieldmap getFieldmap(std::string Filename, bool fast=false)
void getFieldFromFile_FFA(const double &scaleFactor)
virtual double getFMLowE() const
virtual void accept(BeamlineVisitor &) const
Apply visitor to Cyclotron.
virtual double getMinZ() const