C++ main module for emicrom Package  1.0
EMM_Output.h
Go to the documentation of this file.
1 #ifndef EMM_Output_H
2 #define EMM_Output_H
3 
4 #include "EMM_IO.h"
5 #include "EMM_RealArray.h"
6 #include "EMM_VTK.h"
8 
17 class EMM_Output : public EMM_IO {
18 
20  // ATTRIBUTES
21 
22 public:
23 
24 
25 
26 private:
27  //vtk readerd
28  SP::EMM_VTK mVTK;
29  //mModule: work array only used to save in AIM file.
30  //is mutable because this modification has no incidence on class state
32 
33 protected:
34  // METHODS
35 
36  // CONSTRUCTORS
37 
40  EMM_Output(void);
41 
42 
43 
44  // DESTRUCTORS
45 
46 
49  virtual ~EMM_Output(void);
50 
51 
52 public:
53 
57  inline static SP::EMM_Output New() {
58  SP::EMM_Output p(new EMM_Output(),EMM_Output::Delete());
59  p->setThis(p);
60  return p;
61  };
62 
63 private:
64  // SET methods
65 public:
66 
67 
68 
69  // GET methods
70 
71 public:
72  // OTHERS methods
73 
84  virtual tBoolean save(const EMM_LandauLifschitzSystem& system) {
85  return save(system,"");
86  }
98  tBoolean save(const EMM_LandauLifschitzSystem& system,const tString& suffix);
99 
112  const tInteger& backupIndex) {
113  tString strIndex="";
114  strIndex="_back"+CORE_Integer::toString(backupIndex,getFileDigitsNumber());
115  return save(system,strIndex);
116  }
129  static tBoolean saveVTI(const tUInteger& Nx,const tUInteger& Ny,const tUInteger& Nz,
130  const tReal& Hx,const tReal& Hy,const tReal& Hz,
131  const tString& Fname, const EMM_RealField& F,const tString& fileName) {
132  tUIndex nValues;
133  const tReal *Fvalues;
134  F.getValues(nValues,Fvalues);
135  return saveVTI(Nx,Ny,Nz,Hx,Hy,Hz,
136  Fname,F.getSize(),F.getDimension(),Fvalues,fileName);
137  }
155  inline static tBoolean saveVTI(const tUInteger& Nx,const tUInteger& Ny,const tUInteger& Nz,
156  const tReal& Hx,const tReal& Hy,const tReal& Hz,
157  const tString& Fname, const tUIndex& n, const tDimension& dim,const tReal* Fvalues,const tString& fileName) {
158  //center the geometry
159  tReal Ox=(Nx*(1-Hx))/2;
160  tReal Oy=(Ny*(1-Hy))/2;
161  tReal Oz=(Nz*(1-Hz))/2;
162 
163  return saveVTI(Ox,Oy,Oz,Nx,Ny,Nz,Hx,Hy,Hz,
164  Fname,n,dim,Fvalues,fileName);
165 
166  }
167 
185  static tBoolean saveVTI(const tReal& Ox,const tReal& Oy,const tReal& Oz,
186  const tUInteger& Nx,const tUInteger& Ny,const tUInteger& Nz,
187  const tReal& Hx,const tReal& Hy,const tReal& Hz,
188  const tString& Fname, const tUIndex& n, const tDimension& dim,const tReal* Fvalues,const tString& fileName);
189 
190 
197  const tString& fileName);
198 
204  return saveVTI(system,getPath()+getPrefix()+".vti");
205  }
206 
207 
220  const tString& fileName);
221 
227  tBoolean saveFieldToTXTFile(const EMM_RealField& M,const tString& fileName) const;
228 
229 private:
235  tBoolean saveFieldToAIMFile(const EMM_RealField& M,const EMM_RealField& H) const;
236 
237 
238 
239 };
240 
241 #endif
virtual tUIndex getSize() const =0
return the size of the field
This class is a I/O class for E-MicroM core package.
Definition: EMM_IO.h:16
#define tUInteger
Definition: types.h:91
DEFINE_SPTR(EMM_Output)
tBoolean saveBackup(const EMM_LandauLifschitzSystem &system, const tInteger &backupIndex)
save the backup of the system in vti,txt files (M, data of each operator)
Definition: EMM_Output.h:111
SP_OBJECT(EMM_Output)
#define tBoolean
Definition: types.h:139
static SP::EMM_Output New()
create an output class
Definition: EMM_Output.h:57
This class is a Output class for E-MicroM core package.
Definition: EMM_Output.h:17
EMM_RealArray mModule
Definition: EMM_Output.h:31
tString toString() const
return the string associated to the integer
Definition: CORE_Integer.h:106
#define tDimension
Definition: EMM_Types.h:10
virtual tBoolean save(const EMM_LandauLifschitzSystem &system)
save the system data in vti and txt files (M, data of each operator)
Definition: EMM_Output.h:84
tBoolean saveFieldToAIMFile(const EMM_RealField &M, const EMM_RealField &H) const
save the field M and the module of the field H in aim file
Definition: EMM_Output.cpp:440
tBoolean saveVTI(const EMM_LandauLifschitzSystem &system)
save the system in vti for viewing
Definition: EMM_Output.h:203
virtual ~EMM_Output(void)
destroy
Definition: EMM_Output.cpp:17
const tUSInt & getFileDigitsNumber() const
get the file digits number
Definition: EMM_IO.h:102
tBoolean saveFieldToTXTFile(const EMM_RealField &M, const tString &fileName) const
save the field in txt file with suffix in txt file
Definition: EMM_Output.cpp:431
This class describes a resolution of landau-lifschitz system of the Core Package for E-MicroM...
Definition: EMM_LandauLifschitzSystem.h:88
SP::EMM_VTK mVTK
Definition: EMM_Output.h:28
virtual tBoolean getValues(tUIndex &size, const float *&values) const
get the values
Definition: EMM_RealField.h:585
const tString & getPath() const
get the path
Definition: EMM_IO.h:88
#define tUIndex
Definition: types.h:126
This class describes a real array.
Definition: EMM_RealArray.h:16
const tDimension & getDimension() const
get the dimension
Definition: EMM_RealField.h:553
#define tString
Definition: types.h:135
const tString & getPrefix() const
get the prefix
Definition: EMM_IO.h:95
static tBoolean saveVTI(const tUInteger &Nx, const tUInteger &Ny, const tUInteger &Nz, const tReal &Hx, const tReal &Hy, const tReal &Hz, const tString &Fname, const tUIndex &n, const tDimension &dim, const tReal *Fvalues, const tString &fileName)
save the field in VTI file
Definition: EMM_Output.h:155
EMM_Output(void)
create
Definition: EMM_Output.cpp:7
This class describes a real field.
Definition: EMM_RealField.h:21
tBoolean saveRelaxation(const EMM_LandauLifschitzSystem &system, const tString &fileName)
save the relaxation
Definition: EMM_Output.cpp:66
static tBoolean saveVTI(const tUInteger &Nx, const tUInteger &Ny, const tUInteger &Nz, const tReal &Hx, const tReal &Hy, const tReal &Hz, const tString &Fname, const EMM_RealField &F, const tString &fileName)
save the field in VTI file
Definition: EMM_Output.h:129
#define tReal
Definition: types.h:118
#define tInteger
Definition: types.h:90
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141