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

#include <MultipoleTBase.h>

Inheritance diagram for MultipoleTBase:
Inheritance graph
Collaboration diagram for MultipoleTBase:
Collaboration graph

Public Member Functions

 MultipoleTBase (MultipoleT *element)
 
virtual ~MultipoleTBase ()=default
 
virtual void initialise ()=0
 
virtual BGeometryBasegetGeometry ()=0
 
virtual void getField (Kokkos::View< Vector_t< double, 3 > * >, Kokkos::View< Vector_t< double, 3 > * >, Kokkos::View< Vector_t< double, 3 > * >, double, size_t)=0
 
virtual bool getField (const Vector_t< double, 3 > &, Vector_t< double, 3 > &, Vector_t< double, 3 > &, double)=0
 
void generateTanhCoefficients (unsigned int numDerivatives)
 

Static Public Member Functions

static KOKKOS_INLINE_FUNCTION double factorial (unsigned int n)
 
static KOKKOS_INLINE_FUNCTION double powerInteger (double x, unsigned int n)
 
static KOKKOS_INLINE_FUNCTION void calcTransverseDerivatives (const Kokkos::Array< double, MultipoleTConfig::NumPoles > &poles, unsigned int numDerivatives, double x, Kokkos::Array< double, MaxDerivatives > &derivatives)
 
template<class ViewType >
static KOKKOS_INLINE_FUNCTION void calcFringeDerivatives (const double &s0, const double &lambdaLeft, const double &lambdaRight, double s, const ViewType &tanhCoefficients, Kokkos::Array< double, MaxDerivatives > &derivatives)
 
static KOKKOS_INLINE_FUNCTION Vector_t< double, 3 > rotateFrame (const Vector_t< double, 3 > &R, const MultipoleTConfig &config)
 
static KOKKOS_INLINE_FUNCTION void calcPowers (double value, unsigned int maxPower, Kokkos::Array< double, MaxPowerInteger > &powers)
 

Static Public Attributes

static constexpr size_t MaxFactorial = 20
 
static constexpr size_t MaxPowerInteger = 20
 
static constexpr unsigned int MaxDerivatives = 20
 

Protected Attributes

MultipoleTelement_m
 
Kokkos::View< double ** > tanhCoefficientsGpu_m
 
Kokkos::View< double ** >::host_mirror_type tanhCoefficientsHost_m
 

Detailed Description

Definition at line 73 of file MultipoleTBase.h.

Constructor & Destructor Documentation

◆ MultipoleTBase()

MultipoleTBase::MultipoleTBase ( MultipoleT element)
explicit

Constructor

Definition at line 21 of file MultipoleTBase.cpp.

◆ ~MultipoleTBase()

virtual MultipoleTBase::~MultipoleTBase ( )
virtualdefault

Destructor

Member Function Documentation

◆ calcFringeDerivatives()

template<class ViewType >
KOKKOS_INLINE_FUNCTION void MultipoleTBase::calcFringeDerivatives ( const double &  s0,
const double &  lambdaLeft,
const double &  lambdaRight,
double  s,
const ViewType &  tanhCoefficients,
Kokkos::Array< double, MaxDerivatives > &  derivatives 
)
static

◆ calcPowers()

KOKKOS_INLINE_FUNCTION void MultipoleTBase::calcPowers ( double  value,
unsigned int  maxPower,
Kokkos::Array< double, MaxPowerInteger > &  powers 
)
static

Definition at line 235 of file MultipoleTBase.h.

Referenced by MultipoleTCurvedConstRadius::computeBField().

◆ calcTransverseDerivatives()

KOKKOS_INLINE_FUNCTION void MultipoleTBase::calcTransverseDerivatives ( const Kokkos::Array< double, MultipoleTConfig::NumPoles > &  poles,
unsigned int  numDerivatives,
double  x,
Kokkos::Array< double, MaxDerivatives > &  derivatives 
)
static

Helper function that calculates transverse derivatives for multipole fields

Definition at line 166 of file MultipoleTBase.h.

References MultipoleTConfig::NumPoles, and powerInteger().

