OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
|
#include <Enge.h>
Public Member Functions | |
Enge () | |
Enge (const std::vector< double > a, double x0, double lambda) | |
~Enge () | |
Enge * | clone () const |
void | rescale (double scaleFactor) |
double | function (double x, int n) const |
double | getEndLength () const |
double | getCentreLength () const |
std::ostream & | print (std::ostream &out) const |
std::vector< double > | getCoefficients () const |
void | setCoefficients (std::vector< double > a) |
double | getLambda () const |
void | setLambda (double lambda) |
double | getX0 () const |
void | setX0 (double x0) |
void | setMaximumDerivative (size_t n) |
double | getEnge (double x, int n) const |
double | getDoubleEnge (double x, int n) const |
double | hN (double x, int n) const |
double | gN (double x, int n) const |
Public Member Functions inherited from endfieldmodel::EndFieldModel | |
virtual | ~EndFieldModel () |
virtual std::ostream & | print (std::ostream &out) const =0 |
virtual double | function (double x, int n) const =0 |
virtual double | getCentreLength () const =0 |
virtual double | getEndLength () const =0 |
virtual EndFieldModel * | clone () const =0 |
virtual void | setMaximumDerivative (size_t n)=0 |
virtual void | rescale (double scaleFactor)=0 |
Static Public Member Functions | |
static void | setEngeDiffIndices (size_t n) |
static std::vector< std::vector< int > > | getQIndex (int n) |
static std::vector< std::vector< int > > | getHIndex (int n) |
Static Public Member Functions inherited from endfieldmodel::EndFieldModel | |
static std::shared_ptr< EndFieldModel > | getEndFieldModel (std::string name) |
static void | setEndFieldModel (std::string name, std::shared_ptr< EndFieldModel > efm) |
static std::string | getName (std::shared_ptr< EndFieldModel > efm) |
Private Member Functions | |
Enge (const Enge &enge) | |
Enge & | operator= (const Enge &enge) |
Private Attributes | |
std::vector< double > | _a |
double | _lambda |
double | _x0 |
Static Private Attributes | |
static std::vector< std::vector< std::vector< int > > > | _q |
static std::vector< std::vector< std::vector< int > > > | _h |
Enge class is a symmetric Enge function for analytical field models
Enge function is
\(f(x) = 1/(1+exp(h(x-x0)))+1/(1+exp(h(-x-x0)))-1\).
where h is a polynomial in x/lambda with polynomial coefficients a
|
inline |
Default constructor
Definition at line 50 of file Enge.h.
References setEngeDiffIndices().
Referenced by clone().
endfieldmodel::Enge::Enge | ( | const std::vector< double > | a, |
double | x0, | ||
double | lambda | ||
) |
|
inline |
|
private |
|
virtual |
|
inlinevirtual |
Return the value of enge(x+x0) + enge(-x-x0) at some point x
Implements endfieldmodel::EndFieldModel.
Definition at line 155 of file Enge.h.
References getDoubleEnge(), and Hypervolume::n.
|
inlinevirtual |
Nominal centre length is x0/2
Implements endfieldmodel::EndFieldModel.
Definition at line 176 of file Enge.h.
References _x0.
|
inline |
|
inline |
Returns \(Enge(x-x0) + Enge(-x-x0)-1\) and its derivatives
Definition at line 167 of file Enge.h.
References _x0, getEnge(), and Hypervolume::n.
Referenced by function().
|
inlinevirtual |
Nominal end length is lambda
Implements endfieldmodel::EndFieldModel.
Definition at line 180 of file Enge.h.
References _lambda.
double endfieldmodel::Enge::getEnge | ( | double | x, |
int | n | ||
) | const |
Returns the value of the Enge function or its \(n^{th}\) derivative.
Please call setEngeDiffIndices(n) before calling if n > max_index
Definition at line 40 of file Enge.cpp.
References getQIndex(), and Hypervolume::n.
Referenced by getDoubleEnge().
|
inlinestatic |
Return the indices for calculating the nth derivative of g(x) ito h(x)
Definition at line 163 of file Enge.h.
References _h, and Hypervolume::n.
|
inline |
|
inlinestatic |
|
inline |
double endfieldmodel::Enge::gN | ( | double | x, |
int | n | ||
) | const |
double endfieldmodel::Enge::hN | ( | double | x, |
int | n | ||
) | const |
|
virtual |
|
virtual |
Rescale so Enge(x) -> Enge(scaleFactor*x)
Sets x0 to scaleFactor*x0 and lambda to scaleFactor*lambda
Implements endfieldmodel::EndFieldModel.
|
inline |
|
static |
Recursively calculate the indices for Enge and H
This will calculate the indices for Enge and H that are required to calculate the differential up to order n.
Definition at line 91 of file Enge.cpp.
References _h, _q, endfieldmodel::CompactVector(), and Hypervolume::n.
Referenced by Enge(), endfieldmodel::AsymmetricEnge::setMaximumDerivative(), and setMaximumDerivative().
|
inline |
|
inlinevirtual |
Calls setEngeDiffIndices to set the maximum derivative
Implements endfieldmodel::EndFieldModel.
Definition at line 151 of file Enge.h.
References Hypervolume::n, and setEngeDiffIndices().
|
inline |
|
private |
Definition at line 142 of file Enge.h.
Referenced by clone(), getCoefficients(), hN(), print(), and setCoefficients().
|
staticprivate |
Indexes the derivatives of g in terms of h
Definition at line 148 of file Enge.h.
Referenced by getHIndex(), gN(), and setEngeDiffIndices().
|
private |
Definition at line 143 of file Enge.h.
Referenced by clone(), getEndLength(), getLambda(), hN(), print(), rescale(), and setLambda().
|
staticprivate |
Indexes the derivatives of enge in terms of g
Definition at line 146 of file Enge.h.
Referenced by getQIndex(), and setEngeDiffIndices().
|
private |
Definition at line 143 of file Enge.h.
Referenced by clone(), getCentreLength(), getDoubleEnge(), getX0(), print(), rescale(), and setX0().