C++ main module for emicrom Package  1.0
EMM_MagnetostrictionOperator.h
Go to the documentation of this file.
1 #ifndef EMM_MagnetostrictionOperator_H
2 #define EMM_MagnetostrictionOperator_H
3 
5 
7 
8 
9 #include "CORE_MorseArray.h"
10 
208 
210  // ATTRIBUTES
211 
212 
213 private:
214 
217 
218 public:
219 
220 
221  // ASSOCIATION
222 
223 private:
224 
225 
226 
227  //displacement operator
228  SP::EMM_DisplacementOperator mDisplacementOperator;
229 
230 
231 
232 protected:
233 
234  // METHODS
235 
236  // CONSTRUCTORS
237 
241 
242  // DESTRUCTORS
243 
246  virtual ~EMM_MagnetostrictionOperator(void);
247 
248 
249 public:
250 
251 
252 
253  // SET methods
254  // ===========
255 
259  virtual tBoolean isAffine() const {
260  return false;
261  }
266  return false;
267  };
268 
277  virtual tULLInt getMemorySize() const {
279  mDisplacementOperator->getMemorySize();
280  }
281 
282  //OPERATOR FIELDS Methods
283  //====================
284 
288  inline void setIsMagneticAdimension(const tBoolean& v) {
289  mIsMagneticAdimension=v;
290  }
291 
296  void setDisplacementMethod(const tString& m);
297 
298 
302  void setDisplacementOperator(SP::EMM_DisplacementOperator op);
303 
307 
312  return *mDisplacementOperator.get();
313  }
318  return *mDisplacementOperator.get();
319  }
320 
321 
322 
326  virtual tUSInt getDataFieldsNumber() const {
327  return mDisplacementOperator->getDataFieldsNumber();
328  }
329 
339  virtual tBoolean getDataFieldSpace(const tUSInt& index,tString& dataName,tFlag& supportType,tString& dFieldType,tUIndex& n,tDimension& dim) const {
340 
341  return mDisplacementOperator->getDataFieldSpace(index,dataName,supportType,dFieldType,n,dim);
342 
343  }
352  virtual tBoolean getDataField(const tUSInt& index,tString& dataName,tUIndex& n,tDimension& dim,const float *& values) const {
353 
354  return mDisplacementOperator->getDataField(index,dataName,n,dim,values);
355  }
356 
365  virtual tBoolean getDataField(const tUSInt& index,tString& dataName,tUIndex& n,tDimension& dim,const double *& values) const {
366 
367  return mDisplacementOperator->getDataField(index,dataName,n,dim,values);
368 
369  }
378  virtual tBoolean getDataField(const tUSInt& index,tString& dataName,tUIndex& n,tDimension& dim,const long double *& values) const {
379 
380  return mDisplacementOperator->getDataField(index,dataName,n,dim,values);
381 
382  }
383 public:
390  virtual tBoolean backup(const tString& prefix,const tString& suffix,const tString& ext) const;
398  virtual tBoolean restore(const EMM_LandauLifschitzSystem& system,
399  const tString& prefix,const tString& suffix,const tString& ext);
400 
401 public:
410  virtual tBoolean computeFieldsAtTime(const tReal& t,
411  const tFlag& order,
412  const EMM_RealArray& sigma,
413  const EMM_RealField& dM_dt0,
414  const EMM_RealField& M0);
415 
416 
417 
418 
425  virtual tBoolean updateAtNextTimeStep(const tReal& dt,
426  const EMM_RealArray& sigma,
427  const EMM_RealField& Mt);
428 
429  //DATA methods
430  //============
431 
440  virtual void adimensionize(const tReal& Le,const tReal& Ms,const tReal& T,const tReal& L) {
441 
442  if (mIsMagneticAdimension) mMagneticExcitationAdimensionizedParameter=Le/(EMM_Object::Mu0*Ms*Ms);
443  else mMagneticExcitationAdimensionizedParameter=1.;
444 
445  mDisplacementOperator->adimensionize(Le,Ms,T,L);
446  }
447 
456  virtual tBoolean discretize(const EMM_LandauLifschitzSystem& system);
457 
467 
468 
469  //MAGNETIC Excitation field methods
470  //==================================
471 
472 protected:
473 
522  virtual void computeMagneticExcitationField(const tUIndex& nCells,
523  const tDimension& dim,
524  const EMM_RealArray& sigma,
525  const tReal* M,
526  tReal *H) const;
527 
528 
529 public:
540  const tDimension& dim,
541  const EMM_RealArray& sigma,
542  const tReal *M,
543  const tReal *D,
544  tReal *gradH)const {
545  throw EMM_Exception("emicrom/operators/magnetostriction",
546  "EMM_MagnetostrictionOperator::computeMagneticExcitationFieldGradient()",
547  "gradient of operator is not computationable");
548  return true;
549  }
550 
551  //ENERGY Methods
552  //===============
553 
554 protected:
555 
569  tReal computeEnergy(const tReal& t,
570  const tUIndex& nCells,const tDimension& dim,
571  const EMM_RealArray& sigma,
572  const tReal* M) const;
573 
574 
575 
576 
577 
578 
581  virtual tString toString() const;
582 
583 
584 };
585 
586 #endif
587 
void setDisplacementMethod(const tString &m)
set the displacement method "FEM" or "FVM" ("FDM" deprecated)
Definition: EMM_MagnetostrictionOperator.cpp:25
DEFINE_SPTR(EMM_MagnetostrictionOperator)
static const tReal Mu0
Definition: EMM_Object.h:28
void setDisplacementOperator(SP::EMM_DisplacementOperator op)
set the reverse relation Displacement operator
Definition: EMM_MagnetostrictionOperator.cpp:47
virtual void adimensionize(const tReal &Le, const tReal &Ms, const tReal &T, const tReal &L)
adimensionize the operator
Definition: EMM_MagnetostrictionOperator.h:440
SP_OBJECT(EMM_MagnetostrictionOperator)
virtual tBoolean restore(const EMM_LandauLifschitzSystem &system, const tString &prefix, const tString &suffix, const tString &ext)
restore the operator data from file(s)
Definition: EMM_MagnetostrictionOperator.cpp:271
virtual tBoolean isAffine() const
return true if the operator is either constant or linear
Definition: EMM_MagnetostrictionOperator.h:259
#define tUSInt
Definition: types.h:28
void setIsMagneticAdimension(const tBoolean &v)
set if the adimensionment of the equation is magnetic
Definition: EMM_MagnetostrictionOperator.h:288
#define tBoolean
Definition: types.h:139
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: EMM_MagnetostrictionOperator.h:277
#define tDimension
Definition: EMM_Types.h:10
virtual tString toString() const
turn the operator into string
Definition: EMM_MagnetostrictionOperator.cpp:280
virtual tBoolean updateAtNextTimeStep(const tReal &dt, const EMM_RealArray &sigma, const EMM_RealField &Mt)
update the data of operator at next time step
Definition: EMM_MagnetostrictionOperator.cpp:256
virtual tBoolean computeFieldsAtTime(const tReal &t, const tFlag &order, const EMM_RealArray &sigma, const EMM_RealField &dM_dt0, const EMM_RealField &M0)
compute the fields of operator at time
Definition: EMM_MagnetostrictionOperator.cpp:245
This class describes the displacement operator defined on the data of the mesh.
Definition: EMM_DisplacementOperator.h:193
virtual ~EMM_MagnetostrictionOperator(void)
destroy
Definition: EMM_MagnetostrictionOperator.cpp:18
This class describes a resolution of landau-lifschitz system of the Core Package for E-MicroM...
Definition: EMM_LandauLifschitzSystem.h:88
virtual void computeMagneticExcitationField(const tUIndex &nCells, const tDimension &dim, const EMM_RealArray &sigma, const tReal *M, tReal *H) const
compute the normalized excitation magnetic field at M
Definition: EMM_MagnetostrictionOperator.cpp:124
tReal computeEnergy(const tReal &t, const tUIndex &nCells, const tDimension &dim, const EMM_RealArray &sigma, const tReal *M) const
compute the energy of the magnetostriction operator at current displacement and velocity ...
Definition: EMM_MagnetostrictionOperator.cpp:203
EMM_DisplacementOperator & getDisplacementOperator()
get the displacement operator
Definition: EMM_MagnetostrictionOperator.h:317
virtual tBoolean getDataField(const tUSInt &index, tString &dataName, tUIndex &n, tDimension &dim, const double *&values) const
get the data field at index for saving data in vtk,txt,... files.
Definition: EMM_MagnetostrictionOperator.h:365
#define tUIndex
Definition: types.h:126
This class describes a real array.
Definition: EMM_RealArray.h:16
virtual tBoolean backup(const tString &prefix, const tString &suffix, const tString &ext) const
backup of the operator data into file(s) used for restoring
Definition: EMM_MagnetostrictionOperator.cpp:265
virtual tUSInt getDataFieldsNumber() const
get the number of field used in the operator
Definition: EMM_MagnetostrictionOperator.h:326
#define tString
Definition: types.h:135
virtual tBoolean getDataFieldSpace(const tUSInt &index, tString &dataName, tFlag &supportType, tString &dFieldType, tUIndex &n, tDimension &dim) const
get the data field at index for saving data in vtk,txt,... files.
Definition: EMM_MagnetostrictionOperator.h:339
virtual tBoolean getDataField(const tUSInt &index, tString &dataName, tUIndex &n, tDimension &dim, const float *&values) const
get the data field at index for saving data in vtk,txt,... files.
Definition: EMM_MagnetostrictionOperator.h:352
virtual tBoolean isGradientComputationable() const
return true if the gradient of the magnetic excitation is computationable
Definition: EMM_MagnetostrictionOperator.h:265
tReal mMagneticExcitationAdimensionizedParameter
Definition: EMM_MagnetostrictionOperator.h:215
this class describes the exceptions raised for E-MicromM package
Definition: EMM_Exception.h:14
virtual tBoolean getDataField(const tUSInt &index, tString &dataName, tUIndex &n, tDimension &dim, const long double *&values) const
get the data field at index for saving data in vtk,txt,... files.
Definition: EMM_MagnetostrictionOperator.h:378
const EMM_DisplacementOperator & getDisplacementOperator() const
get the displacement operator
Definition: EMM_MagnetostrictionOperator.h:311
#define tULLInt
Definition: types.h:45
virtual tBoolean resetToInitialState(const EMM_LandauLifschitzSystem &system)
reset the operator at initial state t=0
Definition: EMM_MagnetostrictionOperator.cpp:113
void resetDisplacementOperator()
reset the reverse relation Displacement operator
Definition: EMM_MagnetostrictionOperator.cpp:67
tBoolean mIsMagneticAdimension
Definition: EMM_MagnetostrictionOperator.h:216
This class is an operator of a E-MicromM package wich compute a magnetic excitation operator...
Definition: EMM_MagneticExcitationOperator.h:15
This class describes a real field.
Definition: EMM_RealField.h:21
#define tReal
Definition: types.h:118
virtual tBoolean discretize(const EMM_LandauLifschitzSystem &system)
discretize and initialize the operator depending on method
Definition: EMM_MagnetostrictionOperator.cpp:81
SP::EMM_DisplacementOperator mDisplacementOperator
Definition: EMM_MagnetostrictionOperator.h:228
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: EMM_Operator.h:71
EMM_MagnetostrictionOperator(void)
create
Definition: EMM_MagnetostrictionOperator.cpp:10
This class describes the magnetostriction operator of the landau lifshcitz system EMM_LandauLifschitz...
Definition: EMM_MagnetostrictionOperator.h:207
virtual tBoolean computeMagneticExcitationFieldGradient(const tUIndex &nCells, const tDimension &dim, const EMM_RealArray &sigma, const tReal *M, const tReal *D, tReal *gradH) const
compute the gradient of the magnetic excitation field at M in the direction D
Definition: EMM_MagnetostrictionOperator.h:539
#define tFlag
Definition: types.h:74