OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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// Class SFunction
22// ------------------------------------------------------------------------
24// This class handles the position funcitions SI(), SC(), and SO().
25// The class SFunction is instantiated by the class AlignHandler, which
26// also takes care of updating the arc length. The methods arcIn(),
27// arcCtr(), and arcOut() can then return s at the entrance, at the centre,
28// and at the end of the current element respectively.
29
30class SFunction {
31public:
33 // This constructor resets the arc length and registers [b]this[/b]
34 // as the current arc length function. Only one such function may
35 // be active at any time.
36 SFunction();
37
39 // Unregister [b]this[/b] as the current arc length function.
40 ~SFunction();
41
43 static double arcIn();
44
46 static double arcCtr();
47
49 static double arcOut();
50
52 void reset();
53
55 void update(double length);
56
57private:
58 // Not implemented.
60 void operator=(const SFunction&);
61
62 // The function evaluating the arc length.
63 double position(double flag) const;
64
65 // The length of the current element.
67
68 // The arc length to the exit of the current element.
69 double exitArc;
70
71 // The currently active S-function.
72 // Only one function may be active at any time.
73 static const SFunction* sfun;
74};
75
76#endif // OPAL_SFunction_HH
Functions of arc length.
Definition SFunction.h:30
double exitArc
Definition SFunction.h:69
double elementLength
Definition SFunction.h:66
SFunction()
Default constructor.
Definition SFunction.cpp:30
static double arcIn()
Return arc length at entrance SI().
Definition SFunction.cpp:37
void operator=(const SFunction &)
static double arcOut()
Return arc length at exit SO().
Definition SFunction.cpp:59
void reset()
Reset the arc length to zero.
Definition SFunction.cpp:70
~SFunction()
Destructor.
Definition SFunction.cpp:35
static const SFunction * sfun
Definition SFunction.h:73
static double arcCtr()
Return arc length at center SC().
Definition SFunction.cpp:48
double position(double flag) const
Definition SFunction.cpp:80
SFunction(const SFunction &)
void update(double length)
Advance position by element length.
Definition SFunction.cpp:75