OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
RingSection Class Reference

Component placement handler in ring geometry. More...

#include <RingSection.h>

Collaboration diagram for RingSection:
Collaboration graph

Public Member Functions

 RingSection ()
 
 RingSection (const RingSection &sec)
 
RingSectionoperator= (const RingSection &sec)
 
 ~RingSection ()
 
bool isOnOrPastStartPlane (const Vector_t< double, 3 > &pos) const
 
bool isPastEndPlane (const Vector_t< double, 3 > &pos) const
 
bool getFieldValue (const Vector_t< double, 3 > &pos, const Vector_t< double, 3 > &centroid, const double &t, Vector_t< double, 3 > &E, Vector_t< double, 3 > &B) const
 
std::vector< Vector_t< double, 3 > > getVirtualBoundingBox () const
 
bool doesOverlap (double phiStart, double phiEnd) const
 
void setComponent (Component *component)
 
ComponentgetComponent () const
 
void setStartPosition (Vector_t< double, 3 > pos)
 
Vector_t< double, 3 > getStartPosition () const
 
void setStartNormal (Vector_t< double, 3 > orientation)
 
Vector_t< double, 3 > getStartNormal () const
 
void setEndPosition (Vector_t< double, 3 > pos)
 
Vector_t< double, 3 > getEndPosition () const
 
void setEndNormal (Vector_t< double, 3 > orientation)
 
Vector_t< double, 3 > getEndNormal () const
 
void setComponentPosition (Vector_t< double, 3 > position)
 
Vector_t< double, 3 > getComponentPosition () const
 
void setComponentOrientation (Vector_t< double, 3 > orientation)
 
Vector_t< double, 3 > getComponentOrientation () const
 

Private Member Functions

void rotate (Vector_t< double, 3 > &vector) const
 
void rotate_back (Vector_t< double, 3 > &vector) const
 
Vector_t< double, 3 > & normalise (Vector_t< double, 3 > &vector) const
 
void rotateToTCoordinates (Vector_t< double, 3 > &vec) const
 
void rotateToCyclCoordinates (Vector_t< double, 3 > &vec) const
 
void updateComponentOrientation ()
 

Private Attributes

Componentcomponent_m
 
Vector_t< double, 3 > componentPosition_m
 
Vector_t< double, 3 > componentOrientation_m
 
Vector_t< double, 3 > startPosition_m
 
Vector_t< double, 3 > startOrientation_m
 
Vector_t< double, 3 > endPosition_m
 
Vector_t< double, 3 > endOrientation_m
 
double sin2_m
 
double cos2_m
 

Detailed Description

Component placement handler in ring geometry.

RingSection handles placement of a component when it is placed in a ring geometry. Here the primary index for section placement is azimuthal angle. RingSection assumes that ring objects occupy a space defined by a start plane and another end plane.

All vectors should be in cartesian coordinates (x,y,z); with z being the axis of the ring.

Parameters
component_mcomponent that the OpalSection wraps - this is a borrowed reference (RingSection does not own the memory)
startPosition_mposition of the centre of the start face in cylindrical polar coordinates
startOrientation_mvector normal to the start face pointing towards the field map
endPosition_mposition of the centre of the end face in cylindrical polar coordinates
endOrientation_mvector normal to the end face pointing away from the field map
componentPosition_mfield map position relative to component start
componentRotation_mfield map rotation R

So field maps are calculated in local coordinate system U_local = V+R*U_global where R is rotation matrix and V is componentPosition_m.

Return field values are returned like B_global = R^{-1}*B_local

Definition at line 67 of file RingSection.h.

Constructor & Destructor Documentation

◆ RingSection() [1/2]

RingSection::RingSection ( )

Construct a ring section - positions, orientations etc default to 0.

Definition at line 33 of file RingSection.cpp.

◆ RingSection() [2/2]

RingSection::RingSection ( const RingSection sec)

Copy constructor; deepcopies the Component (and copies everything else)

Definition at line 42 of file RingSection.cpp.

◆ ~RingSection()

RingSection::~RingSection ( )

Destructor - does nothing

Definition at line 53 of file RingSection.cpp.

Member Function Documentation

◆ doesOverlap()

bool RingSection::doesOverlap ( double  phiStart,
double  phiEnd 
) const

Return true if the phi range overlaps bounding box elements

Definition at line 141 of file RingSection.cpp.

References getVirtualBoundingBox(), isOnOrPastStartPlane(), isPastEndPlane(), setEndNormal(), setEndPosition(), setStartNormal(), and setStartPosition().

Here is the call graph for this function:

◆ getComponent()

Component * RingSection::getComponent ( ) const
inline

Get the component wrapped by RingSection

Component* is not owned by caller or RingSection

Definition at line 140 of file RingSection.h.

