C++ main module for emicrom Package  1.0
EMM_LandauLifschitzFunction.h
Go to the documentation of this file.
1 #ifndef EMM_LandauLifschitzFunction_H
2 #define EMM_LandauLifschitzFunction_H
3 
4 #include "EMM_Object.h"
5 
6 #include "EMM_RealArray.h"
7 #include "EMM_RealField.h"
8 
31 
33  // ATTRIBUTES
34 
35 public:
36 
37 
38 
39 
40 private:
41 
42  //alpha parameter of the landau lifschitz equation
44 
45  //beta parameter of the landau lifschitz equation
47 
48  //working array for computing function & gradient of the function
50  mutable tReal *mWork;
51 
52 protected:
53  // METHODS
54 
55  // CONSTRUCTORS
56 
60 
61 
62  // DESTRUCTORS
63 
64 
67  virtual ~EMM_LandauLifschitzFunction(void);
68 
69 public:
70 
71 
72  // SET methods
73 
74 
78  inline void setAlphaParameter(const tReal& v) {
79  mAlpha=v;
80  }
84  inline void setBetaParameter(const tReal& v) {
85  mBetas.setSize(1);
86  mBetas[0]=v;
87 
88  }
94  inline void setBetaParameter(const tUIndex& i,const tReal& v) {
95  if (i>=mBetas.getSize()) mBetas.setSize(i+1);
96  mBetas[i]=v;
97  }
98 
99 
100 
101  // GET methods
102  // ============
103 
107  inline const tReal& getAlphaParameter() const {
108  return mAlpha;
109  }
113  inline const tReal& getBetaParameter() const {
114  return mBetas[0];
115  }
119  inline const EMM_RealArray& getBetasParameter() const {
120  return mBetas;
121  }
126  return mBetas;
127  }
128 
129 
130 
131 
132 
133 
134 
135 public:
136 
137 
149  virtual void computeFunction(const EMM_RealArray& sigma,
150  const EMM_RealField& M,
151  const EMM_RealField& H,
152  EMM_RealField& F) const=0;
153 
154 protected:
155 
172  void computeFunction(const tUIndex& nCells,const tUSInt& dim,
173  const tReal& alpha,
174  const tBoolean& incB,const tReal* betas,
175  const tBoolean& incS,const tReal *sigmas,
176  const tReal* M,const tReal *H, tReal *F) const;
177 
178 
179 
193  void computeFunction(const tUIndex& nCells,const tUSInt& dim,
194  const tReal& alpha,const tReal& betaSigma,
195  const tReal* M,const tReal *H, tReal *F) const;
196 
197 
198 public:
215  virtual void computeGradFunction(const EMM_RealArray& sigma,
216  const EMM_RealField& M,
217  const EMM_RealField& H,
218  const EMM_RealField& D,
219  const EMM_RealField& GradH,
220  EMM_RealField& GradF) const=0;
221 
222 
223 protected:
224 
247  void computeGradFunction(const tUIndex& nCells,
248  const tUSInt& dim,
249  const tReal& alpha,
250  const tBoolean& incB,
251  const tReal* betas,
252  const tBoolean& incS,
253  const tReal* sigmas,
254  const tReal* M,
255  const tReal* H,
256  const tReal* D,
257  const tReal * GradH,
258  tReal *GradF) const;
259 
260 
280  void computeGradFunction(const tUIndex& nCells,
281  const tUSInt& dim,
282  const tReal& alpha,
283  const tReal& betaSigma,
284  const tReal* M,
285  const tReal* H,
286  const tReal* D,
287  const tReal * GradH,
288  tReal *GradF) const;
289 
290 public:
306  virtual void computePartialGradMFunction(const EMM_RealArray& sigma,
307  const EMM_RealField& M,
308  const EMM_RealField& H,
309  const EMM_RealField& D,
310  EMM_RealField& GradF) const=0;
311 protected:
333  void computePartialGradMFunction(const tUIndex& nCells,
334  const tUSInt& dim,
335  const tReal& alpha,
336  const tBoolean& incB,
337  const tReal* betas,
338  const tBoolean& incS,
339  const tReal* sigmas,
340  const tReal* M,
341  const tReal* H,
342  const tReal* D,
343  tReal *GradF) const;
344 public:
348  virtual tString toString() const;
349 
350 
351 };
352 
353 #endif
This class is a base class of E-MicromM core package.
Definition: EMM_Object.h:21
const tUIndex & getSize() const
return the size of the array for reading
Definition: CORE_Array.h:1018
const tReal & getAlphaParameter() const
set the alpha parameter
Definition: EMM_LandauLifschitzFunction.h:107
const tReal & getBetaParameter() const
get the beta parameter
Definition: EMM_LandauLifschitzFunction.h:113
tUSInt mLDW
Definition: EMM_LandauLifschitzFunction.h:49
virtual ~EMM_LandauLifschitzFunction(void)
destroy the class
Definition: EMM_LandauLifschitzFunction.cpp:29
virtual void computeGradFunction(const EMM_RealArray &sigma, const EMM_RealField &M, const EMM_RealField &H, const EMM_RealField &D, const EMM_RealField &GradH, EMM_RealField &GradF) const =0
compute the gradient landau-lifschitz function at the direction in M
EMM_LandauLifschitzFunction(void)
create the class
Definition: EMM_LandauLifschitzFunction.cpp:8
const EMM_RealArray & getBetasParameter() const
get the beta parameters for each cell. If the magbetization at saturation is not the same at each cel...
Definition: EMM_LandauLifschitzFunction.h:119
void setBetaParameter(const tReal &v)
set the beta parameter of the equation
Definition: EMM_LandauLifschitzFunction.h:84
#define tUSInt
Definition: types.h:28
#define tBoolean
Definition: types.h:139
void setBetaParameter(const tUIndex &i, const tReal &v)
set the beta parameter of the equation at index
Definition: EMM_LandauLifschitzFunction.h:94
void setSize(const tUIndex &n)
set the size
Definition: CORE_Array.h:292
virtual void computePartialGradMFunction(const EMM_RealArray &sigma, const EMM_RealField &M, const EMM_RealField &H, const EMM_RealField &D, EMM_RealField &GradF) const =0
compute the partial gradient with respect of M of the landau-lifschitz function at the direction in ...
tReal * mWork
Definition: EMM_LandauLifschitzFunction.h:50
EMM_RealArray mBetas
Definition: EMM_LandauLifschitzFunction.h:46
This class describes a landau lischitz function & utilitis:
Definition: EMM_LandauLifschitzFunction.h:30
EMM_RealArray & getBetasParameter()
get the beta parameters for each cell. If the magbetization at saturation is not the same at each cel...
Definition: EMM_LandauLifschitzFunction.h:125
void setAlphaParameter(const tReal &v)
set the alpha parameter of the equation
Definition: EMM_LandauLifschitzFunction.h:78
#define tUIndex
Definition: types.h:126
This class describes a real array.
Definition: EMM_RealArray.h:16
tReal mAlpha
Definition: EMM_LandauLifschitzFunction.h:43
#define tString
Definition: types.h:135
virtual tString toString() const
turn the class into a string
Definition: EMM_LandauLifschitzFunction.cpp:671
DEFINE_SPTR(EMM_LandauLifschitzFunction)
virtual void computeFunction(const EMM_RealArray &sigma, const EMM_RealField &M, const EMM_RealField &H, EMM_RealField &F) const =0
compute the landau-lifschitz function
This class describes a real field.
Definition: EMM_RealField.h:21
SP_OBJECT(EMM_LandauLifschitzFunction)
#define tReal
Definition: types.h:118