Referenced by MultipoleTCurvedConstRadius::computeBField(), and MultipoleTStraight::computeBField().

Here is the call graph for this function:

◆ factorial()

KOKKOS_INLINE_FUNCTION double MultipoleTBase::factorial ( unsigned int  n)
static

Helper function that returns factorial of n for n<=20 on both host and GPU

Definition at line 126 of file MultipoleTBase.h.

References MaxFactorial.

Referenced by MultipoleTCurvedConstRadius::computeBField(), and MultipoleTStraight::computeBField().

◆ generateTanhCoefficients()

void MultipoleTBase::generateTanhCoefficients ( unsigned int  numDerivatives)

◆ getField() [1/2]

virtual bool MultipoleTBase::getField ( const Vector_t< double, 3 > &  ,
Vector_t< double, 3 > &  ,
Vector_t< double, 3 > &  ,
double   
)
pure virtual

Return the field for a single point

Implemented in MultipoleTBaseTest, MultipoleTCurvedConstRadius, and MultipoleTStraight.

◆ getField() [2/2]

virtual void MultipoleTBase::getField ( Kokkos::View< Vector_t< double, 3 > * >  ,
Kokkos::View< Vector_t< double, 3 > * >  ,
Kokkos::View< Vector_t< double, 3 > * >  ,
double  ,
size_t   
)
pure virtual

Return the field for an array of points

Implemented in MultipoleTCurvedConstRadius, and MultipoleTStraight.

◆ getGeometry()

virtual BGeometryBase * MultipoleTBase::getGeometry ( )
pure virtual

Return the cell geometry

Implemented in MultipoleTCurvedConstRadius, MultipoleTStraight, and MultipoleTBaseTest.

◆ initialise()

virtual void MultipoleTBase::initialise ( )
pure virtual

Initialise the element

Implemented in MultipoleTCurvedConstRadius, MultipoleTStraight, and MultipoleTBaseTest.

◆ powerInteger()

KOKKOS_INLINE_FUNCTION double MultipoleTBase::powerInteger ( double  x,
unsigned int  n 
)
static

Helper function that returns x^n for 0<=n<=20 on both host and GPU

Definition at line 153 of file MultipoleTBase.h.

Referenced by calcTransverseDerivatives(), MultipoleTCurvedConstRadius::computeBField(), and MultipoleTStraight::computeBField().

◆ rotateFrame()

KOKKOS_INLINE_FUNCTION Vector_t< double, 3 > MultipoleTBase::rotateFrame ( const Vector_t< double, 3 > &  R,
const MultipoleTConfig config 
)
static

Apply two 2D rotation matrices to coordinate vector Rotate around central axis => skew fields Rotate azimuthally => entrance angle

Definition at line 217 of file MultipoleTBase.h.

References MultipoleTConfig::entranceAngle_m, and MultipoleTConfig::rotation_m.

Referenced by MultipoleTCurvedConstRadius::toMagnetCoords(), and MultipoleTStraight::toMagnetCoords().

Member Data Documentation

◆ element_m

◆ MaxDerivatives

constexpr unsigned int MultipoleTBase::MaxDerivatives = 20
staticconstexpr

Definition at line 103 of file MultipoleTBase.h.

Referenced by MultipoleT::validateConfiguration().

◆ MaxFactorial

constexpr size_t MultipoleTBase::MaxFactorial = 20
staticconstexpr

Definition at line 101 of file MultipoleTBase.h.

Referenced by factorial().

◆ MaxPowerInteger

constexpr size_t MultipoleTBase::MaxPowerInteger = 20
staticconstexpr

Definition at line 102 of file MultipoleTBase.h.

◆ tanhCoefficientsGpu_m

Kokkos::View<double**> MultipoleTBase::tanhCoefficientsGpu_m
protected

Definition at line 82 of file MultipoleTBase.h.

Referenced by generateTanhCoefficients().

◆ tanhCoefficientsHost_m

Kokkos::View<double**>::host_mirror_type MultipoleTBase::tanhCoefficientsHost_m
protected

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