OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
coordinatetransform::CoordinateTransform Class Reference

#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 ()
 
CoordinateTransformoperator= (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
 

Detailed Description

Definition at line 59 of file CoordinateTransform.h.

Constructor & Destructor Documentation

◆ CoordinateTransform() [1/3]

coordinatetransform::CoordinateTransform::CoordinateTransform ( )
delete

Default constructor, transforms everything to the origin

◆ CoordinateTransform() [2/3]

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

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.

Here is the call graph for this function:

◆ CoordinateTransform() [3/3]

coordinatetransform::CoordinateTransform::CoordinateTransform ( const CoordinateTransform transform)

Copy constructor

Definition at line 63 of file CoordinateTransform.cpp.

◆ ~CoordinateTransform()

coordinatetransform::CoordinateTransform::~CoordinateTransform ( )

Destructor, does nothing

Definition at line 70 of file CoordinateTransform.cpp.

Member Function Documentation

◆ calcReferenceTrajectory()

std::vector< double > coordinatetransform::CoordinateTransform::calcReferenceTrajectory ( const double &  s) const

Calculates reference trajectory by integrating the unit tangent vector

Parameters
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().

Here is the call graph for this function:

◆ calcSCoordinate()

void coordinatetransform::CoordinateTransform::calcSCoordinate ( const double &  xlab,
const double &  ylab 
)
private

Calculates the coordinate s

Parameters
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().

Here is the call graph for this function:

◆ calcXCoordinate()

void coordinatetransform::CoordinateTransform::calcXCoordinate ( const double &  xlab,
const double &  ylab 
)
private

Calculates the coordinate x, coordinate s must be calculated first!

Parameters
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().

Here is the call graph for this function:

◆ getTransformation()

std::vector< double > coordinatetransform::CoordinateTransform::getTransformation ( ) const

Returns a list of transformed coordinates

Definition at line 85 of file CoordinateTransform.cpp.

References s_m, x_m, and z_m.

Referenced by MultipoleT::transformCoords(), and MultipoleTCurvedVarRadius::transformCoords().

◆ getUnitTangentVector()

std::vector< double > coordinatetransform::CoordinateTransform::getUnitTangentVector ( const double &  s) const

Returns unit tangent vector

Parameters
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().

Here is the call graph for this function:

◆ operator=()

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.

◆ transformFromEntranceCoordinates()

void coordinatetransform::CoordinateTransform::transformFromEntranceCoordinates ( std::vector< double > &  coordinates,
const double &  boundingBoxLength 
)
private

Transforms from coordinate system centred in the middle of the magnet to the coordinate system placed at the entrance

Parameters
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().

Here is the call graph for this function:

Member Data Documentation

◆ algorithm

const int coordinatetransform::CoordinateTransform::algorithm = GSL_INTEG_GAUSS61
staticprivate

Definition at line 125 of file CoordinateTransform.h.

Referenced by calcReferenceTrajectory().

◆ error

const double coordinatetransform::CoordinateTransform::error = 1e-10
staticprivate

Definition at line 123 of file CoordinateTransform.h.

Referenced by calcReferenceTrajectory().

◆ lambdaleft_m

double coordinatetransform::CoordinateTransform::lambdaleft_m
private

◆ lambdaright_m

double coordinatetransform::CoordinateTransform::lambdaright_m
private

◆ rho_m

double coordinatetransform::CoordinateTransform::rho_m
private

Definition at line 119 of file CoordinateTransform.h.

Referenced by calcReferenceTrajectory(), getUnitTangentVector(), and operator=().

◆ s_0_m

double coordinatetransform::CoordinateTransform::s_0_m
private

◆ s_m

double coordinatetransform::CoordinateTransform::s_m
private

◆ workspaceSize

const int coordinatetransform::CoordinateTransform::workspaceSize = 1000
staticprivate

Definition at line 124 of file CoordinateTransform.h.

Referenced by calcReferenceTrajectory().

◆ x_m

double coordinatetransform::CoordinateTransform::x_m
private

Definition at line 120 of file CoordinateTransform.h.

Referenced by calcXCoordinate(), getTransformation(), and operator=().

◆ z_m

double coordinatetransform::CoordinateTransform::z_m
private

Definition at line 121 of file CoordinateTransform.h.

Referenced by CoordinateTransform(), getTransformation(), and operator=().


The documentation for this class was generated from the following files: