C++ mpi module for stochmagnet_main Package
SM_Options.h
1 #ifndef SM_Options_H
2 #define SM_Options_H
3 
4 //inherits header
5 #include "CORE_Options.h"
6 
14 class SM_Options : public virtual CORE_Options {
15 
16  //attributes
17 private :
18 
19 
20 
21 protected:
22  // CONSTRUCTORS
25  SM_Options(void) {
26  }//end constructor method
27 
28  // DESTRUCTORS
31  virtual ~SM_Options(void) {
32  }//end destructor method
33 
34 
35 
36 public :
37  //MEMORY
38 
52  virtual tMemSize getMemorySize() const override{
53  return sizeof(*this)+getContentsMemorySize();
54  }//end getMemorySize Method
55 
56 
57  //shared pointer methods
58  //======================
59 
63  static inline CORE_UniquePointer<SM_Options> New() {
64  return CORE_UniquePointer<SM_Options>(new SM_Options(),
66  }
67 
68 
69 
70 
71  // MAIN Method
72 
73 public:
74 
75 public:
79  virtual void initManOptions(CORE_OptionsList& options) const override {
80 
82 
83  tString tab="\n\t\t\t";
84 
85  //beam
86  options.setManOption("beam","simulations-number","number of simulations");
87  options.setManOption("beam","beam"," beam in {'laudau-lifschitz', 'monte-carlo'}");
88 
89 
90 
91  //stochastic function
92  options.setManOption("stochastic","seed","seed of the random number generator at the begining of the beam simulations running. If negative seed is set to times(null)");
93  options.setManOption("stochastic","random-distribution","random distribution function in {'','boost','std','trng','mt'}");
94  options.setManOption("stochastic","random-generator","random number generator in {'','mt19937','lcg64','yarn2','mrg2','mrg3','mrg4','mrg5','mrg3s','mrg5s'}");
95 
96  //materials
97  options.setManOption("material","material-name","name of the material");
98  options.setManOption("material","mu_s","Atomic magnetic moment (x Mu_B ) Mu_B=9.2740e−24");
99  options.setManOption("material","J","exhange energy factor J/link)");
100  options.setManOption("material","D","DMI energy factor in RxRxR in J/link)");
101  options.setManOption("material","MF-correction","spin wave MF correction)");
102  options.setManOption("material","Ku","anisotropy energy factor (J/atom)");
103  options.setManOption("material","U","anisotropy directions ");
104  options.setManOption("material","crystal-type","anisotropy type in {uniaxial,planar,cubic} ");
105  options.setManOption("material","adimensionize","true to adimensionize");
106 
107 
108  //crystal-structure
109  options.setManOption("crystal structure","crystal-structure","bame of the structure in {bcc,fcc,line,grid2d,cgrid2d,grid3d,cgrid3d}");
110  options.setManOption("crystal structure","crystal-cell-size","[Hx,Hy,Hz] cell size in unit Angstroms of the structure");
111  //options.setManOption("material","crystal-is-atoms-number-uniform","atoms number per unit cell is uniform or not");
112 
113 
114  //network
115  options.setManOption("network","network-file","absolute/data path relative name of the network file ");
116  options.setManOption("network","network-size","[Nx,Ny,Nz] size of the network");
117  options.setManOption("network","network-periodicity","[Tx,Ty,Tz] periodicity on periodic cells");
118  options.setManOption("network","network-domain","domain definition of the network file");;
119 
120  //system
121  options.setManOption("system","S0","initial direction of magnetic moment in file or vector [S0.x,S0.y,S0.z]");
122  options.setManOption("system","is-S-saved","true to save the S at end of simulations");
123  options.setManOption("system","preconditioning-steps-number","number of steps for the system to reach the equilibrium");
124  options.setManOption("system","steps-number","number of steps for the system after the equilibrium is reached");
125 
126 
127  //zeeman operator
128  options.setManOption("operator","use-zeeman","true to use zeeman operator");
129  //heisenberg operator:
130  options.setManOption("operator","use-exchange","true to use exchange operator");
131  //DMI operator:
132  options.setManOption("operator","use-dmi","true to use DMI operator");
133 
134  //dipolar operator
135  options.setManOption("operator","use-dipolar","true to use dipolar operator");
136  options.setManOption("operator","use-macro-cell-dipolar","true to use macro cell dipolar operator instead of dipolar operator");
137 
138  //anisotropy operator
139  options.setManOption("operator","use-anisotropy","true to use anisotropy operator");
140 
141  //zeeman data
142  options.setManOption("operator/zeeman","Hext","external field in Tesla (T)");
143 
144  //macro cell dipolar data
145  options.setManOption("operator/macroCellDipolar","macro-cell-demagnetized-type","in {'as-external','continuous'}");
146  options.setManOption("operator/macroCellDipolar","macro-cell-demagnetized-updating-steps-number","steps number for updating demagnetized field");
147  options.setManOption("operator/macroCellDipolar","macro-cell-size","size of the macro cell in Angstrom ");
148  options.setManOption("operator/macroCellDipolar","macro-cell-margin","margin to build the macro cells in Angstrom");
149  options.setManOption("operator/macroCellDipolar","macro-cell-matrix","type of storage of the matrix={'packed-storage','','no-storage'}");
150  options.setManOption("operator/macroCellDipolar","macro-cell-core-type","type of core for macro cell computing in {'','master-<id>','all-master','no-master'}");
151 
152  //noise Temperature
153  options.setManOption("noise","temperature","temperature in Kelvin");
154 
155  //stochastic noise
156  options.setManOption("noise","stochastic-noise","the stochastic noise");
157 
158 
159  //output
160  std::stringstream drawnsMan;
161  drawnsMan<<"number of steps to make a drawn for computing stochastic data"<<"\n";
162  drawnsMan<<"\t\t\t 0: stochastic output is not called for each loop's stepper \n";
163  drawnsMan<<"\t\t\t s: stochastic output is called each s loop's steppers \n";
164  drawnsMan<<"\t\t\t the stochastic output is called at";
165  drawnsMan<<"\t\t\t\t - begining & ending of the beam simulations running \n";
166  drawnsMan<<"\t\t\t\t - begining & ending of one simulation of the beam \n";
167  options.setManOption("stochastic-output","stochastic-drawn-steps-number",drawnsMan.str());
168  options.setManOption("stochastic-output","stochastic-outputs","stochastic outputs list in {'trajectory','xdmf'}");
169 
170 
171 
172  //runner
173  options.setManOption("runner","is-templated-run","true to run the templated run method for beam");
174 
175  //cyclle
176  options.setManOption("cycle","is-step-cycle-seed-updated","true|false to update seed at each step of cycle");
177  options.setManOption("cycle","is-cycle-restoring","true to restore the cycle");
178  options.setManOption("cycle","is-stochastic-output-saved-at-each-cycle-step","true to save stochastic output at each cyle step");
179 
180  options.setManOption("cycle","hysteresis-Hext-range","hext ranges [Hext_0,Hext_1,nHexts] Hext_i a 3D vector in Tesla");
181  options.setManOption("cycle","hysteresis-backups-number","number of backups");
182  options.setManOption("cycle","hysteresis-backup-steps-number","number of cycle steps between 2 backups");
183  options.setManOption("cycle","hysteresis-are-critical-points-saved","true to save spin directions at critical points");
184  options.setManOption("cycle","temperature-range","temperature ranges [T_0,T_1,DT] in Kelvin");
185  options.setManOption("cycle","stochastic-range","stochastic range for J");
186  options.setManOption("cycle","time-step-range","log of time step in ps ranges [dt_0,dt_1,ddt]");
187 
188 
189  //stochastic output
190  std::stringstream v;
191  v<<"[\"xdmf\",\"trajectory\"] \n";
192  v<<"\t xdmf: save in an xdmf file at any time the direction of magnetic moments for epsilon=stochastic-noise-rate and simulation=stochastic-simulations \n";
193  v<<"\t trajectory: save in a text fiml at any time the direction of magnetic moments at stochastic-particles for epsilon=stochastic-noise-rate and simulation=stochastic-simulations \n";
194 
195  options.setManOption("stochastic-output","stochastic-outputs",v.str());
196  options.setManOption("stochastic-output","stochastic-simulations","simulation array indices to save trajectories in txt/xdmf files ");
197  options.setManOption("stochastic-output","stochastic-particles","particles array indices to save trajectories in txt files");
198  options.setManOption("stochastic-output","stochastic-JFunction","JFunctionName in {increase,decrease,cubic-decrease}");
199 
200  }//end initManOptions method
201 
205  virtual void initOptions(CORE_OptionsList& options) const override {
206  CORE_Options::initOptions(options);
207 
208  //options
209  options.setOptionValue("is-options-name-case-sensitive",false);
210 
211  //OpenMP options
212  options.setOptionValue("threads-number",0);
213 
214  //beam default options
215  options.setOptionValue("beam","landau-lifschitz");
216  //number of simulations
217  options.setOptionValue("simulations-number",1);
218  //stepper default options
219  options.setOptionValue("preconditioning-steps-number",0);
220  options.setOptionValue("steps-number",1000);
221 
222  //stochastic defualt options
223  options.setOptionValue("seed",0);
224  options.setOptionValue("random-distribution","trng");
225  options.setOptionValue("random-generator","mt19937");
226 
227  //materials default options
228 
229  options.setOptionValue("material-name","Fer");
230  options.setOptionValue("MF-correction",0.766);
231  options.setOptionValue("mu_s",2.22);
232  options.setOptionValue("J",7051e-24);
233  options.setOptionValue("Ku",0.565e-24);
234  options.setOptionValue("U",{1,0,0});
235  options.setOptionValue("crystal-type","uniaxial");
236  //options.setOptionValue("crystal-is-atoms-number-uniform","false");
237 
238 
239  //crsyatl structure
240  options.setOptionValue("crystal-structure","bcc");
241  options.setOptionValue("crystal-cell-size",{2.8661});
242 
243  //network default option
244  options.setOptionValue("network-size",{10,10,100});
245  options.setOptionValue("network-periodicity",{false});
246 
247  //system default options
248  options.setOptionValue("S0","[0,1,0]");
249  options.setOptionValue("is-S-saved","true");
250 
251 
252 
253  //operators defult options
254  options.setOptionValue("use-exchange",false);
255  options.setOptionValue("use-anisotropy",false);
256  options.setOptionValue("use-zeeman",false);
257  options.setOptionValue("use-dipolar",false);
258  options.setOptionValue("use-macro-cell-dipolar",false);
259 
260 
261 
262  options.setOptionValue("Hext",{0,0,0});
263 
264  options.setOptionValue("macro-cell-demagnetized-type","external");
265  options.setOptionValue("macro-cell-demagnetized-updating-steps-number",10);
266  options.setOptionValue("macro-cell-size",{2,2,2});
267  options.setOptionValue("macro-cell-margin",1.e-4);
268  options.setOptionValue("macro-cell-core-type","no-master");
269 
270  //mc options by default
271  options.setOptionValue("temperature",0);
272  options.setOptionValue("stochastic-noise",0);
273 
274  options.setOptionValue("is-templated-run",false);
275 
276  //output stochastic data
277  options.setOptionValue("stochastic-drawn-steps-number",1);
278 
279  options.setOptionValue("stochastic-simulations",{0});
280  options.setOptionValue("stochastic-particles",{0});
281  options.setOptionValue("is-stochastic-output-saved-at-each-cycle-step",true);
282 
283  options.setOptionValue("stochastic-JFunction","increase");
284 
285 
286  }//end initOptions method
287 
288 
289 
290 };//end class method
291 
292 
293 #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
This class is an list of options.
Definition: CORE_OptionsList.h:36
void setOptionValue(const tString &optName, const tBoolean &value)
set option
Definition: CORE_OptionsList.h:194
void setManOption(const tString &category, const tString &optName, const tString &man)
set man option
Definition: CORE_OptionsList.h:187
This class is the options of the runner.
Definition: CORE_Options.h:21
virtual void initManOptions(CORE_OptionsList &options) const
init the man of the options
Definition: CORE_Options.h:83
virtual void initOptions(CORE_OptionsList &options) const
default initialization of the options
Definition: CORE_Options.h:123
This class is the options of the package.
Definition: SM_Options.h:14
virtual void initManOptions(CORE_OptionsList &options) const override
init the man of the options
Definition: SM_Options.h:79
SM_Options(void)
create class instance
Definition: SM_Options.h:25
virtual ~SM_Options(void)
destroy class instance
Definition: SM_Options.h:31
virtual void initOptions(CORE_OptionsList &options) const override
default initialization of the options
Definition: SM_Options.h:205
static CORE_UniquePointer< SM_Options > New()
return a new unique pointer of this
Definition: SM_Options.h:63
virtual tMemSize getMemorySize() const override
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_Options.h:52