C++ main module for emicrom Package  1.0
EMM_PlanarAnisotropyOperator.h
Go to the documentation of this file.
1 #ifndef EMM_PlanarAnisotropyOperator_H
2 #define EMM_PlanarAnisotropyOperator_H
3 
4 
6 
55 
57  // ATTRIBUTES
58 
59 
60 private:
61 
62 public:
63 
64 
65  // ASSOCIATION
66 
67 private:
68 
69 
70 protected:
71 
72  // METHODS
73 
74  // CONSTRUCTORS
75 
79  }
80 
81  // DESTRUCTORS
82 
86  }
87 
88 
89 
90 public:
91 
92  //DATA Methods
93  //============
94 
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}=-U_i.U_j \f$
103  *
104  * @return the memory size of matrix A (6)
105  */
106  static inline tUSInt BuildDiscretizedMatrix(const tUCInt& nU,
107  const tReal* U,
108  tReal* A) {
109  if (nU<3) throw CORE_Exception("emicrom/core",
110  "EMM_PlanarAnisotropyOperator::BuildDiscretizedMatrix(nU,U,A)",
111  "nU ("+CORE_Integer::toString(nU)+") must be greater than 3");
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  for (k=0;k<3;k++) {
118  // l==k case
119  Ul=Uk;
120  for (l=k;l<3;l++) {
121  (*Akl)-=(*Uk)*(*Ul);
122  //next l
123  Akl++;
124  Ul++;
125 
126  } //end loop on l
127 
128  //next k
129  Uk++;
130  } // end loop on k
131 
132  return 6;
133  };
134 
135 
136 
137 };
138 
139 #endif
140 
#define tUCInt
Definition: types.h:21
#define tUSInt
Definition: types.h:28
EMM_PlanarAnisotropyOperator(void)
create
Definition: EMM_PlanarAnisotropyOperator.h:78
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
DEFINE_SPTR(EMM_PlanarAnisotropyOperator)
SP_OBJECT(EMM_PlanarAnisotropyOperator)
this class describes the exceptions raised for CORE package
Definition: CORE_Exception.h:15
static tUSInt BuildDiscretizedMatrix(const tUCInt &nU, const tReal *U, tReal *A)
Definition: EMM_PlanarAnisotropyOperator.h:106
This class describes the planar anistropy operator of the landau lifschitz system EMM_LandauLifschitz...
Definition: EMM_PlanarAnisotropyOperator.h:54
virtual ~EMM_PlanarAnisotropyOperator(void)
destroy
Definition: EMM_PlanarAnisotropyOperator.h:85
#define tReal
Definition: types.h:118