C++ main module for emicrom Package  1.0
EMM_Stepper.h
Go to the documentation of this file.
1 #ifndef EMM_Stepper_H
2 #define EMM_Stepper_H
3 
4 #include "EMM_Object.h"
5 
7 
8 #include "EMM_RealField.h"
9 
18 class EMM_Stepper : public EMM_Object {
19 
21  // ATTRIBUTES
22 
23 public:
24 
25 
26 
27 private:
28  //set the dt factor
30 
31  //set the end time
33  //set the characteristic time
35  //time steps number
37 
38  //constant time step
40 
41  //syste to optimize
42  WP::EMM_LandauLifschitzSystem mSystem;
43 
44 protected:
45  // METHODS
46 
47  // CONSTRUCTORS
48 
51  EMM_Stepper(void);
52 
53 
54 
55  // DESTRUCTORS
56 
57 
60  virtual ~EMM_Stepper(void);
61 
62 
63 private:
64  // SET methods
65 
66 public:
67 
72  tBoolean setSystem(SP::EMM_LandauLifschitzSystem system);
75  void resetSystem();
76 
77 
81  inline void setCharacteristicTime(const tReal& t) {
82  mCharacteristicTime=t;
83  }
88  inline void setTargetTime(const tReal& t){
89  mEndTime=t;
90  if (mTimeStepsNumber>0) mDt=mEndTime/mTimeStepsNumber;
91  else mDt=mEndTime;
92  }
93 
97  inline void setDt(const tReal& dt) {
98  mDt=dt;
99  }
100 
104  inline void setDtFactor(const tReal& f) {
105  mDtFactor=f;
106  }
109  inline void setTimeStepsNumber(const tUInteger& n) {
110  mTimeStepsNumber=n;
111  if (n>1) mDt=mEndTime/(n-1);
112  else mDt=mEndTime+1;
113  }
114 
115 
116 
117  // GET methods
118 
119 
120 public:
124  inline const tReal& getDtFactor() const {
125  return mDtFactor;
126  }
130  inline const tReal& getTargetTime() const {
131  return mEndTime;
132  }
136  inline const tReal& getCharacteristicTime() const {
137  return mCharacteristicTime;
138  }
139 
142  inline const tUInteger& getTimeStepsNumber() const {
143  return mTimeStepsNumber;
144  }
145 
149  inline const tReal& getDt() const {
150  return mDt;
151  }
152 
156  inline tReal& getDt() {
157  return mDt;
158  }
159 
160 
161 
162 protected:
163 
164 
169  virtual tBoolean isSystemCompatible(SPC::EMM_LandauLifschitzSystem system) const {
170  return (system.get()!=null);
171  }
172 
173 
174 
178  inline SPC::EMM_LandauLifschitzSystem getSystem() const {
179  SPC::EMM_LandauLifschitzSystem sys=mSystem.lock();
180  return sys;
181  }
185  inline SP::EMM_LandauLifschitzSystem getSystem() {
186  SP::EMM_LandauLifschitzSystem sys=mSystem.lock();
187  return sys;
188  }
189 
190 public:
196  virtual tBoolean computeNewTimeStep(tReal& dt,tUInteger& nEvaluations)=0;
197 
198 public:
199  // OTHERS methods
200 
204  virtual tString toString() const;
205 
206 
207 };
208 
209 #endif
tReal mCharacteristicTime
Definition: EMM_Stepper.h:34
This class is a base class of E-MicromM core package.
Definition: EMM_Object.h:21
void setTargetTime(const tReal &t)
set the end time with respect of the characteristic time real time = t * getCharacteristicTime() ...
Definition: EMM_Stepper.h:88
void setDtFactor(const tReal &f)
set the dt factor
Definition: EMM_Stepper.h:104
tUInteger mTimeStepsNumber
Definition: EMM_Stepper.h:36
const tReal & getCharacteristicTime() const
get the characteristic time
Definition: EMM_Stepper.h:136
#define tUInteger
Definition: types.h:91
void resetSystem()
reset the reverse system relation
Definition: EMM_Stepper.cpp:38
void setDt(const tReal &dt)
set the time step
Definition: EMM_Stepper.h:97
const tReal & getDt() const
get the time step
Definition: EMM_Stepper.h:149
virtual ~EMM_Stepper(void)
destroy
Definition: EMM_Stepper.cpp:14
virtual tBoolean computeNewTimeStep(tReal &dt, tUInteger &nEvaluations)=0
compute the new time step
virtual tString toString() const
turn the regular time into a string
Definition: EMM_Stepper.cpp:49
#define tBoolean
Definition: types.h:139
WP::EMM_LandauLifschitzSystem mSystem
Definition: EMM_Stepper.h:42
SP::EMM_LandauLifschitzSystem getSystem()
get system for writing
Definition: EMM_Stepper.h:185
#define null
Definition: types.h:144
tReal mEndTime
Definition: EMM_Stepper.h:32
tReal & getDt()
get the time step
Definition: EMM_Stepper.h:156
virtual tBoolean isSystemCompatible(SPC::EMM_LandauLifschitzSystem system) const
return true if the system is compatible
Definition: EMM_Stepper.h:169
void setCharacteristicTime(const tReal &t)
set the characteristic time the real time will be t. mTc in seconds
Definition: EMM_Stepper.h:81
This class describes a time descriptor.
Definition: EMM_Stepper.h:18
EMM_Stepper(void)
create
Definition: EMM_Stepper.cpp:5
DEFINE_SPTR(EMM_LandauLifschitzSystem)
tBoolean setSystem(SP::EMM_LandauLifschitzSystem system)
set the reverse system relation
Definition: EMM_Stepper.cpp:18
This class describes a resolution of landau-lifschitz system of the Core Package for E-MicroM...
Definition: EMM_LandauLifschitzSystem.h:88
tReal mDtFactor
Definition: EMM_Stepper.h:29
const tUInteger & getTimeStepsNumber() const
get the time steps number
Definition: EMM_Stepper.h:142
#define tString
Definition: types.h:135
SPC::EMM_LandauLifschitzSystem getSystem() const
get system for reading
Definition: EMM_Stepper.h:178
SP_OBJECT(EMM_Stepper)
const tReal & getDtFactor() const
get the dt factor
Definition: EMM_Stepper.h:124
tReal mDt
Definition: EMM_Stepper.h:39
#define tReal
Definition: types.h:118
void setTimeStepsNumber(const tUInteger &n)
set the time steps number
Definition: EMM_Stepper.h:109
const tReal & getTargetTime() const
get the end time
Definition: EMM_Stepper.h:130