OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <CoordinateTransform.h>
Public Member Functions | |
CoordinateTransform ()=delete | |
CoordinateTransform (const double &xlab, const double &ylab, const double &zlab, const double &s_0, const double &lambdaleft, const double &lambdaright, const double &rho) | |
CoordinateTransform (const CoordinateTransform &transform) | |
~CoordinateTransform () | |
CoordinateTransform & | operator= (const CoordinateTransform &transform) |
std::vector< double > | getTransformation () const |
std::vector< double > | calcReferenceTrajectory (const double &s) const |
std::vector< double > | getUnitTangentVector (const double &s) const |
Private Member Functions | |
void | calcSCoordinate (const double &xlab, const double &ylab) |
void | calcXCoordinate (const double &xlab, const double &ylab) |
void | transformFromEntranceCoordinates (std::vector< double > &coordinates, const double &boundingBoxLength) |
Private Attributes | |
double | s_0_m |
double | lambdaleft_m |
double | lambdaright_m |
double | rho_m |
double | x_m |
double | z_m |
double | s_m |
Static Private Attributes | |
static const double | error = 1e-10 |
static const int | workspaceSize = 1000 |
static const int | algorithm = GSL_INTEG_GAUSS61 |
Definition at line 59 of file CoordinateTransform.h.
|
delete |
Default constructor, transforms everything to the origin
coordinatetransform::CoordinateTransform::CoordinateTransform | ( | const double & | xlab, |
const double & | ylab, | ||
const double & | zlab, | ||
const double & | s_0, | ||
const double & | lambdaleft, | ||
const double & | lambdaright, | ||
const double & | rho | ||
) |
Constructor, calculates coordinate transformation from lab coordinates to Frenet-Serret coordinates, given fringe field parameters
xlab | -> x-coordinate in lab frame |
ylab | -> y-coordinate in lab frame |
zlab | -> z-coordinate in lab frame |
s_0 | -> Centre field length |
lambdaleft | -> Left end field length |
lambdaright | -> Right end field length |
rho | -> Centre radius of curvature |
Definition at line 45 of file CoordinateTransform.cpp.
References calcSCoordinate(), calcXCoordinate(), and z_m.
coordinatetransform::CoordinateTransform::CoordinateTransform | ( | const CoordinateTransform & | transform | ) |
Copy constructor
Definition at line 63 of file CoordinateTransform.cpp.
coordinatetransform::CoordinateTransform::~CoordinateTransform | ( | ) |
Destructor, does nothing
Definition at line 70 of file CoordinateTransform.cpp.
std::vector< double > coordinatetransform::CoordinateTransform::calcReferenceTrajectory | ( | const double & | s | ) | const |
Calculates reference trajectory by integrating the unit tangent vector
s | -> s-coordinate in local Frenet-Serret coordinates |
Definition at line 107 of file CoordinateTransform.cpp.
References algorithm, endl(), error, coordinatetransform::getUnitTangentVectorX(), coordinatetransform::getUnitTangentVectorY(), gmsg, lambdaleft_m, lambdaright_m, rho_m, s_0_m, and workspaceSize.
Referenced by calcSCoordinate(), calcXCoordinate(), VarRadiusGeometry::getTransform(), and transformFromEntranceCoordinates().
|
private |
Calculates the coordinate s
xlab | -> x-coordinate in lab frame |
ylab | -> y-coordinate in lab frame |
Definition at line 136 of file CoordinateTransform.cpp.
References abs(), calcReferenceTrajectory(), Physics::e, getUnitTangentVector(), lambdaleft_m, lambdaright_m, Hypervolume::n, s_0_m, and s_m.
Referenced by CoordinateTransform().
|
private |
Calculates the coordinate x, coordinate s must be calculated first!
xlab | -> x-coordinate in lab frame |
ylab | -> y-coordinate in lab frame |
Definition at line 176 of file CoordinateTransform.cpp.
References calcReferenceTrajectory(), getUnitTangentVector(), s_m, and x_m.
Referenced by CoordinateTransform().
std::vector< double > coordinatetransform::CoordinateTransform::getTransformation | ( | ) | const |
Returns a list of transformed coordinates
Definition at line 85 of file CoordinateTransform.cpp.
Referenced by MultipoleT::transformCoords(), and MultipoleTCurvedVarRadius::transformCoords().
std::vector< double > coordinatetransform::CoordinateTransform::getUnitTangentVector | ( | const double & | s | ) | const |
Returns unit tangent vector
s | -> s-coordinate in local Frenet-Serret coordinates |
Definition at line 93 of file CoordinateTransform.cpp.
References cos(), cosh(), lambdaleft_m, lambdaright_m, log(), rho_m, s_0_m, sin(), and tanh().
Referenced by calcSCoordinate(), calcXCoordinate(), VarRadiusGeometry::getTransform(), and transformFromEntranceCoordinates().
CoordinateTransform & coordinatetransform::CoordinateTransform::operator= | ( | const CoordinateTransform & | transform | ) |
Assigment operator
Definition at line 73 of file CoordinateTransform.cpp.
References lambdaleft_m, lambdaright_m, rho_m, s_0_m, s_m, x_m, and z_m.
|
private |
Transforms from coordinate system centred in the middle of the magnet to the coordinate system placed at the entrance
coordinates | -> Coordinates in coordinate system centred in the middle of the magnet |
boundingBoxLength | -> Length along the magnet from the magnet entrance to the middle of the magnet |
Definition at line 184 of file CoordinateTransform.cpp.
References calcReferenceTrajectory(), and getUnitTangentVector().
|
staticprivate |
Definition at line 125 of file CoordinateTransform.h.
Referenced by calcReferenceTrajectory().
|
staticprivate |
Definition at line 123 of file CoordinateTransform.h.
Referenced by calcReferenceTrajectory().
|
private |
Definition at line 117 of file CoordinateTransform.h.
Referenced by calcReferenceTrajectory(), calcSCoordinate(), getUnitTangentVector(), and operator=().
|
private |
Definition at line 118 of file CoordinateTransform.h.
Referenced by calcReferenceTrajectory(), calcSCoordinate(), getUnitTangentVector(), and operator=().
|
private |
Definition at line 119 of file CoordinateTransform.h.
Referenced by calcReferenceTrajectory(), getUnitTangentVector(), and operator=().
|
private |
Definition at line 116 of file CoordinateTransform.h.
Referenced by calcReferenceTrajectory(), calcSCoordinate(), getUnitTangentVector(), and operator=().
|
private |
Definition at line 122 of file CoordinateTransform.h.
Referenced by calcSCoordinate(), calcXCoordinate(), getTransformation(), and operator=().
|
staticprivate |
Definition at line 124 of file CoordinateTransform.h.
Referenced by calcReferenceTrajectory().
|
private |
Definition at line 120 of file CoordinateTransform.h.
Referenced by calcXCoordinate(), getTransformation(), and operator=().
|
private |
Definition at line 121 of file CoordinateTransform.h.
Referenced by CoordinateTransform(), getTransformation(), and operator=().