OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
SFunction.h
Go to the documentation of this file.
1#ifndef OPAL_SFunction_HH
2#define OPAL_SFunction_HH
3
4// ------------------------------------------------------------------------
5// $RCSfile: SFunction.h,v $
6// ------------------------------------------------------------------------
7// $Revision: 1.1.1.1 $
8// ------------------------------------------------------------------------
9// Copyright: see Copyright.readme
10// ------------------------------------------------------------------------
11//
12// Class: SFunction
13//
14// ------------------------------------------------------------------------
15//
16// $Date: 2000/03/27 09:33:42 $
17// $Author: Andreas Adelmann $
18//
19// ------------------------------------------------------------------------
20
21
22// Class SFunction
23// ------------------------------------------------------------------------
25// This class handles the position funcitions SI(), SC(), and SO().
26// The class SFunction is instantiated by the class AlignHandler, which
27// also takes care of updating the arc length. The methods arcIn(),
28// arcCtr(), and arcOut() can then return s at the entrance, at the centre,
29// and at the end of the current element respectively.
30
31class SFunction {
32
33public:
34
36 // This constructor resets the arc length and registers [b]this[/b]
37 // as the current arc length function. Only one such function may
38 // be active at any time.
39 SFunction();
40
42 // Unregister [b]this[/b] as the current arc length function.
43 ~SFunction();
44
46 static double arcIn();
47
49 static double arcCtr();
50
52 static double arcOut();
53
55 void reset();
56
58 void update(double length);
59
60private:
61
62 // Not implemented.
64 void operator=(const SFunction &);
65
66 // The function evaluating the arc length.
67 double position(double flag) const;
68
69 // The length of the current element.
71
72 // The arc length to the exit of the current element.
73 double exitArc;
74
75 // The currently active S-function.
76 // Only one function may be active at any time.
77 static const SFunction *sfun;
78};
79
80#endif // OPAL_SFunction_HH
Functions of arc length.
Definition: SFunction.h:31
double exitArc
Definition: SFunction.h:73
double elementLength
Definition: SFunction.h:70
SFunction()
Default constructor.
Definition: SFunction.cpp:32
static double arcIn()
Return arc length at entrance SI().
Definition: SFunction.cpp:43
void operator=(const SFunction &)
static double arcOut()
Return arc length at exit SO().
Definition: SFunction.cpp:65
void reset()
Reset the arc length to zero.
Definition: SFunction.cpp:76
~SFunction()
Destructor.
Definition: SFunction.cpp:38
static const SFunction * sfun
Definition: SFunction.h:77
static double arcCtr()
Return arc length at center SC().
Definition: SFunction.cpp:54
double position(double flag) const
Definition: SFunction.cpp:88
SFunction(const SFunction &)
void update(double length)
Advance position by element length.
Definition: SFunction.cpp:82