diff --git a/src/Algorithms/ParallelCyclotronTracker.cpp b/src/Algorithms/ParallelCyclotronTracker.cpp index b6f969bef5e5e269ad455b4b79d32511fa61bdf2..78f9f5c14884d490ba36a2c60f74970a4c5f3aef 100644 --- a/src/Algorithms/ParallelCyclotronTracker.cpp +++ b/src/Algorithms/ParallelCyclotronTracker.cpp @@ -7,7 +7,7 @@ // ------------------------------------------------------------------------ // // Class: ParallelCyclotronTracker -// The class for tracking particles with 3D space charge in Cyclotrons and FFAGs +// The class for tracking particles with 3D space charge in Cyclotrons and FFAs // // ------------------------------------------------------------------------ // @@ -52,7 +52,7 @@ #include "AbsBeamline/RFQuadrupole.h" #include "AbsBeamline/SBend.h" #include "AbsBeamline/SBend3D.h" -#include "AbsBeamline/ScalingFFAGMagnet.h" +#include "AbsBeamline/ScalingFFAMagnet.h" #include "AbsBeamline/Separator.h" #include "AbsBeamline/Septum.h" #include "AbsBeamline/Solenoid.h" @@ -542,7 +542,7 @@ void ParallelCyclotronTracker::visitCyclotron(const Cyclotron &cycl) { * fieldflag = 2, readin carbon cyclotron field file created by Jianjun Yang, TYPE=CARBONCYCL * fieldflag = 3, readin ANSYS format file for CYCIAE-100 created by Jianjun Yang, TYPE=CYCIAE * fieldflag = 4, readin AVFEQ format file for Riken cyclotrons - * fieldflag = 5, readin FFAG format file for MSU/FNAL FFAG + * fieldflag = 5, readin FFA format file for MSU/FNAL FFA * fieldflag = 6, readin both median plane B field map and 3D E field map of RF cavity for compact cyclotron * fieldflag = 7, read in fields for Daniel's synchrocyclotron simulations */ @@ -838,13 +838,13 @@ void ParallelCyclotronTracker::visitSBend3D(const SBend3D &bend) { "Need to define a RINGDEFINITION to use SBend3D element"); } -void ParallelCyclotronTracker::visitScalingFFAGMagnet(const ScalingFFAGMagnet &bend) { - *gmsg << "Adding ScalingFFAGMagnet" << endl; +void ParallelCyclotronTracker::visitScalingFFAMagnet(const ScalingFFAMagnet &bend) { + *gmsg << "Adding ScalingFFAMagnet" << endl; if (opalRing_m != NULL) { opalRing_m->appendElement(bend); } else { - throw OpalException("ParallelCyclotronTracker::visitScalingFFAGMagnet", - "Need to define a RINGDEFINITION to use ScalingFFAGMagnet element"); + throw OpalException("ParallelCyclotronTracker::visitScalingFFAMagnet", + "Need to define a RINGDEFINITION to use ScalingFFAMagnet element"); } } diff --git a/src/Algorithms/ParallelCyclotronTracker.h b/src/Algorithms/ParallelCyclotronTracker.h index f3edf3c55c7bcc830fb8429155224b1a6de0e431..ea4d8538466196e25cb978c4730a1e7436725e57 100644 --- a/src/Algorithms/ParallelCyclotronTracker.h +++ b/src/Algorithms/ParallelCyclotronTracker.h @@ -164,8 +164,8 @@ public: /// Apply the algorithm to a SBend3D. virtual void visitSBend3D(const SBend3D &); - /// Apply the algorithm to a ScalingFFAGMagnet. - virtual void visitScalingFFAGMagnet(const ScalingFFAGMagnet &bend); + /// Apply the algorithm to a ScalingFFAMagnet. + virtual void visitScalingFFAMagnet(const ScalingFFAMagnet &bend); /// Apply the algorithm to a Separator. virtual void visitSeparator(const Separator &); diff --git a/src/Classic/AbsBeamline/BeamlineVisitor.h b/src/Classic/AbsBeamline/BeamlineVisitor.h index 5c6c88413a4b45ef4fad64ed6ef4221536a11129..e51ee65b660a34e4ce1594729ef23bedf7e580ac 100644 --- a/src/Classic/AbsBeamline/BeamlineVisitor.h +++ b/src/Classic/AbsBeamline/BeamlineVisitor.h @@ -63,7 +63,7 @@ class RFQuadrupole; class Ring; class SBend; class SBend3D; -class ScalingFFAGMagnet; +class ScalingFFAMagnet; class Separator; class Septum; class Solenoid; @@ -210,7 +210,7 @@ public: virtual void visitSolenoid(const Solenoid &) = 0; /// Apply the algorithm to a solenoid. - virtual void visitScalingFFAGMagnet(const ScalingFFAGMagnet &) = 0; + virtual void visitScalingFFAMagnet(const ScalingFFAMagnet &) = 0; /// Apply the algorithm to a source. virtual void visitSource(const Source &) = 0; diff --git a/src/Classic/AbsBeamline/CMakeLists.txt b/src/Classic/AbsBeamline/CMakeLists.txt index 2115b06b084f3e27ffa707462db73477de13fa87..a7cb13c1994e9413fbe3ed7f5d00bd4fcb4eb588 100644 --- a/src/Classic/AbsBeamline/CMakeLists.txt +++ b/src/Classic/AbsBeamline/CMakeLists.txt @@ -41,7 +41,7 @@ set (_SRCS Ring.cpp SBend.cpp SBend3D.cpp - ScalingFFAGMagnet.cpp + ScalingFFAMagnet.cpp Separator.cpp Septum.cpp Solenoid.cpp @@ -98,7 +98,7 @@ set (HDRS Ring.h SBend3D.h SBend.h - ScalingFFAGMagnet.h + ScalingFFAMagnet.h SectorFieldMapComponent.h Separator.h Septum.h diff --git a/src/Classic/AbsBeamline/Cyclotron.cpp b/src/Classic/AbsBeamline/Cyclotron.cpp index 48529ce945cf9ab77f614f37a852993b60d5a67a..16ab15eedfbe655a33d56be17667e349b0c237aa 100644 --- a/src/Classic/AbsBeamline/Cyclotron.cpp +++ b/src/Classic/AbsBeamline/Cyclotron.cpp @@ -194,7 +194,7 @@ int Cyclotron::getFieldFlag(const std::string& type) const { * fieldflag = 2, readin carbon cyclotron field file created by Jianjun Yang, TYPE=CARBONCYCL * fieldflag = 3, readin ANSYS format file for CYCIAE-100 created by Jianjun Yang, TYPE=CYCIAE * fieldflag = 4, readin AVFEQ format file for Riken cyclotrons - * fieldflag = 5, readin FFAG format file for MSU/FNAL FFAG + * fieldflag = 5, readin FFA format file for MSU/FNAL FFA * fieldflag = 6, readin both median plane B field map and 3D E field map of RF cavity for compact cyclotron * fieldflag = 7, read in fields for Daniel's synchrocyclotron simulations */ @@ -205,7 +205,7 @@ int Cyclotron::getFieldFlag(const std::string& type) const { fieldflag = 3; } else if(type == std::string("AVFEQ")) { fieldflag = 4; - } else if(type == std::string("FFAG")) { + } else if(type == std::string("FFA")) { fieldflag = 5; } else if(type == std::string("BANDRF")) { fieldflag = 6; @@ -693,9 +693,9 @@ bool Cyclotron::interpolate(const double& rad, // r1t1 : the index of the "min angle, min radius" point in the 2D field array. // considering the array start with index of zero, minus 1. - if(myBFieldType_m != FFAGBF) { + if(myBFieldType_m != FFABF) { /* - For FFAG this does not work + For FFA this does not work */ r1t1 = it + ntetS * ir - 1; r1t2 = r1t1 + 1; @@ -743,7 +743,7 @@ bool Cyclotron::interpolate(const double& rad, void Cyclotron::read(const int &fieldflag, const double &scaleFactor) { - // PSIBF, AVFEQBF, ANSYSBF, FFAGBF + // PSIBF, AVFEQBF, ANSYSBF, FFABF // for your own format field, you should add your own getFieldFromFile() function by yourself. if(fieldflag == 1) { @@ -767,9 +767,9 @@ void Cyclotron::read(const int &fieldflag, const double &scaleFactor) { getFieldFromFile_AVFEQ(scaleFactor); } else if(fieldflag == 5) { - *gmsg << "* Read FFAG data MSU/FNAL " << getBScale() << endl; - myBFieldType_m = FFAGBF; - getFieldFromFile_FFAG(scaleFactor); + *gmsg << "* Read FFA data MSU/FNAL " << getBScale() << endl; + myBFieldType_m = FFABF; + getFieldFromFile_FFA(scaleFactor); } else if(fieldflag == 6) { *gmsg << "* Read both median plane B field map and 3D E field map of RF cavity for compact cyclotron" << getBScale() << endl; @@ -1045,7 +1045,7 @@ void Cyclotron::initialise(PartBunchBase<double, 3> *bunch, const int &fieldflag } -void Cyclotron::getFieldFromFile_FFAG(const double &scaleFactor) { +void Cyclotron::getFieldFromFile_FFA(const double &scaleFactor) { /* Field is read in from ascci file (COSY output) in the oder: @@ -1076,10 +1076,10 @@ void Cyclotron::getFieldFromFile_FFAG(const double &scaleFactor) { vector<double>::iterator vit; *gmsg << "* ----------------------------------------------" << endl; - *gmsg << "* READ IN FFAG FIELD MAP " << endl; + *gmsg << "* READ IN FFA FIELD MAP " << endl; *gmsg << "* ----------------------------------------------" << endl; - BP.Bfact = -10.0; // T->kG and H- for the current FNAL FFAG + BP.Bfact = -10.0; // T->kG and H- for the current FNAL FFA ifstream file_to_read(fmapfn_m.c_str()); const int max_num_of_char_in_a_line = 128; diff --git a/src/Classic/AbsBeamline/Cyclotron.h b/src/Classic/AbsBeamline/Cyclotron.h index f72bc010ad6932809a27eaf187c17994275a76f3..792f41b6520ecd079f0697d912b7d034d5bc83aa 100644 --- a/src/Classic/AbsBeamline/Cyclotron.h +++ b/src/Classic/AbsBeamline/Cyclotron.h @@ -30,7 +30,7 @@ class Fieldmap; class LossDataSink; class TrimCoil; -enum BFieldType {PSIBF,CARBONBF,ANSYSBF,AVFEQBF,FFAGBF,BANDRF,SYNCHRO}; +enum BFieldType {PSIBF,CARBONBF,ANSYSBF,AVFEQBF,FFABF,BANDRF,SYNCHRO}; struct BfieldData { std::string filename; @@ -231,7 +231,7 @@ protected: void getFieldFromFile_Carbon(const double &scaleFactor); void getFieldFromFile_CYCIAE(const double &scaleFactor); void getFieldFromFile_AVFEQ(const double &scaleFactor); - void getFieldFromFile_FFAG(const double &scaleFactor); + void getFieldFromFile_FFA(const double &scaleFactor); void getFieldFromFile_BandRF(const double &scaleFactor); void getFieldFromFile_Synchrocyclotron(const double &scaleFactor); diff --git a/src/Classic/AbsBeamline/ScalingFFAMagnet.cpp b/src/Classic/AbsBeamline/ScalingFFAMagnet.cpp index eed95ab6a5c64415832dd00f505cc04aa253aa44..dbdaeb3e1f11aea50307f3617270254225576aa0 100644 --- a/src/Classic/AbsBeamline/ScalingFFAMagnet.cpp +++ b/src/Classic/AbsBeamline/ScalingFFAMagnet.cpp @@ -27,17 +27,17 @@ #include <cmath> -#include "AbsBeamline/ScalingFFAGMagnet.h" +#include "AbsBeamline/ScalingFFAMagnet.h" #include "Algorithms/PartBunch.h" #include "AbsBeamline/BeamlineVisitor.h" -ScalingFFAGMagnet::ScalingFFAGMagnet(const std::string &name) +ScalingFFAMagnet::ScalingFFAMagnet(const std::string &name) : Component(name), planarArcGeometry_m(1., 1.), dummy(), endField_m(NULL) { setElType(isDrift); } -ScalingFFAGMagnet::ScalingFFAGMagnet(const ScalingFFAGMagnet &right) +ScalingFFAMagnet::ScalingFFAMagnet(const ScalingFFAMagnet &right) : Component(right), planarArcGeometry_m(right.planarArcGeometry_m), dummy(), maxOrder_m(right.maxOrder_m), tanDelta_m(right.tanDelta_m), @@ -56,64 +56,64 @@ ScalingFFAGMagnet::ScalingFFAGMagnet(const ScalingFFAGMagnet &right) r0_m = right.r0_m; } -ScalingFFAGMagnet::~ScalingFFAGMagnet() { +ScalingFFAMagnet::~ScalingFFAMagnet() { if (endField_m != NULL) { delete endField_m; } } -ElementBase* ScalingFFAGMagnet::clone() const { - ScalingFFAGMagnet* magnet = new ScalingFFAGMagnet(*this); +ElementBase* ScalingFFAMagnet::clone() const { + ScalingFFAMagnet* magnet = new ScalingFFAMagnet(*this); magnet->initialise(); return magnet; } -EMField &ScalingFFAGMagnet::getField() { +EMField &ScalingFFAMagnet::getField() { return dummy; } -const EMField &ScalingFFAGMagnet::getField() const { +const EMField &ScalingFFAMagnet::getField() const { return dummy; } -bool ScalingFFAGMagnet::apply(const size_t &i, const double &t, +bool ScalingFFAMagnet::apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B) { return apply(RefPartBunch_m->R[i], RefPartBunch_m->P[i], t, E, B); } -void ScalingFFAGMagnet::initialise() { +void ScalingFFAMagnet::initialise() { calculateDfCoefficients(); planarArcGeometry_m.setElementLength(r0_m*phiEnd_m); // length = phi r planarArcGeometry_m.setCurvature(1./r0_m); } -void ScalingFFAGMagnet::initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField) { +void ScalingFFAMagnet::initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField) { RefPartBunch_m = bunch; initialise(); } -void ScalingFFAGMagnet::finalise() { +void ScalingFFAMagnet::finalise() { RefPartBunch_m = NULL; } -bool ScalingFFAGMagnet::bends() const { +bool ScalingFFAMagnet::bends() const { return true; } -BGeometryBase& ScalingFFAGMagnet::getGeometry() { +BGeometryBase& ScalingFFAMagnet::getGeometry() { return planarArcGeometry_m; } -const BGeometryBase& ScalingFFAGMagnet::getGeometry() const { +const BGeometryBase& ScalingFFAMagnet::getGeometry() const { return planarArcGeometry_m; } -void ScalingFFAGMagnet::accept(BeamlineVisitor& visitor) const { - visitor.visitScalingFFAGMagnet(*this); +void ScalingFFAMagnet::accept(BeamlineVisitor& visitor) const { + visitor.visitScalingFFAMagnet(*this); } -bool ScalingFFAGMagnet::getFieldValue(const Vector_t &R, Vector_t &B) const { +bool ScalingFFAMagnet::getFieldValue(const Vector_t &R, Vector_t &B) const { Vector_t pos = R - centre_m; double r = sqrt(pos[0]*pos[0]+pos[2]*pos[2]); double phi = -atan2(pos[0], pos[2]); // angle between y-axis and position vector in anticlockwise direction @@ -129,7 +129,7 @@ bool ScalingFFAGMagnet::getFieldValue(const Vector_t &R, Vector_t &B) const { } -bool ScalingFFAGMagnet::getFieldValueCylindrical(const Vector_t &pos, Vector_t &B) const { +bool ScalingFFAMagnet::getFieldValueCylindrical(const Vector_t &pos, Vector_t &B) const { double r = pos[0]; double z = pos[1]; @@ -173,12 +173,12 @@ bool ScalingFFAGMagnet::getFieldValueCylindrical(const Vector_t &pos, Vector_t & } -bool ScalingFFAGMagnet::apply(const Vector_t &R, const Vector_t &P, +bool ScalingFFAMagnet::apply(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) { return getFieldValue(R, B); } -void ScalingFFAGMagnet::calculateDfCoefficients() { +void ScalingFFAMagnet::calculateDfCoefficients() { dfCoefficients_m = std::vector<std::vector<double> >(maxOrder_m+1); dfCoefficients_m[0] = std::vector<double>(1, 1.); // f_0 = 1.*0th derivative for (size_t n = 0; n < maxOrder_m; n += 2) { // n indexes the power in z @@ -201,7 +201,7 @@ void ScalingFFAGMagnet::calculateDfCoefficients() { } -void ScalingFFAGMagnet::setEndField(endfieldmodel::EndFieldModel* endField) { +void ScalingFFAMagnet::setEndField(endfieldmodel::EndFieldModel* endField) { if (endField_m != NULL) { delete endField_m; } diff --git a/src/Classic/AbsBeamline/ScalingFFAMagnet.h b/src/Classic/AbsBeamline/ScalingFFAMagnet.h index 1cc799fe4e565821a910163c159c446ec146390d..de0d611754f39fadd204444fe26f4c16e6babb5c 100644 --- a/src/Classic/AbsBeamline/ScalingFFAMagnet.h +++ b/src/Classic/AbsBeamline/ScalingFFAMagnet.h @@ -30,22 +30,22 @@ #include "AbsBeamline/EndFieldModel/EndFieldModel.h" #include "AbsBeamline/Component.h" -#ifndef ABSBEAMLINE_ScalingFFAGMagnet_H -#define ABSBEAMLINE_ScalingFFAGMagnet_H +#ifndef ABSBEAMLINE_ScalingFFAMagnet_H +#define ABSBEAMLINE_ScalingFFAMagnet_H -/** Sector bending magnet with an FFAG-style field index and spiral end shape +/** Sector bending magnet with an FFA-style field index and spiral end shape */ -class ScalingFFAGMagnet : public Component { +class ScalingFFAMagnet : public Component { public: - /** Construct a new ScalingFFAGMagnet + /** Construct a new ScalingFFAMagnet * - * \param name User-defined name of the ScalingFFAGMagnet + * \param name User-defined name of the ScalingFFAMagnet */ - explicit ScalingFFAGMagnet(const std::string &name); + explicit ScalingFFAMagnet(const std::string &name); /** Destructor - deletes map */ - ~ScalingFFAGMagnet(); + ~ScalingFFAMagnet(); /** Inheritable copy constructor */ ElementBase* clone() const; @@ -91,7 +91,7 @@ class ScalingFFAGMagnet : public Component { */ bool getFieldValueCylindrical(const Vector_t &R, Vector_t &B) const; - /** Initialise the ScalingFFAGMagnet + /** Initialise the ScalingFFAMagnet * * \param bunch the global bunch object * \param startField not used @@ -99,17 +99,17 @@ class ScalingFFAGMagnet : public Component { */ void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField); - /** Initialise the ScalingFFAGMagnet + /** Initialise the ScalingFFAMagnet * * Sets up the field expansion and the geometry; call after changing any * field parameters */ void initialise(); - /** Finalise the ScalingFFAGMagnet - sets bunch to NULL */ + /** Finalise the ScalingFFAMagnet - sets bunch to NULL */ void finalise(); - /** Return true - ScalingFFAGMagnet always bends the reference particle */ + /** Return true - ScalingFFAMagnet always bends the reference particle */ inline bool bends() const; /** Not implemented */ @@ -162,14 +162,14 @@ class ScalingFFAGMagnet : public Component { /** Get the fringe field * - * Returns the fringe field model; ScalingFFAGMagnet retains ownership of the + * Returns the fringe field model; ScalingFFAMagnet retains ownership of the * returned memory. */ endfieldmodel::EndFieldModel* getEndField() const {return endField_m;} /** Set the fringe field * - * - endField: the new fringe field; ScalingFFAGMagnet takes ownership of the + * - endField: the new fringe field; ScalingFFAMagnet takes ownership of the * memory associated with endField. */ void setEndField(endfieldmodel::EndFieldModel* endField); @@ -242,9 +242,9 @@ class ScalingFFAGMagnet : public Component { void calculateDfCoefficients(); /** Copy constructor */ - ScalingFFAGMagnet(const ScalingFFAGMagnet &right); + ScalingFFAMagnet(const ScalingFFAMagnet &right); - ScalingFFAGMagnet& operator=(const ScalingFFAGMagnet& rhs); + ScalingFFAMagnet& operator=(const ScalingFFAMagnet& rhs); PlanarArcGeometry planarArcGeometry_m; BMultipoleField dummy; diff --git a/src/Classic/AbsBeamline/SpecificElementVisitor.h b/src/Classic/AbsBeamline/SpecificElementVisitor.h index de101669bf99beaaedd7db9f73847c7b41ba07ce..d299e337d475866445e04ff5161b5ec71694f3ee 100644 --- a/src/Classic/AbsBeamline/SpecificElementVisitor.h +++ b/src/Classic/AbsBeamline/SpecificElementVisitor.h @@ -35,7 +35,7 @@ #include "AbsBeamline/RFQuadrupole.h" #include "AbsBeamline/SBend.h" #include "AbsBeamline/SBend3D.h" -#include "AbsBeamline/ScalingFFAGMagnet.h" +#include "AbsBeamline/ScalingFFAMagnet.h" #include "AbsBeamline/Separator.h" #include "AbsBeamline/Septum.h" #include "AbsBeamline/Solenoid.h" @@ -184,7 +184,7 @@ public: virtual void visitSource(const Source &); /// Apply the algorithm to a spiral sector magnet. - virtual void visitScalingFFAGMagnet(const ScalingFFAGMagnet &); + virtual void visitScalingFFAMagnet(const ScalingFFAMagnet &); /// Apply the algorithm to a ParallelPlate. virtual void visitParallelPlate(const ParallelPlate &); @@ -418,8 +418,8 @@ void SpecificElementVisitor<ELEM>::visitSBend3D(const SBend3D &element) { } template<class ELEM> -void SpecificElementVisitor<ELEM>::visitScalingFFAGMagnet(const ScalingFFAGMagnet &element) { - CastsTrait<ELEM, ScalingFFAGMagnet>::apply(allElementsOfTypeE, element); +void SpecificElementVisitor<ELEM>::visitScalingFFAMagnet(const ScalingFFAMagnet &element) { + CastsTrait<ELEM, ScalingFFAMagnet>::apply(allElementsOfTypeE, element); } template<class ELEM> diff --git a/src/Classic/Algorithms/DefaultVisitor.cpp b/src/Classic/Algorithms/DefaultVisitor.cpp index f79fd4aaf8732bd3d27584ff0f2f78717bacd521..b49b20883444605f99b19bb33f98e98a83acdd55 100644 --- a/src/Classic/Algorithms/DefaultVisitor.cpp +++ b/src/Classic/Algorithms/DefaultVisitor.cpp @@ -50,7 +50,7 @@ #include "AbsBeamline/RFQuadrupole.h" #include "AbsBeamline/SBend.h" #include "AbsBeamline/SBend3D.h" -#include "AbsBeamline/ScalingFFAGMagnet.h" +#include "AbsBeamline/ScalingFFAMagnet.h" #include "AbsBeamline/Separator.h" #include "AbsBeamline/Septum.h" #include "AbsBeamline/Solenoid.h" @@ -226,7 +226,7 @@ void DefaultVisitor::visitSBend3D(const SBend3D &bend) { } -void DefaultVisitor::visitScalingFFAGMagnet(const ScalingFFAGMagnet &spiral) { +void DefaultVisitor::visitScalingFFAMagnet(const ScalingFFAMagnet &spiral) { applyDefault(spiral); } diff --git a/src/Classic/Algorithms/DefaultVisitor.h b/src/Classic/Algorithms/DefaultVisitor.h index c07aa3983156bb65c560d94dd4b484a2a5d8288f..28bd03e625d4915e7ab5becf81d06deb4f74e814 100644 --- a/src/Classic/Algorithms/DefaultVisitor.h +++ b/src/Classic/Algorithms/DefaultVisitor.h @@ -142,8 +142,8 @@ public: /// Apply the algorithm to a sector bend. virtual void visitSBend3D(const SBend3D &); - /// Apply the algorithm to a scaling FFAG magnet. - virtual void visitScalingFFAGMagnet(const ScalingFFAGMagnet &); + /// Apply the algorithm to a scaling FFA magnet. + virtual void visitScalingFFAMagnet(const ScalingFFAMagnet &); /// Apply the algorithm to a separator. virtual void visitSeparator(const Separator &); diff --git a/src/Elements/CMakeLists.txt b/src/Elements/CMakeLists.txt index 4bf1fadf1aa5ff95d7b78d51983b42347e174728..819e7d2c6642ec68ad5581a1553416c030d31ae2 100644 --- a/src/Elements/CMakeLists.txt +++ b/src/Elements/CMakeLists.txt @@ -39,7 +39,7 @@ set (_SRCS OpalRingDefinition.cpp OpalSBend.cpp OpalSBend3D.cpp - OpalScalingFFAGMagnet.cpp + OpalScalingFFAMagnet.cpp OpalSeparator.cpp OpalSeptum.cpp OpalSextupole.cpp @@ -103,6 +103,7 @@ set (HDRS OpalRingDefinition.h OpalSBend3D.h OpalSBend.h + OpalScalingFFAMagnet.h OpalSeparator.h OpalSeptum.h OpalSextupole.h diff --git a/src/Elements/OpalScalingFFAMagnet.cpp b/src/Elements/OpalScalingFFAMagnet.cpp index 805903a1f438501f53fe5a2826a4801ae0982f28..0b46112ca9a76bc5c29e7514fd45f242e6ec0340 100644 --- a/src/Elements/OpalScalingFFAMagnet.cpp +++ b/src/Elements/OpalScalingFFAMagnet.cpp @@ -29,14 +29,14 @@ #include "Utilities/OpalException.h" // used? #include "AbsBeamline/EndFieldModel/Tanh.h" // classic -#include "AbsBeamline/ScalingFFAGMagnet.h" // classic -#include "Elements/OpalScalingFFAGMagnet.h" +#include "AbsBeamline/ScalingFFAMagnet.h" // classic +#include "Elements/OpalScalingFFAMagnet.h" extern Inform *gmsg; -OpalScalingFFAGMagnet::OpalScalingFFAGMagnet() : - OpalElement(SIZE, "SCALINGFFAGMAGNET", - "The \"ScalingFFAGMagnet\" element defines a FFAG scaling magnet with zero or non-zero spiral angle.") { +OpalScalingFFAMagnet::OpalScalingFFAMagnet() : + OpalElement(SIZE, "SCALINGFFAMAGNET", + "The \"ScalingFFAMagnet\" element defines a FFA scaling magnet with zero or non-zero spiral angle.") { itsAttr[B0] = Attributes::makeReal ("B0", "The nominal dipole field of the magnet [T]."); itsAttr[R0] = Attributes::makeReal("R0", "Radial scale [m]."); @@ -47,11 +47,11 @@ OpalScalingFFAGMagnet::OpalScalingFFAGMagnet() : itsAttr[MAX_Y_POWER] = Attributes::makeReal("MAX_Y_POWER", "The maximum power in y that will be considered in the field expansion."); itsAttr[END_LENGTH] = Attributes::makeReal("END_LENGTH", - "The end length of the spiral FFAG [m]."); + "The end length of the spiral FFA [m]."); itsAttr[HEIGHT] = Attributes::makeReal("HEIGHT", "Full height of the magnet. Particles moving more than height/2. off the midplane (either above or below) are out of the aperture [m]."); itsAttr[CENTRE_LENGTH] = Attributes::makeReal("CENTRE_LENGTH", - "The centre length of the spiral FFAG [m]."); + "The centre length of the spiral FFA [m]."); itsAttr[RADIAL_NEG_EXTENT] = Attributes::makeReal("RADIAL_NEG_EXTENT", "Particles are considered outside the tracking region if radius is greater than R0-RADIAL_NEG_EXTENT [m]."); itsAttr[RADIAL_POS_EXTENT] = Attributes::makeReal("RADIAL_POS_EXTENT", @@ -77,38 +77,38 @@ OpalScalingFFAGMagnet::OpalScalingFFAGMagnet() : registerRealAttribute("AZIMUTHAL_EXTENT"); registerOwnership(); - ScalingFFAGMagnet* magnet = new ScalingFFAGMagnet("ScalingFFAGMagnet"); + ScalingFFAMagnet* magnet = new ScalingFFAMagnet("ScalingFFAMagnet"); magnet->setEndField(new endfieldmodel::Tanh(1., 1., 1)); setElement(magnet->makeAlignWrapper()); } -OpalScalingFFAGMagnet::OpalScalingFFAGMagnet(const std::string &name, - OpalScalingFFAGMagnet *parent) : +OpalScalingFFAMagnet::OpalScalingFFAMagnet(const std::string &name, + OpalScalingFFAMagnet *parent) : OpalElement(name, parent) { - ScalingFFAGMagnet* magnet = new ScalingFFAGMagnet(name); + ScalingFFAMagnet* magnet = new ScalingFFAMagnet(name); magnet->setEndField(new endfieldmodel::Tanh(1., 1., 1)); setElement(magnet->makeAlignWrapper()); } -OpalScalingFFAGMagnet::~OpalScalingFFAGMagnet() { +OpalScalingFFAMagnet::~OpalScalingFFAMagnet() { } -OpalScalingFFAGMagnet *OpalScalingFFAGMagnet::clone(const std::string &name) { - return new OpalScalingFFAGMagnet(name, this); +OpalScalingFFAMagnet *OpalScalingFFAMagnet::clone(const std::string &name) { + return new OpalScalingFFAMagnet(name, this); } -void OpalScalingFFAGMagnet:: +void OpalScalingFFAMagnet:: fillRegisteredAttributes(const ElementBase &base, ValueFlag flag) { OpalElement::fillRegisteredAttributes(base, flag); } -void OpalScalingFFAGMagnet::update() { - ScalingFFAGMagnet *magnet = dynamic_cast<ScalingFFAGMagnet*>(getElement()->removeWrappers()); +void OpalScalingFFAMagnet::update() { + ScalingFFAMagnet *magnet = dynamic_cast<ScalingFFAMagnet*>(getElement()->removeWrappers()); // use L = r0*theta; we define the magnet ito length for UI but ito angles // internally; and use m as external default unit and mm internally diff --git a/src/Elements/OpalScalingFFAMagnet.h b/src/Elements/OpalScalingFFAMagnet.h index 4ace46e666b527123bc714aad0d2961b57cb9718..ac40b71b30e23a79f683f1e26d4a77b8f76a7583 100644 --- a/src/Elements/OpalScalingFFAMagnet.h +++ b/src/Elements/OpalScalingFFAMagnet.h @@ -25,16 +25,16 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OPAL_OPALSCALINGFFAGMAGNET_H -#define OPAL_OPALSCALINGFFAGMAGNET_H +#ifndef OPAL_OPALSCALINGFFAMAGNET_H +#define OPAL_OPALSCALINGFFAMAGNET_H #include "Elements/OpalBend.h" -/** OpalScalingFFAGMagnet provides user interface information for the SCALINGFFAG object +/** OpalScalingFFAMagnet provides user interface information for the SCALINGFFA object * * Defines three parameters - field map name, units for field, length for field */ -class OpalScalingFFAGMagnet : public OpalElement { +class OpalScalingFFAMagnet : public OpalElement { public: /** enum maps string to integer value for UI definitions */ enum { @@ -55,13 +55,13 @@ class OpalScalingFFAGMagnet : public OpalElement { }; /** Default constructor initialises UI parameters. */ - OpalScalingFFAGMagnet(); + OpalScalingFFAMagnet(); /** Destructor does nothing */ - virtual ~OpalScalingFFAGMagnet(); + virtual ~OpalScalingFFAMagnet(); /** Inherited copy constructor */ - virtual OpalScalingFFAGMagnet *clone(const std::string &name); + virtual OpalScalingFFAMagnet *clone(const std::string &name); /** Fill in all registered attributes * @@ -69,17 +69,17 @@ class OpalScalingFFAGMagnet : public OpalElement { */ virtual void fillRegisteredAttributes(const ElementBase &, ValueFlag); - /** Update the ScalingFFAG with new parameters from UI parser */ + /** Update the ScalingFFA with new parameters from UI parser */ virtual void update(); private: // Not implemented. - OpalScalingFFAGMagnet(const OpalScalingFFAGMagnet &); - void operator=(const OpalScalingFFAGMagnet &); + OpalScalingFFAMagnet(const OpalScalingFFAMagnet &); + void operator=(const OpalScalingFFAMagnet &); // Clone constructor. - OpalScalingFFAGMagnet(const std::string &name, OpalScalingFFAGMagnet *parent); + OpalScalingFFAMagnet(const std::string &name, OpalScalingFFAMagnet *parent); }; -#endif // OPAL_OPALSCALINGFFAGMAGNET_H +#endif // OPAL_OPALSCALINGFFAMAGNET_H diff --git a/src/OpalConfigure/Configure.cpp b/src/OpalConfigure/Configure.cpp index e9c1749b113c6af59d00b1c8af52a1ed7768e3c5..8d30aca9e6b114bd8651729729f20f9aaea3bc14 100644 --- a/src/OpalConfigure/Configure.cpp +++ b/src/OpalConfigure/Configure.cpp @@ -123,7 +123,7 @@ #include "Elements/OpalRCollimator.h" #include "Elements/OpalSBend.h" #include "Elements/OpalSBend3D.h" -#include "Elements/OpalScalingFFAGMagnet.h" +#include "Elements/OpalScalingFFAMagnet.h" #include "Elements/OpalSeparator.h" #include "Elements/OpalSeptum.h" #include "Elements/OpalSextupole.h" @@ -277,7 +277,7 @@ namespace { opal->create(new OpalRCollimator()); opal->create(new OpalSBend()); opal->create(new OpalSBend3D()); - opal->create(new OpalScalingFFAGMagnet()); + opal->create(new OpalScalingFFAMagnet()); opal->create(new OpalSeparator()); opal->create(new OpalSeptum()); opal->create(new OpalSextupole()); diff --git a/src/addToDoxygenMainPage.h b/src/addToDoxygenMainPage.h index a18c26fd8b9863d6b9e56bdd298af79c2ccd4fb4..9ee9f21941adb9b80b99402e7824a88539cfff11 100644 --- a/src/addToDoxygenMainPage.h +++ b/src/addToDoxygenMainPage.h @@ -12,7 +12,7 @@ on the largest HPC clusters available today. The OPAL framework makes it easy to add new features in the form of new C++ classes. It comes in the following flavours: OPAL-CYCL tracks particles with 3D space charge including neighbouring turns in cyclotrons and -FFAG’s with time as the independent variable. +FFAs with time as the independent variable. OPAL-T can be used to model beam lines, linacs, rf-photo injectors and complete XFEL’s excluding the undulator. </B> diff --git a/tests/classic_src/AbsBeamline/CMakeLists.txt b/tests/classic_src/AbsBeamline/CMakeLists.txt index 5cfa6c7a8bd812c62c994635d848eff48ddce700..36c06457622004a5bc76bdc7e6b2205bdc901016 100644 --- a/tests/classic_src/AbsBeamline/CMakeLists.txt +++ b/tests/classic_src/AbsBeamline/CMakeLists.txt @@ -5,7 +5,7 @@ set (_SRCS PolynomialTest.cpp RingTest.cpp SBend3DTest.cpp - ScalingFFAGMagnetTest.cpp + ScalingFFAMagnetTest.cpp TrimCoilTest.cpp VariableRFCavityTest.cpp VariableRFCavityFringeFieldTest.cpp diff --git a/tests/classic_src/AbsBeamline/ScalingFFAMagnetTest.cpp b/tests/classic_src/AbsBeamline/ScalingFFAMagnetTest.cpp index 1790714e69bb246aac0dae8bb27d6473f5f698b1..5b74c959d5fb5e62d3b805a4f2ea4639e7cc4889 100644 --- a/tests/classic_src/AbsBeamline/ScalingFFAMagnetTest.cpp +++ b/tests/classic_src/AbsBeamline/ScalingFFAMagnetTest.cpp @@ -33,16 +33,16 @@ #include "opal_test_utilities/SilenceTest.h" #include "Classic/AbsBeamline/EndFieldModel/Tanh.h" -#include "Classic/AbsBeamline/ScalingFFAGMagnet.h" +#include "Classic/AbsBeamline/ScalingFFAMagnet.h" #include "Classic/AbsBeamline/Offset.h" -class ScalingFFAGMagnetTest : public ::testing::Test { +class ScalingFFAMagnetTest : public ::testing::Test { public: - ScalingFFAGMagnetTest() : sector_m(NULL), fout_m(), silencer_m() { + ScalingFFAMagnetTest() : sector_m(NULL), fout_m(), silencer_m() { } void SetUp( ) { - sector_m = new ScalingFFAGMagnet("test"); + sector_m = new ScalingFFAMagnet("test"); // characteristic length is R*dphi => 0.6545 m endfieldmodel::Tanh* tanh = new endfieldmodel::Tanh(psi0_m, psi0_m/5., 20); sector_m->setEndField(tanh); @@ -65,10 +65,10 @@ public: sector_m = NULL; } - ~ScalingFFAGMagnetTest() { + ~ScalingFFAMagnetTest() { } - ScalingFFAGMagnet* sector_m; + ScalingFFAMagnet* sector_m; std::ofstream fout_m; double r0_m = 24; // m double magnetLength_m = 0.63; // m @@ -211,8 +211,8 @@ private: OpalTestUtilities::SilenceTest silencer_m; }; -TEST_F(ScalingFFAGMagnetTest, ConstructorTest) { - ScalingFFAGMagnet* test = new ScalingFFAGMagnet("test"); +TEST_F(ScalingFFAMagnetTest, ConstructorTest) { + ScalingFFAMagnet* test = new ScalingFFAMagnet("test"); std::vector<int> data(15); size_t i = 0; test->setTanDelta(++i); @@ -232,9 +232,9 @@ TEST_F(ScalingFFAGMagnetTest, ConstructorTest) { test->setAzimuthalExtent(++i); test->setVerticalExtent(++i); - std::vector<ScalingFFAGMagnet*> magnets(2); + std::vector<ScalingFFAMagnet*> magnets(2); magnets[0] = test; - magnets[1] = dynamic_cast<ScalingFFAGMagnet*>(test->clone()); + magnets[1] = dynamic_cast<ScalingFFAMagnet*>(test->clone()); for (size_t j = 0; j < magnets.size(); ++j) { i = 0; test = magnets[j]; @@ -265,7 +265,7 @@ TEST_F(ScalingFFAGMagnetTest, ConstructorTest) { delete magnets[1]; } -TEST_F(ScalingFFAGMagnetTest, PlacementTest) { +TEST_F(ScalingFFAMagnetTest, PlacementTest) { // test that when we are X0 from the centre, we get By = 0.5*B0 double centre_length = dynamic_cast<endfieldmodel::Tanh*>(sector_m->getEndField())->getX0(); for (double phi_start = 0.; phi_start < psi0_m*3.1; phi_start += psi0_m/2.) { @@ -284,7 +284,7 @@ TEST_F(ScalingFFAGMagnetTest, PlacementTest) { } } -TEST_F(ScalingFFAGMagnetTest, DFCoefficientsTest) { +TEST_F(ScalingFFAMagnetTest, DFCoefficientsTest) { sector_m->setTanDelta(0.0); sector_m->setMaxOrder(5); sector_m->setFieldIndex(5); @@ -307,7 +307,7 @@ TEST_F(ScalingFFAGMagnetTest, DFCoefficientsTest) { } } -TEST_F(ScalingFFAGMagnetTest, DFCoefficientsTanDeltaTest) { +TEST_F(ScalingFFAMagnetTest, DFCoefficientsTanDeltaTest) { sector_m->setTanDelta(2.0); sector_m->setMaxOrder(4); // BUG - max order is 1 to high sector_m->setFieldIndex(5); @@ -331,7 +331,7 @@ TEST_F(ScalingFFAGMagnetTest, DFCoefficientsTanDeltaTest) { } } -TEST_F(ScalingFFAGMagnetTest, TanhTest) { +TEST_F(ScalingFFAMagnetTest, TanhTest) { double numericalDerivative = sector_m->getEndField()->function(-psi0_m, 0); for (size_t order = 0; order < 5; ++order) { double analyticalDerivative = sector_m->getEndField()->function(-psi0_m, order); @@ -345,7 +345,7 @@ TEST_F(ScalingFFAGMagnetTest, TanhTest) { } } -TEST_F(ScalingFFAGMagnetTest, BTwoDTest) { +TEST_F(ScalingFFAMagnetTest, BTwoDTest) { std::ofstream fout("/tmp/b_twod.out"); bool passtest = true; for (double y = 0.; y < 0.025; y += 0.015) { @@ -358,7 +358,7 @@ TEST_F(ScalingFFAGMagnetTest, BTwoDTest) { EXPECT_TRUE(passtest); } -TEST_F(ScalingFFAGMagnetTest, ConvergenceYTest) { +TEST_F(ScalingFFAMagnetTest, ConvergenceYTest) { std::ofstream fout("/tmp/convergence_y.out"); bool passtest = true; for (double y = 0.00001; y < 0.02; y *= 2.) { @@ -370,7 +370,7 @@ TEST_F(ScalingFFAGMagnetTest, ConvergenceYTest) { EXPECT_TRUE(passtest); } -TEST_F(ScalingFFAGMagnetTest, ConvergenceOrderTest) { +TEST_F(ScalingFFAMagnetTest, ConvergenceOrderTest) { for (double y = 0.5; y > 0.2; y /= 10.) { // 50 cm off midplane std::cout << "order y divB |curlB| curlB" << std::endl; std::vector<double> divBVec(13); @@ -403,7 +403,7 @@ TEST_F(ScalingFFAGMagnetTest, ConvergenceOrderTest) { sector_m->setMaxOrder(10); } -TEST_F(ScalingFFAGMagnetTest, ConvergenceOrderHackedTest) { +TEST_F(ScalingFFAMagnetTest, ConvergenceOrderHackedTest) { double y = 0.05; bool cylindrical = false; int maxOrder = 10; @@ -460,7 +460,7 @@ TEST_F(ScalingFFAGMagnetTest, ConvergenceOrderHackedTest) { } -TEST_F(ScalingFFAGMagnetTest, ConvergenceEndLengthTest) { +TEST_F(ScalingFFAMagnetTest, ConvergenceEndLengthTest) { std::ofstream fout("/tmp/convergence_endlength.out"); bool passtest = true; for (double endLength = 1.; endLength < 10.1; endLength += 1.) { @@ -472,7 +472,7 @@ TEST_F(ScalingFFAGMagnetTest, ConvergenceEndLengthTest) { EXPECT_TRUE(passtest); } -TEST_F(ScalingFFAGMagnetTest, VerticalBoundingBoxTest) { +TEST_F(ScalingFFAMagnetTest, VerticalBoundingBoxTest) { sector_m->setVerticalExtent(0.1); Vector_t mom, E, B; double t = 0; @@ -487,7 +487,7 @@ TEST_F(ScalingFFAGMagnetTest, VerticalBoundingBoxTest) { EXPECT_FALSE(sector_m->apply(pos, mom, t, E, B)); } -TEST_F(ScalingFFAGMagnetTest, RadialBoundingBoxTest) { +TEST_F(ScalingFFAMagnetTest, RadialBoundingBoxTest) { sector_m->setRMin(r0_m-0.1); Vector_t mom, E, B; double t = 0; @@ -507,7 +507,7 @@ TEST_F(ScalingFFAGMagnetTest, RadialBoundingBoxTest) { EXPECT_TRUE(sector_m->apply(pos4, mom, t, E, B)); } -TEST_F(ScalingFFAGMagnetTest, AzimuthalBoundingBoxTest) { +TEST_F(ScalingFFAMagnetTest, AzimuthalBoundingBoxTest) { sector_m->setAzimuthalExtent(psi0_m*5.); sector_m->setPhiStart(psi0_m*3.); Vector_t mom, E, B; @@ -520,7 +520,7 @@ TEST_F(ScalingFFAGMagnetTest, AzimuthalBoundingBoxTest) { } } -TEST_F(ScalingFFAGMagnetTest, GeometryTest) { +TEST_F(ScalingFFAMagnetTest, GeometryTest) { Euclid3D delta = sector_m->getGeometry().getTotalTransform(); Vector3D vec = delta.getVector(); Vector3D rot = delta.getRotation().getAxis();