OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
|
#include <EndFieldModel.h>
Public Member Functions | |
virtual | ~EndFieldModel () |
virtual std::ostream & | print (std::ostream &out) const =0 |
virtual double | function (double x, int n) const =0 |
virtual double | getCentreLength () const =0 |
virtual double | getEndLength () const =0 |
virtual EndFieldModel * | clone () const =0 |
virtual void | setMaximumDerivative (size_t n)=0 |
virtual void | rescale (double scaleFactor)=0 |
Static Public Member Functions | |
static std::shared_ptr< EndFieldModel > | getEndFieldModel (std::string name) |
static void | setEndFieldModel (std::string name, std::shared_ptr< EndFieldModel > efm) |
static std::string | getName (std::shared_ptr< EndFieldModel > efm) |
Static Private Attributes | |
static std::map< std::string, std::shared_ptr< EndFieldModel > > | efm_map |
Definition at line 38 of file EndFieldModel.h.
|
inlinevirtual |
Destructor
Definition at line 41 of file EndFieldModel.h.
|
pure virtual |
Inheritable copy constructor - returns a deep copy of the EndFieldModel
Implemented in endfieldmodel::AsymmetricEnge, endfieldmodel::Enge, and endfieldmodel::Tanh.
Referenced by ScalingFFAMagnet::ScalingFFAMagnet(), and ScalingFFAMagnet::setupEndField().
|
pure virtual |
Return the value of the function or its n^th derivative
x | returns d^n f(x)/dx^n |
n | the derivative |
Implemented in endfieldmodel::AsymmetricEnge, endfieldmodel::Enge, and endfieldmodel::Tanh.
|
pure virtual |
Return the nominal flat top length of the magnet
Implemented in endfieldmodel::AsymmetricEnge, endfieldmodel::Enge, and endfieldmodel::Tanh.
Referenced by ScalingFFAMagnet::setupEndField().
|
static |
Look up the EndFieldModel that has a given name
name | name of the EndFieldModel |
GeneralClassicException | if name is not recognised |
Definition at line 63 of file EndFieldModel.cpp.
Referenced by ScalingFFAMagnet::setupEndField().
|
pure virtual |
Return the nominal end field length of the magnet
Implemented in endfieldmodel::AsymmetricEnge, endfieldmodel::Enge, and endfieldmodel::Tanh.
Referenced by ScalingFFAMagnet::setupEndField().
|
static |
Get the name corresponding to a given EndFieldModel
efm | EndFieldModel to lookup |
GeneralClassicException | if efm is not recognised |
Definition at line 77 of file EndFieldModel.cpp.
References efm_map.
|
pure virtual |
Stream a human readable description of the end field model to out
Implemented in endfieldmodel::AsymmetricEnge, endfieldmodel::Enge, and endfieldmodel::Tanh.
|
pure virtual |
Rescale the end field lengths and offsets by a factor x0
If before rescaling the endfieldmodel returns f(x), after rescaling the endfieldmodel should return f(x*scaleFactor)
Implemented in endfieldmodel::AsymmetricEnge, endfieldmodel::Enge, and endfieldmodel::Tanh.
Referenced by ScalingFFAMagnet::setupEndField(), and OpalScalingFFAMagnet::update().
|
static |
Add a value to the lookup table
name | name of the EndFieldModel. If name already exists in the map, it is overwritten with the new value. |
efm | shared_ptr to the EndFieldModel. |
Definition at line 72 of file EndFieldModel.cpp.
Referenced by OpalScalingFFAMagnet::setupDefaultEndField(), OpalAsymmetricEnge::update(), and OpalEnge::update().
|
pure virtual |
Set the maximum derivative that will be required to be calculated
Some end field models e.g. Enge use recursion relations to calculate analytically derivatives at high order. By setting the maximum derivative these models can set up the tables of recursion coefficients at set-up time which makes the derivative lookup faster.
Implemented in endfieldmodel::AsymmetricEnge, endfieldmodel::Enge, and endfieldmodel::Tanh.
Referenced by OpalScalingFFAMagnet::update().
|
staticprivate |
Definition at line 108 of file EndFieldModel.h.
Referenced by getEndFieldModel(), getName(), and setEndFieldModel().