OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
coordinatetransform::CoordinateTransform Class Reference

#include <CoordinateTransform.h>

Collaboration diagram for coordinatetransform::CoordinateTransform:

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

References CoordinateTransform().

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

Here is the call graph for this function:

◆ 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(), lambdaleft_m, lambdaright_m, rho_m, s_0_m, 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.

References CoordinateTransform(), lambdaleft_m, lambdaright_m, rho_m, s_0_m, s_m, x_m, and z_m.

Here is the call graph for this function:

◆ ~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 calcReferenceTrajectory(), getUnitTangentVector(), lambdaleft_m, lambdaright_m, 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 MultipoleTCurvedVarRadius::localCartesianToCurvilinear().

◆ 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 lambdaleft_m, lambdaright_m, rho_m, and s_0_m.

Referenced by calcSCoordinate(), calcXCoordinate(), VarRadiusGeometry::getTransform(), and transformFromEntranceCoordinates().

◆ operator=()

CoordinateTransform & coordinatetransform::CoordinateTransform::operator= ( const CoordinateTransform & transform)

Assigment operator

Definition at line 73 of file CoordinateTransform.cpp.

References CoordinateTransform(), lambdaleft_m, lambdaright_m, rho_m, s_0_m, s_m, x_m, and z_m.

Here is the call graph for this function:

◆ 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

◆ 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

◆ z_m

double coordinatetransform::CoordinateTransform::z_m
private

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