PSCF v1.4.0
fts/ramp/Ramp.h
1#ifndef RP_RAMP_H
2#define RP_RAMP_H
3
4#include <util/param/ParamComposite.h> // base class
5
6namespace Pscf {
7namespace Rp {
8
9 using namespace Util;
10
27 template <int D, class T>
28 class Ramp : public ParamComposite
29 {
30
31 public:
32
33 // Protected constructor and destructor (see below).
34
48 virtual void setup(int nStep);
49
55 virtual void setParameters(int iStep) = 0;
56
62 virtual void output()
63 {}
64
68 typename T::Simulator const & simulator() const;
69
70 protected:
71
77 Ramp(typename T::Simulator& simulator);
78
82 ~Ramp() = default;
83
87 typename T::Simulator& simulator();
88
90 int nStep_;
91
92 private:
93
95 typename T::Simulator* simulatorPtr_;
96
97 };
98
99 // Inline methods
100
101 // Return parent simulator by const reference.
102 template <int D, class T> inline
103 typename T::Simulator const & Ramp<D,T>::simulator() const
104 {
105 assert(simulatorPtr_);
106 return *simulatorPtr_;
107 }
108
109 // Return parent simulator by non-const reference.
110 template <int D, class T> inline
111 typename T::Simulator & Ramp<D,T>::simulator()
112 {
113 assert(simulatorPtr_);
114 return *simulatorPtr_;
115 }
116
117}
118}
119#endif
~Ramp()=default
Destructor.
Ramp(typename T::Simulator &simulator)
Constructor.
Definition Ramp.tpp:17
T::Simulator const & simulator() const
Get parent typename T::Simulator by const reference.
int nStep_
Number of steps planned for this simulation (set in setup).
virtual void output()
Output any results at the end of the simulation.
virtual void setup(int nStep)
Final setup before simulation loop, set value of nStep.
Definition Ramp.tpp:26
virtual void setParameters(int iStep)=0
Set new parameters values in associated System and Simulator.
ParamComposite()
Constructor.
Class templates for real-valued periodic fields.
PSCF package top-level namespace.