OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
endfieldmodel::Enge Class Reference

#include <Enge.h>

Inheritance diagram for endfieldmodel::Enge:
Inheritance graph
[legend]
Collaboration diagram for endfieldmodel::Enge:
Collaboration graph
[legend]

Public Member Functions

 Enge ()
 
 Enge (const std::vector< double > a, double x0, double lambda, int max_index)
 
 ~Enge ()
 
EngeClone () const
 
std::vector< double > GetEngeParameters () const
 
void SetEngeParameters (std::vector< double > a)
 
double GetLambda () const
 
void SetLambda (double lambda)
 
double GetX0 () const
 
void SetX0 (double x0)
 
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 EndFieldModelclone () const =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)
 

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
 

Detailed Description

Definition at line 38 of file Enge.h.

Constructor & Destructor Documentation

endfieldmodel::Enge::Enge ( )
inline

Default constructor

Definition at line 41 of file Enge.h.

References SetEngeDiffIndices().

Here is the call graph for this function:

endfieldmodel::Enge::Enge ( const std::vector< double >  a,
double  x0,
double  lambda,
int  max_index 
)
inline

Builds Enge function with parameters a_0, a_1, ..., lambda and x0.

max_index is the maximum derivative that will be used in calculation if, after setup, you find you need to calculate higher derivatives, you can just call SetEngeDiffIndices(n) where n is the highest derivative you think you will need.

Definition at line 49 of file Enge.h.

References SetEngeDiffIndices().

Here is the call graph for this function:

endfieldmodel::Enge::~Enge ( )
inline

Destructor - no mallocs, so does nothing

Definition at line 52 of file Enge.h.

Member Function Documentation

Enge* endfieldmodel::Enge::Clone ( ) const

Inheritable copy constructor - no mallocs, so does nothing

double endfieldmodel::Enge::GetDoubleEnge ( double  x,
int  n 
) const
inline

Returns \(Enge(x-x0) + Enge(-x-x0)-1\) and its derivatives

Definition at line 130 of file Enge.h.

References _x0, and GetEnge().

Here is the call graph for this function:

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 Physics::e, GetQIndex(), and GN().

Referenced by GetDoubleEnge().

Here is the call graph for this function:

std::vector<double> endfieldmodel::Enge::GetEngeParameters ( ) const
inline

Returns the enge parameters (a_i)

Definition at line 58 of file Enge.h.

References _a.

std::vector< std::vector< int > > endfieldmodel::Enge::GetHIndex ( int  n)
inlinestatic

Return the indices for calculating the nth derivative of g(x) ito h(x)

Definition at line 125 of file Enge.h.

References _h, Hypervolume::n, and SetEngeDiffIndices().

Here is the call graph for this function:

double endfieldmodel::Enge::GetLambda ( ) const
inline

Returns the value of lambda

Definition at line 64 of file Enge.h.

References _lambda.

std::vector< std::vector< int > > endfieldmodel::Enge::GetQIndex ( int  n)
inlinestatic

Return the indices for calculating the nth derivative of Enge ito g(x)

Definition at line 120 of file Enge.h.

References _q, Hypervolume::n, and SetEngeDiffIndices().

Referenced by GetEnge().

Here is the call graph for this function:

double endfieldmodel::Enge::GetX0 ( ) const
inline

Returns the value of x0

Definition at line 70 of file Enge.h.

References _x0.

double endfieldmodel::Enge::GN ( double  x,
int  n 
) const

Returns \(g(x)\) or its \(n^{th}\) derivative.

Here \(g(x) = 1+exp(h(x))\). Please call SetEngeDiffIndices(n) before calling if n > max_index

Definition at line 71 of file Enge.cpp.

References _h, exp(), HN(), and Hypervolume::n.

Referenced by GetEnge().

Here is the call graph for this function:

double endfieldmodel::Enge::HN ( double  x,
int  n 
) const

Returns \(h(x)\) or its \(n^{th}\) derivative.

Here \(h(x) = a_0 + a_1 x/\lambda + a_2 x^2/lambda^2 + \ldots \) Please call SetEngeDiffIndices(n) before calling if n > max_index

Definition at line 59 of file Enge.cpp.

References _a, and _lambda.

Referenced by GN().

void endfieldmodel::Enge::SetEngeDiffIndices ( size_t  n)
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 93 of file Enge.cpp.

References _h, _q, and endfieldmodel::CompactVector().

Referenced by Enge(), GetHIndex(), and GetQIndex().

Here is the call graph for this function:

void endfieldmodel::Enge::SetEngeParameters ( std::vector< double >  a)
inline

Sets the enge parameters (a_i)

Definition at line 61 of file Enge.h.

References _a.

void endfieldmodel::Enge::SetLambda ( double  lambda)
inline

Sets the value of lambda

Definition at line 67 of file Enge.h.

References _lambda.

void endfieldmodel::Enge::SetX0 ( double  x0)
inline

Sets the value of x0

Definition at line 73 of file Enge.h.

References _x0.

Member Data Documentation

std::vector<double> endfieldmodel::Enge::_a
private

Definition at line 111 of file Enge.h.

Referenced by GetEngeParameters(), HN(), and SetEngeParameters().

std::vector< std::vector< std::vector< int > > > endfieldmodel::Enge::_h
staticprivate

Indexes the derivatives of g in terms of h

Definition at line 117 of file Enge.h.

Referenced by GetHIndex(), GN(), and SetEngeDiffIndices().

double endfieldmodel::Enge::_lambda
private

Definition at line 112 of file Enge.h.

Referenced by GetLambda(), HN(), and SetLambda().

std::vector< std::vector< std::vector< int > > > endfieldmodel::Enge::_q
staticprivate

Indexes the derivatives of enge in terms of g

Definition at line 115 of file Enge.h.

Referenced by GetQIndex(), and SetEngeDiffIndices().

double endfieldmodel::Enge::_x0
private

Definition at line 112 of file Enge.h.

Referenced by GetDoubleEnge(), GetX0(), and SetX0().


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