OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
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 
31 class SFunction {
32 
33 public:
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 
60 private:
61 
62  // Not implemented.
63  SFunction(const SFunction &);
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.
70  double elementLength;
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
~SFunction()
Destructor.
Definition: SFunction.cpp:38
Functions of arc length.
Definition: SFunction.h:31
static double arcIn()
Return arc length at entrance SI().
Definition: SFunction.cpp:43
static double arcOut()
Return arc length at exit SO().
Definition: SFunction.cpp:65
SFunction()
Default constructor.
Definition: SFunction.cpp:32
void update(double length)
Advance position by element length.
Definition: SFunction.cpp:82
double exitArc
Definition: SFunction.h:73
static double arcCtr()
Return arc length at center SC().
Definition: SFunction.cpp:54
void reset()
Reset the arc length to zero.
Definition: SFunction.cpp:76
double position(double flag) const
Definition: SFunction.cpp:88
void operator=(const SFunction &)
double elementLength
Definition: SFunction.h:70
static const SFunction * sfun
Definition: SFunction.h:77