C++ main module for emicrom Package  1.0
EMM_UniaxialAnisotropyOperator.h
Go to the documentation of this file.
1 #ifndef EMM_UniaxialAnisotropyOperator_H
2 #define EMM_UniaxialAnisotropyOperator_H
3 
4 
6 
57 
59  // ATTRIBUTES
60 
61 
62 private:
63 
64 public:
65 
66 
67  // ASSOCIATION
68 
69 private:
70 
71 
72 protected:
73 
74  // METHODS
75 
76  // CONSTRUCTORS
77 
81  }
82 
83  // DESTRUCTORS
84 
88  }
89 
90 
91  //DATA Methods
92  //============
93 
94 public:
95  /* \brief build the symmetric matrix of size 6
96  * @param nU: size of U (nU>=3)
97  * @param U: anisotropy direction of size 3
98  * @param A: anisotropy matrix of size 6
99  *
100  * It computes the inferior part of the packed symmetric matrix A:
101  *
102  * \f$ A_{ij}=(-\delta_{ij}+U_i.U_j) \f$ where \f$ \delta_{ij}=1\f$ only and only if i=j, 0 otherwise.
103  *
104 
105  *
106  * @return the memory size of matrix A (6)
107  */
108  static inline tUSInt BuildDiscretizedMatrix(const tUCInt& nU,
109  const tReal* U,
110  tReal* A) {
111 
112  tDimension k,l;
113  const tReal *Ul;
114  const tReal *Uk=U;
115  tReal *Akl=A;
116  memset(A,0,6*sizeof(tReal));
117  if (nU<3) throw CORE_Exception("emicrom/core",
118  "EMM_UniaxialAnisotropyOperator::BuildDiscretizedMatrix(nU,U,A)",
119  "nU ("+CORE_Integer::toString(nU)+") must be greater than 3");
120  for (k=0;k<3;k++) {
121  // l==k case
122  (*Akl)=-1;
123  Ul=Uk;
124  for (l=k;l<3;l++) {
125  (*Akl)+=(*Uk)*(*Ul);
126  //next l
127  Akl++;
128  Ul++;
129 
130  } //end loop on l
131 
132  //next k
133  Uk++;
134  } // end loop on k
135 
136  return 6;
137  };
138 
139 };
140 #endif
This class describes the uniaxial anistropy operator of the landau lifschitz system EMM_LandauLifschi...
Definition: EMM_UniaxialAnisotropyOperator.h:56
virtual ~EMM_UniaxialAnisotropyOperator(void)
destroy
Definition: EMM_UniaxialAnisotropyOperator.h:87
#define tUCInt
Definition: types.h:21
#define tUSInt
Definition: types.h:28
DEFINE_SPTR(EMM_UniaxialAnisotropyOperator)
This class describes the linear anistropy operator of the landau lifschitz system EMM_LandauLifschitz...
Definition: EMM_LinearAnisotropyOperator.h:52
tString toString() const
return the string associated to the integer
Definition: CORE_Integer.h:106
#define tDimension
Definition: EMM_Types.h:10
SP_OBJECT(EMM_UniaxialAnisotropyOperator)
this class describes the exceptions raised for CORE package
Definition: CORE_Exception.h:15
EMM_UniaxialAnisotropyOperator(void)
create
Definition: EMM_UniaxialAnisotropyOperator.h:80
static tUSInt BuildDiscretizedMatrix(const tUCInt &nU, const tReal *U, tReal *A)
Definition: EMM_UniaxialAnisotropyOperator.h:108
#define tReal
Definition: types.h:118