C++ mpi module for stochmagnet_main Package
SM_TimeStepper.h
1 #ifndef SM_TimeStepper_H
2 #define SM_TimeStepper_H
3 
4 
5 #include "SM_Object.h"
6 
13 class SM_TimeStepper : public SM_Object {
14 
15  //attributes
16 private :
17 
18  //time step
19  tReal mTimeStep;
20 
21 
22 
23 
24 
25  //association
26 
27 
28 
29 public:
30  // CONSTRUCTORS
34  mTimeStep=1.;
35 
36  }
37 
38  // DESTRUCTORS
41  virtual ~SM_TimeStepper(void) {
42  }
43 
44 public :
45 
46  //Instance building
47  //=================
48 
52  inline static CORE_UniquePointer<SM_TimeStepper> New() {
53  return CORE_UniquePointer<SM_TimeStepper>(new SM_TimeStepper(),SM_TimeStepper::Delete());
54  }
55 
56 
57  //MEMORY
58 
72  virtual tMemSize getMemorySize() const {
73  return sizeof(*this)+getContentsMemorySize();
74  }
75 
76  //SET & GET methods
77 
78 
79 public:
83  inline void copy(const SM_TimeStepper& T) {
84 
85  mTimeStep=T.getTimeStep();
86  }
87 
88 
92  virtual void adimensionize(const tReal& cT) {
93  mTimeStep/=cT;
94 
95  }
99  inline void setTimeStep(const tReal& dt) {
100  //ASSERT_IN(dt>CORE_Constants<tReal>::EPSILON);
101  mTimeStep=dt;
102 
103  }
104 
108  inline const tReal& getTimeStep() const {
109  return mTimeStep;
110  }
111 
112 
116  virtual tString toString() const override {
117  std::stringstream ret;
118  //print id
119  ret<<SM_Object::toString()<<"\n";
120  ret<<"time step:"<<mTimeStep<<"\n";
121 
122  //return the value
123  return ret.str();
124 
125  }
126 
127 
128 
129 };
130 
131 
132 #endif
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:278
virtual tString toString() const
return the string representation of the object node
Definition: CORE_Object.h:333
This class is a base class for Stoch Microm package.
Definition: SM_Object.h:36
This class is describes a time stepper.
Definition: SM_TimeStepper.h:13
virtual void adimensionize(const tReal &cT)
adimensionize operator with characteric field value in J
Definition: SM_TimeStepper.h:92
void copy(const SM_TimeStepper &T)
copy the time stepper
Definition: SM_TimeStepper.h:83
static CORE_UniquePointer< SM_TimeStepper > New()
build a new instance of a TimeStepper
Definition: SM_TimeStepper.h:52
const tReal & getTimeStep() const
return the time step
Definition: SM_TimeStepper.h:108
virtual tString toString() const override
turn the class into a string representation
Definition: SM_TimeStepper.h:116
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_TimeStepper.h:72
SM_TimeStepper(void)
create a network class
Definition: SM_TimeStepper.h:33
void setTimeStep(const tReal &dt)
set the time step
Definition: SM_TimeStepper.h:99
virtual ~SM_TimeStepper(void)
destroy
Definition: SM_TimeStepper.h:41