References component_m.

◆ getComponentOrientation()

Vector_t< double, 3 > RingSection::getComponentOrientation ( ) const
inline

Get the rotation for the component relative to the section start

Definition at line 178 of file RingSection.h.

References componentOrientation_m.

◆ getComponentPosition()

Vector_t< double, 3 > RingSection::getComponentPosition ( ) const
inline

Get the displacement for the component relative to the section start

Definition at line 172 of file RingSection.h.

References componentPosition_m.

◆ getEndNormal()

Vector_t< double, 3 > RingSection::getEndNormal ( ) const
inline

Get the normal vector to the section end plane

Definition at line 164 of file RingSection.h.

References endOrientation_m.

Referenced by Ring::appendElement(), and getVirtualBoundingBox().

◆ getEndPosition()

Vector_t< double, 3 > RingSection::getEndPosition ( ) const
inline

Get a position on the section end plane

Definition at line 158 of file RingSection.h.

References endPosition_m.

Referenced by Ring::appendElement(), and getVirtualBoundingBox().

◆ getFieldValue()

bool RingSection::getFieldValue ( const Vector_t< double, 3 > &  pos,
const Vector_t< double, 3 > &  centroid,
const double &  t,
Vector_t< double, 3 > &  E,
Vector_t< double, 3 > &  B 
) const

Return field value in global coordinate system

Parameters
posPosition in global Cartesian coordinates
ttime in lab frame
centroidNot sure what this is
EVector to be filled with electric field values; will always overwrite with 0. before filling field
BVector to be filled with magnetic field values; will always overwrite with 0. before filling field
Returns
true if pos is outside of the field bounding box, else false

Note; does not check for component == nullptr; caller must assign component_m (using setComponent) before calling this function.

Definition at line 97 of file RingSection.cpp.

References Component::apply(), component_m, componentPosition_m, rotate(), rotate_back(), rotateToCyclCoordinates(), and rotateToTCoordinates().

Here is the call graph for this function:

◆ getStartNormal()

Vector_t< double, 3 > RingSection::getStartNormal ( ) const
inline

Get the normal vector to the section start plane

Definition at line 152 of file RingSection.h.

References startOrientation_m.

Referenced by Ring::appendElement(), and getVirtualBoundingBox().

◆ getStartPosition()

Vector_t< double, 3 > RingSection::getStartPosition ( ) const
inline

Get a position on the plane of the section start

Definition at line 146 of file RingSection.h.

References startPosition_m.

Referenced by Ring::appendElement(), and getVirtualBoundingBox().

◆ getVirtualBoundingBox()

std::vector< Vector_t< double, 3 > > RingSection::getVirtualBoundingBox ( ) const

Get the "Virtual" bounding box for the RingSection

Defined by the point one radial distance along each face of the element either towards the centre of the ring or towards the outside of the ring

Return order is; start outside, start inside, end outside, end inside

An improvement would be to put the crossing point if the two faces cross before they reach the radial apertures described above.

Definition at line 121 of file RingSection.cpp.

References getEndNormal(), getEndPosition(), getStartNormal(), getStartPosition(), and normalise().

Referenced by doesOverlap().

Here is the call graph for this function:

◆ isOnOrPastStartPlane()

bool RingSection::isOnOrPastStartPlane ( const Vector_t< double, 3 > &  pos) const

Return true if pos is on or past start plane

Parameters
posposition to test
Returns
true if phi(pos) >= phi(start plane), after taking account of the position and rotation of the start face

Definition at line 74 of file RingSection.cpp.

References startOrientation_m, and startPosition_m.

Referenced by doesOverlap().

◆ isPastEndPlane()

bool RingSection::isPastEndPlane ( const Vector_t< double, 3 > &  pos) const

Return true if pos is past end plane

Returns
true if phi > phi(end plane), after taking account of the position and rotation of the start face

Definition at line 86 of file RingSection.cpp.

References endOrientation_m, and endPosition_m.

Referenced by doesOverlap().

◆ normalise()

Vector_t< double, 3 > & RingSection::normalise ( Vector_t< double, 3 > &  vector) const
inlineprivate

Definition at line 218 of file RingSection.h.

Referenced by getVirtualBoundingBox(), setEndNormal(), and setStartNormal().

◆ operator=()

RingSection & RingSection::operator= ( const RingSection sec)

Definition at line 59 of file RingSection.cpp.

References ElementBase::clone(), component_m, componentOrientation_m, componentPosition_m, endOrientation_m, endPosition_m, startOrientation_m, and startPosition_m.

Here is the call graph for this function:

◆ rotate()

void RingSection::rotate ( Vector_t< double, 3 > &  vector) const
private

Definition at line 178 of file RingSection.cpp.

