Commit f8e24c61 authored by ext-rogers_c's avatar ext-rogers_c
Browse files

FFAG moved to FFA

parent 54df0d41
......@@ -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");
}
}
......
......@@ -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 &);
......
......@@ -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;
......
......@@ -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
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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>
......
......@@ -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);
}
......
......@@ -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 &);
......
......@@ -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
......
......@@ -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
......
......@@ -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.