C++ main module for emicrom Package  1.0
EMM_Operator.h
Go to the documentation of this file.
1 #ifndef EMM_Operator_H
2 #define EMM_Operator_H
3 
4 #include "EMM_Object.h"
5 
6 
7 #include "EMM_RealField.h"
8 #include "EMM_Grid3D.h"
9 
11 
24 class EMM_Operator : public EMM_Object {
25 
27  // ATTRIBUTES
28 
29 public:
30 
31 
32 private:
35 
36 protected:
37  // METHODS
38 
39  // CONSTRUCTORS
40 
43  EMM_Operator(void);
44 
45 
46 
47  // DESTRUCTORS
48 
49 
52  virtual ~EMM_Operator(void);
53 
54 
55  // SET methods
56 
57 protected:
58 
59 
60  // GET methods
61 
62 public:
71  virtual tULLInt getMemorySize() const {
72  return 0;
73  }
74 
75 
76 
80  virtual tString getName() const {
81  tString cn=getClassName();
82  //find the first '_' from first occurence of 'EMM'
83  tUIndex i0=cn.find("EMM");
84  i0=cn.find("_",i0);
85  //find the Operator name
86  tUIndex i1=cn.rfind("Operator");
87  //return the string betwen '_' & 'Operator'
88  return cn.substr(i0+1,i1-i0-1);
89  }
93  virtual tBoolean isAffine() const=0;
94 
98  virtual tBoolean isGradientComputationable() const=0;
99 
103  inline const tBoolean& isCubicVolume() const {
104  return mIsCubic;
105  }
106 
110  inline const tReal& getElementVolume() const {
111  return mElementVolume;
112  }
113 
114 
115 public:
116 
117  //DATA methods
118  //=============
127  virtual void adimensionize(const tReal& Le,const tReal& Ms,const tReal& T,const tReal& L) {
128  }
129 
134  virtual tBoolean discretize(const EMM_LandauLifschitzSystem& system);
135 
141  virtual tBoolean resetToInitialState(const EMM_LandauLifschitzSystem& system)=0;
142 
143 
144 
145  // FIELDS Methods
146  //================
147 
151  virtual tUSInt getDataFieldsNumber() const {
152  return 0;
153  }
154 
164  virtual tBoolean getDataFieldSpace(const tUSInt& index,tString& dataName,tFlag& supportType,tString& dFieldType,tUIndex& n,tDimension& dim) const {
165  dataName="";
166  supportType=EMM_Grid3D::ELEMENT;
167  n=0;
168  dim=1;
169  dFieldType="";
170  return false;
171  }
180  virtual tBoolean getDataField(const tUSInt& index,tString& dataName,tUIndex& n,tDimension& dim,const float *& values) const {
181  dataName="";
182  n=0;
183  dim=1;
184  return false;
185  }
194  virtual tBoolean getDataField(const tUSInt& index,tString& dataName,tUIndex& n,tDimension& dim,const double *& values) const {
195  dataName="";
196  n=0;
197  dim=1;
198  return false;
199  }
208  virtual tBoolean getDataField(const tUSInt& index,tString& dataName,tUIndex& n,tDimension& dim,const long double *& values) const {
209  dataName="";
210  n=0;
211  dim=1;
212  return false;
213  }
214 
215 
216 
217 
218 public:
219 
226  virtual tBoolean backup(const tString& prefix,const tString& suffix,const tString& ext) const {
227  return true;
228  }
237  const tString& prefix,const tString& suffix,const tString& ext) {
238  return true;
239  }
240 
249  virtual tBoolean computeFieldsAtTime(const tReal& t,
250  const tFlag& order,
251  const EMM_RealArray& sigma,
252  const EMM_RealField& dM_dt0,
253  const EMM_RealField& M0)=0;
254 
255 
262  virtual tBoolean updateAtNextTimeStep(const tReal& dt,
263  const EMM_RealArray& sigma,
264  const EMM_RealField& Mt)=0;
265 
266 
267 
268 };
269 
270 #endif
This class is a base class of E-MicromM core package.
Definition: EMM_Object.h:21
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_Operator.h:226
const tReal & getElementVolume() const
return the adimensionized volume of the element
Definition: EMM_Operator.h:110
DEFINE_SPTR(EMM_Operator)
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_Operator.h:236
DEFINE_SVPTR(EMM_Operator)
tBoolean mIsCubic
Definition: EMM_Operator.h:34
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_Operator.h:194
virtual tString getName() const
return an human reading name of the operator
Definition: EMM_Operator.h:80
virtual tBoolean isGradientComputationable() const =0
return true if the gradient of the magnetic excitation is computationable
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_Operator.h:164
#define tUSInt
Definition: types.h:28
virtual tUSInt getDataFieldsNumber() const
get the number of feild used in the operator
Definition: EMM_Operator.h:151
#define tBoolean
Definition: types.h:139
virtual tBoolean updateAtNextTimeStep(const tReal &dt, const EMM_RealArray &sigma, const EMM_RealField &Mt)=0
update the data of operator at next time step
tString getClassName() const
return the class name of the object
Definition: CORE_Object.cpp:70
static const tFlag ELEMENT
Definition: EMM_Grid3D.h:69
virtual tBoolean isAffine() const =0
return true if the operator is either constant or linear
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_Operator.h:180
#define tDimension
Definition: EMM_Types.h:10
const tBoolean & isCubicVolume() const
return the true if the element is cubic
Definition: EMM_Operator.h:103
virtual tBoolean resetToInitialState(const EMM_LandauLifschitzSystem &system)=0
reset the data of the operator to its initial step t=0
tReal mElementVolume
Definition: EMM_Operator.h:33
This class is an operator of a E-MicromM package which computes the field of the operator with respec...
Definition: EMM_Operator.h:24
This class describes a resolution of landau-lifschitz system of the Core Package for E-MicroM...
Definition: EMM_LandauLifschitzSystem.h:88
#define tUIndex
Definition: types.h:126
This class describes a real array.
Definition: EMM_RealArray.h:16
#define tString
Definition: types.h:135
virtual tBoolean computeFieldsAtTime(const tReal &t, const tFlag &order, const EMM_RealArray &sigma, const EMM_RealField &dM_dt0, const EMM_RealField &M0)=0
compute the fields of operator at time
EMM_Operator(void)
create
Definition: EMM_Operator.cpp:7
virtual ~EMM_Operator(void)
destroy
Definition: EMM_Operator.cpp:16
#define tULLInt
Definition: types.h:45
This class describes a real field.
Definition: EMM_RealField.h:21
virtual void adimensionize(const tReal &Le, const tReal &Ms, const tReal &T, const tReal &L)
adimensionize the operator
Definition: EMM_Operator.h:127
SP_OBJECT(EMM_Operator)
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_Operator.h:208
#define tReal
Definition: types.h:118
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: EMM_Operator.h:71
virtual tBoolean discretize(const EMM_LandauLifschitzSystem &system)
discretize and initialize the operator
Definition: EMM_Operator.cpp:19
#define tFlag
Definition: types.h:74