C++ main module for emicrom Package  1.0
EMMH_Hysteresis.h
Go to the documentation of this file.
1 #ifndef EMMH_Hysteresis_H
2 #define EMMH_Hysteresis_H
3 
4 #include "EMM_Object.h"
5 
6 
7 #include "EMMH_HysteresisFile.h"
8 
10 
29 class EMMH_Hysteresis : public EMM_Object {
31 
32  //attributes
33 private :
34 
35  //number of cycles
37 
38  //number of steps by cycle
40 
41  //steps for generating output
43 
44  //indicates if the hysteresis file has to be restored
46 
47  //external magnetic field
49 
50  //to set the magnetization at the begining of the hysteresis process
52 
53  //equilibrium magnetim indicators
55 
56  //flush for writing hysteresis file
58 
59  //indicates to remove old backup files
61 
62  //indicates if the magntzaisation time integration log is printed
64 
65  //hysteresis file
66  SP::EMMH_HysteresisFile mFile;
67 
68  //system to compute the hystereis
69  SP::EMM_LandauLifschitzSystem mSystem;
70 
71 
72 protected:
73  // CONSTRUCTORS
76  EMMH_Hysteresis(void);
77 
78  // DESTRUCTORS
81  virtual ~EMMH_Hysteresis(void);
82 
83 public:
87  inline static SP::EMMH_Hysteresis New() {
88  SP::EMMH_Hysteresis p(new EMMH_Hysteresis(),EMMH_Hysteresis::Delete());
89  p->setThis(p);
90  return p;
91  };
92 
93  //SET methods
94  //============
95 
96 
101  inline void setIsOldBackupFilesRemoved(const tBoolean& v) {
102  mIsBackupOldFilesRemoving=v;
103  }
104 
109  inline void setAreSystemLogsPrinted(const tBoolean& v) {
110  mAreSystemLogsPrinted=v;
111  }
112 
116  inline void setFlowSize(const tUSInt& n) {
117  mFlowSize=n;
118  }
119 
122  inline void setHysteresisFile(const tString& fileName) {
123  mFile=EMMH_HysteresisFile::New();
124  mFile->setFileName(fileName);
125  }
129  inline void setInitialMagnetizationField(const tString& initValue) {
130  mMInit=initValue;
131  }
132 
136  inline void setStepsNumber(const tUInteger& n) {
137  mStepsNumber=n;
138  }
142  inline void setHalfCyclesNumber(const tUInteger& n) {
143  mHalfCyclesNumber=n;
144  }
145 
149  inline void setOutputSteps(const tUInteger& n) {
150  mOutputSteps=n;
151  }
152 
156  inline void setIsRestoring(const tBoolean& v) {
157  mIsRestoring=v;
158  }
163  mHext.setSize(6);
164  mHext[0]=H[0];
165  mHext[1]=H[1];
166  mHext[2]=H[2];
167  }
168 
173  mHext.setSize(6);
174  mHext[3]=H[0];
175  mHext[4]=H[1];
176  mHext[5]=H[2];
177  }
178 
179 
184  if (fn.compare("")!=0) mHext.loadFromFieldFile(fn);
185  }
186 
187 
191  inline void setSystem(SP::EMM_LandauLifschitzSystem s) {
192  mSystem=s;
193  }
194 
200  inline static tString getSuffix(const tUInteger& i,const tUInteger& iHCycle) {
201  return CORE_Integer::toString(iHCycle,2)+"_"+CORE_Integer::toString(i,5);
202  }
203 private:
212  const tString& MinitFile,
213  EMM_LandauLifschitzSystem& system) const;
214 public:
215  //runner method
216  //=============
219  tBoolean run();
220 
221 };
222 
223 
224 #endif
This class is a base class of E-MicromM core package.
Definition: EMM_Object.h:21
void setFlowSize(const tUSInt &n)
set the flow size
Definition: EMMH_Hysteresis.h:116
void setInitialMagnetizationField(const tString &initValue)
set the initial magnetization field
Definition: EMMH_Hysteresis.h:129
EMM_RealArray mHext
Definition: EMMH_Hysteresis.h:48
tBoolean run()
run the hysteresis process
Definition: EMMH_Hysteresis.cpp:88
void setAreSystemLogsPrinted(const tBoolean &v)
set to true to print the logs of magnetization time integration system
Definition: EMMH_Hysteresis.h:109
virtual ~EMMH_Hysteresis(void)
destroy
Definition: EMMH_Hysteresis.cpp:24
void setIsRestoring(const tBoolean &v)
set true if the hysteresis file has to be completed
Definition: EMMH_Hysteresis.h:156
EMM_RealArray mM
Definition: EMMH_Hysteresis.h:54
tBoolean mIsRestoring
Definition: EMMH_Hysteresis.h:45
#define tUInteger
Definition: types.h:91
void setHysteresisFile(const tString &fileName)
set the hysteresis file
Definition: EMMH_Hysteresis.h:122
tUInteger mOutputSteps
Definition: EMMH_Hysteresis.h:42
void setFinalExternalMagneticExcitationField(const tReal H[3])
set the final external magnetic field
Definition: EMMH_Hysteresis.h:172
tUInteger mHalfCyclesNumber
Definition: EMMH_Hysteresis.h:36
SP::EMM_LandauLifschitzSystem mSystem
Definition: EMMH_Hysteresis.h:69
void setStepsNumber(const tUInteger &n)
set the number of steps
Definition: EMMH_Hysteresis.h:136
#define tUSInt
Definition: types.h:28
#define tBoolean
Definition: types.h:139
DEFINE_SPTR(EMMH_Hysteresis)
void setSize(const tUIndex &n)
set the size
Definition: CORE_Array.h:292
void setOutputSteps(const tUInteger &n)
set the output step for file generator
Definition: EMMH_Hysteresis.h:149
tString toString() const
return the string associated to the integer
Definition: CORE_Integer.h:106
static SP::EMMH_HysteresisFile New()
create a run class
Definition: EMMH_HysteresisFile.h:65
tBoolean mAreSystemLogsPrinted
Definition: EMMH_Hysteresis.h:63
SP::EMMH_HysteresisFile mFile
Definition: EMMH_Hysteresis.h:66
tBoolean loadFromFieldFile(const tString &fileName)
load the array froma field file
Definition: EMM_RealArray.cpp:17
void setHalfCyclesNumber(const tUInteger &n)
set the number of half cycles
Definition: EMMH_Hysteresis.h:142
This class describes a resolution of landau-lifschitz system of the Core Package for E-MicroM...
Definition: EMM_LandauLifschitzSystem.h:88
void setExternalMagneticExcitationField(const tString &fn)
set the external field for all steps
Definition: EMMH_Hysteresis.h:183
tUSInt mFlowSize
Definition: EMMH_Hysteresis.h:57
tUInteger mStepsNumber
Definition: EMMH_Hysteresis.h:39
This class describes a real array.
Definition: EMM_RealArray.h:16
#define tString
Definition: types.h:135
void setInitialExternalMagneticExcitationField(const tReal H[3])
set the initial external magnetic field
Definition: EMMH_Hysteresis.h:162
tBoolean mIsBackupOldFilesRemoving
Definition: EMMH_Hysteresis.h:60
SP_OBJECT(EMMH_Hysteresis)
EMMH_Hysteresis(void)
create
Definition: EMMH_Hysteresis.cpp:10
Definition: EMMH_Hysteresis.h:29
tString mMInit
Definition: EMMH_Hysteresis.h:51
static SP::EMMH_Hysteresis New()
create a run class
Definition: EMMH_Hysteresis.h:87
void setSystem(SP::EMM_LandauLifschitzSystem s)
set the system associated to the hysteresis file
Definition: EMMH_Hysteresis.h:191
#define tReal
Definition: types.h:118
static tString getSuffix(const tUInteger &i, const tUInteger &iHCycle)
create the suffix of file at datat i in half cycle iHCycle
Definition: EMMH_Hysteresis.h:200
void setIsOldBackupFilesRemoved(const tBoolean &v)
set to true if the old backup files has to be removed
Definition: EMMH_Hysteresis.h:101
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141