References cos2_m, and sin2_m.

Referenced by getFieldValue().

◆ rotate_back()

void RingSection::rotate_back ( Vector_t< double, 3 > &  vector) const
private

Definition at line 184 of file RingSection.cpp.

References cos2_m, and sin2_m.

Referenced by getFieldValue().

◆ rotateToCyclCoordinates()

void RingSection::rotateToCyclCoordinates ( Vector_t< double, 3 > &  vec) const
inlineprivate

Definition at line 230 of file RingSection.h.

Referenced by getFieldValue().

◆ rotateToTCoordinates()

void RingSection::rotateToTCoordinates ( Vector_t< double, 3 > &  vec) const
inlineprivate

Definition at line 226 of file RingSection.h.

Referenced by getFieldValue().

◆ setComponent()

void RingSection::setComponent ( Component component)
inline

Set the component wrapped by RingSection

This borrows the Component* pointer (caller is responsible for cleanup)

Definition at line 134 of file RingSection.h.

References component_m.

Referenced by Ring::appendElement().

◆ setComponentOrientation()

void RingSection::setComponentOrientation ( Vector_t< double, 3 >  orientation)
inline

Set the rotation for the component relative to the section start

Definition at line 205 of file RingSection.h.

References componentOrientation_m, and updateComponentOrientation().

Referenced by Ring::appendElement().

Here is the call graph for this function:

◆ setComponentPosition()

void RingSection::setComponentPosition ( Vector_t< double, 3 >  position)
inline

Set the displacement for the component relative to the section start

Definition at line 167 of file RingSection.h.

References componentPosition_m.

Referenced by Ring::appendElement().

◆ setEndNormal()

void RingSection::setEndNormal ( Vector_t< double, 3 >  orientation)
inline

Set the normal vector to the section end plane

Definition at line 214 of file RingSection.h.

References endOrientation_m, and normalise().

Referenced by Ring::appendElement(), and doesOverlap().

Here is the call graph for this function:

◆ setEndPosition()

void RingSection::setEndPosition ( Vector_t< double, 3 >  pos)
inline

Set a position on the section end plane

Definition at line 155 of file RingSection.h.

References endPosition_m.

Referenced by Ring::appendElement(), and doesOverlap().

◆ setStartNormal()

void RingSection::setStartNormal ( Vector_t< double, 3 >  orientation)
inline

Set the normal vector to the section start plane

Definition at line 210 of file RingSection.h.

References normalise(), and startOrientation_m.

Referenced by Ring::appendElement(), and doesOverlap().

Here is the call graph for this function:

◆ setStartPosition()

void RingSection::setStartPosition ( Vector_t< double, 3 >  pos)
inline

Set a position on the plane of the section start

Definition at line 143 of file RingSection.h.

References startPosition_m.

Referenced by Ring::appendElement(), and doesOverlap().

◆ updateComponentOrientation()

void RingSection::updateComponentOrientation ( )
private

Definition at line 116 of file RingSection.cpp.

References componentOrientation_m, cos2_m, and sin2_m.

Referenced by setComponentOrientation().

Member Data Documentation

◆ component_m

Component* RingSection::component_m
private

Definition at line 187 of file RingSection.h.

Referenced by getComponent(), getFieldValue(), operator=(), and setComponent().

◆ componentOrientation_m

Vector_t<double, 3> RingSection::componentOrientation_m
private

◆ componentPosition_m

Vector_t<double, 3> RingSection::componentPosition_m
private

◆ cos2_m

double RingSection::cos2_m
private

Definition at line 200 of file RingSection.h.

Referenced by rotate(), rotate_back(), and updateComponentOrientation().

◆ endOrientation_m

Vector_t<double, 3> RingSection::endOrientation_m
private

Definition at line 196 of file RingSection.h.

Referenced by getEndNormal(), isPastEndPlane(), operator=(), and setEndNormal().

◆ endPosition_m

Vector_t<double, 3> RingSection::endPosition_m
private

Definition at line 195 of file RingSection.h.

Referenced by getEndPosition(), isPastEndPlane(), operator=(), and setEndPosition().

◆ sin2_m

double RingSection::sin2_m
private

Definition at line 199 of file RingSection.h.

Referenced by rotate(), rotate_back(), and updateComponentOrientation().

◆ startOrientation_m

Vector_t<double, 3> RingSection::startOrientation_m
private

Definition at line 193 of file RingSection.h.

Referenced by getStartNormal(), isOnOrPastStartPlane(), operator=(), and setStartNormal().

◆ startPosition_m

Vector_t<double, 3> RingSection::startPosition_m
private

Definition at line 192 of file RingSection.h.

Referenced by getStartPosition(), isOnOrPastStartPlane(), operator=(), and setStartPosition().


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