OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
MultipoleTBaseTest Class Referenceabstract
Inheritance diagram for MultipoleTBaseTest:
Inheritance graph
Collaboration diagram for MultipoleTBaseTest:
Collaboration graph

Public Member Functions

 MultipoleTBaseTest ()
 
void initialise () override
 
BGeometryBasegetGeometry () override
 
void getField (const Kokkos::View< Vector_t< double, 3 > * >, Kokkos::View< Vector_t< double, 3 > * >, Kokkos::View< Vector_t< double, 3 > * >, double, size_t) override
 
bool getField (const Vector_t< double, 3 > &, Vector_t< double, 3 > &, Vector_t< double, 3 > &, double) override
 
std::vector< double > tanhCoefficients (const unsigned int derivative) const
 
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
 
void generateTanhCoefficients (unsigned int numDerivatives)
 

Static Public Member Functions

static void SetUpTestSuite ()
 
static void TearDownTestSuite ()
 
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 20 of file TestMultipoleTBase.cpp.

Constructor & Destructor Documentation

◆ MultipoleTBaseTest()

MultipoleTBaseTest::MultipoleTBaseTest ( )
inline

Definition at line 22 of file TestMultipoleTBase.cpp.

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 
)
staticinherited

◆ calcPowers()

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

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 
)
staticinherited

Helper function that calculates transverse derivatives for multipole fields

Definition at line 166 of file MultipoleTBase.h.

References MultipoleTConfig::NumPoles, and MultipoleTBase::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)
staticinherited

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

Definition at line 126 of file MultipoleTBase.h.

References MultipoleTBase::MaxFactorial.

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

◆ generateTanhCoefficients()

void MultipoleTBase::generateTanhCoefficients ( unsigned int  numDerivatives)
inherited

◆ getField() [1/3]

void MultipoleTBaseTest::getField ( const Kokkos::View< Vector_t< double, 3 > * >  ,
Kokkos::View< Vector_t< double, 3 > * >  ,
Kokkos::View< Vector_t< double, 3 > * >  ,
double  ,
size_t   
)
inlineoverride

Definition at line 35 of file TestMultipoleTBase.cpp.

◆ getField() [2/3]

bool MultipoleTBaseTest::getField ( const Vector_t< double, 3 > &  ,
Vector_t< double, 3 > &  ,
Vector_t< double, 3 > &  ,
double   
)
inlineoverridevirtual

Return the field for a single point

Implements MultipoleTBase.

Definition at line 39 of file TestMultipoleTBase.cpp.

◆ getField() [3/3]

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 virtualinherited

Return the field for an array of points

Implemented in MultipoleTCurvedConstRadius, and MultipoleTStraight.

◆ getGeometry()

BGeometryBase * MultipoleTBaseTest::getGeometry ( )
inlineoverridevirtual

Return the cell geometry

Implements MultipoleTBase.

Definition at line 34 of file TestMultipoleTBase.cpp.

◆ initialise()

void MultipoleTBaseTest::initialise ( )
inlineoverridevirtual

Initialise the element

Implements MultipoleTBase.

Definition at line 33 of file TestMultipoleTBase.cpp.

◆ powerInteger()

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

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 MultipoleTBase::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 
)
staticinherited

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

◆ SetUpTestSuite()

static void MultipoleTBaseTest::SetUpTestSuite ( )
inlinestatic

Definition at line 24 of file TestMultipoleTBase.cpp.

◆ tanhCoefficients()

std::vector< double > MultipoleTBaseTest::tanhCoefficients ( const unsigned int  derivative) const
inline

Definition at line 46 of file TestMultipoleTBase.cpp.

References MultipoleTBase::tanhCoefficientsHost_m.

◆ TearDownTestSuite()

static void MultipoleTBaseTest::TearDownTestSuite ( )
inlinestatic

Definition at line 30 of file TestMultipoleTBase.cpp.

Member Data Documentation

◆ element_m

◆ MaxDerivatives

constexpr unsigned int MultipoleTBase::MaxDerivatives = 20
staticconstexprinherited

Definition at line 103 of file MultipoleTBase.h.

Referenced by MultipoleT::validateConfiguration().

◆ MaxFactorial

constexpr size_t MultipoleTBase::MaxFactorial = 20
staticconstexprinherited

Definition at line 101 of file MultipoleTBase.h.

Referenced by MultipoleTBase::factorial().

◆ MaxPowerInteger

constexpr size_t MultipoleTBase::MaxPowerInteger = 20
staticconstexprinherited

Definition at line 102 of file MultipoleTBase.h.

◆ tanhCoefficientsGpu_m

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

Definition at line 82 of file MultipoleTBase.h.

Referenced by MultipoleTBase::generateTanhCoefficients().

◆ tanhCoefficientsHost_m

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

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