C++ main module for emicrom Package  1.0
EMM_ODETimeStep.h
Go to the documentation of this file.
1 #ifndef EMM_ODETimeStep_H
2 #define EMM_ODETimeStep_H
3 
4 #include "EMM_RegularTimeStep.h"
5 
6 
16 
18  // ATTRIBUTES
19 
20 public:
21 
22  static const tFlag L2_NORM=0;
23  static const tFlag LINF_NORM=1;
24 
25 
26 private:
27 
28  //number of iterations number
30  //torlerance for the error
32  //error norm
34 
35  //current error
37 
38  //evaluations number
40 
41  //time for computing Mt
43 
44 
45 
46  //M variable: the normalized magnetization field at t into current time step
47  SP::EMM_RealField mMt;
48 
49 protected:
50  // METHODS
51 
52  // CONSTRUCTORS
53 
56  EMM_ODETimeStep(void);
57 
58 
59 
60  // DESTRUCTORS
61 
62 
65  virtual ~EMM_ODETimeStep(void);
66 
67 
68 private:
69 
70 public:
71  // New share pointer constructor
74  static inline SP::EMM_ODETimeStep New() {
75  SP::EMM_ODETimeStep p(new EMM_ODETimeStep(),EMM_ODETimeStep::Delete());
76  p->setThis(p);
77  return p;
78  }
79 
80  // SET methods
85  virtual tBoolean isSystemCompatible(SPC::EMM_LandauLifschitzSystem system) const;
86 
87 
92  inline void setMaximumIterationsNumber(const tUSInt& n) {
93  mIterationsNumber=n;
94  }
98  inline void setMaximumError(const tReal& tol) {
99  mTolerance=tol;
100  }
106  inline void setErrorNorm(const tFlag& n) {
107  mErrorNorm=n;
108  }
114  inline void setErrorNorm(const tString& n) {
115  if (n.compare("linf")==0) setErrorNorm(LINF_NORM);
116  else setErrorNorm(L2_NORM);
117  }
121  inline const tFlag& getErrorNorm() const {
122  return mErrorNorm;
123  }
124 
125  // GET methods
131  t=mT;
132  return *mMt.get();
133  }
134 
138  inline const tReal& getError() const {
139  return mError;
140  }
144  inline const tUInteger& getEvaluationsNumber() const {
145  return mEvaluationsNumber;
146  }
147 
148 
149 public:
150  // OTHERS methods
155  virtual tBoolean computeNewTimeStep(tReal& dt);
156 
157 
158 
159 };
160 
161 #endif
DEFINE_SPTR(EMM_ODETimeStep)
void setErrorNorm(const tString &n)
set the error norm in
Definition: EMM_ODETimeStep.h:114
#define tUInteger
Definition: types.h:91
static SP::EMM_ODETimeStep New()
build a shared pointer associated to the class
Definition: EMM_ODETimeStep.h:74
virtual tBoolean isSystemCompatible(SPC::EMM_LandauLifschitzSystem system) const
return true if the system is compatible
Definition: EMM_ODETimeStep.cpp:33
tReal mT
Definition: EMM_ODETimeStep.h:42
virtual ~EMM_ODETimeStep(void)
destroy
Definition: EMM_ODETimeStep.cpp:31
static const tFlag LINF_NORM
Definition: EMM_ODETimeStep.h:23
tReal mTolerance
Definition: EMM_ODETimeStep.h:31
#define tUSInt
Definition: types.h:28
#define tBoolean
Definition: types.h:139
tFlag mErrorNorm
Definition: EMM_ODETimeStep.h:33
const tFlag & getErrorNorm() const
get the error norm in {L2_NORM,LINF_NORM}
Definition: EMM_ODETimeStep.h:121
tUSInt mIterationsNumber
Definition: EMM_ODETimeStep.h:29
void setMaximumIterationsNumber(const tUSInt &n)
set the max iterations number for computing a new time step
Definition: EMM_ODETimeStep.h:92
void setErrorNorm(const tFlag &n)
set the error norm in
Definition: EMM_ODETimeStep.h:106
SP::EMM_RealField mMt
Definition: EMM_ODETimeStep.h:47
virtual tBoolean computeNewTimeStep(tReal &dt)
compute the new time step
Definition: EMM_ODETimeStep.cpp:39
const EMM_RealField & getMagnetizationFieldAtTime(tReal &t) const
get the temporary magnetization field at t
Definition: EMM_ODETimeStep.h:130
tUInteger mEvaluationsNumber
Definition: EMM_ODETimeStep.h:39
EMM_ODETimeStep(void)
create
Definition: EMM_ODETimeStep.cpp:8
SP_OBJECT(EMM_ODETimeStep)
const tReal & getError() const
get the current error of the estimation
Definition: EMM_ODETimeStep.h:138
#define tString
Definition: types.h:135
static const tFlag L2_NORM
Definition: EMM_ODETimeStep.h:22
void setMaximumError(const tReal &tol)
set the tolerance error to compute a new time step
Definition: EMM_ODETimeStep.h:98
This class describes a real field.
Definition: EMM_RealField.h:21
This class describes an ODE Time step.
Definition: EMM_ODETimeStep.h:15
#define tReal
Definition: types.h:118
tReal mError
Definition: EMM_ODETimeStep.h:36
This class describes a regular time.
Definition: EMM_RegularTimeStep.h:15
const tUInteger & getEvaluationsNumber() const
get the number of Landau Lifschitz function call
Definition: EMM_ODETimeStep.h:144
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141
#define tFlag
Definition: types.h:74