C++ main module for stochmagnet Package  1.0
SM_Output.h
Go to the documentation of this file.
1 #ifndef SM_Output_H
2 #define SM_Output_H
3 
4 //inherits header
5 #include "SM_Object.h"
6 
7 class SM_Beam;
8 class SM_Network;
9 class SM_System;
10 
11 //field header
12 #include "SM_Field.h"
13 
21 class SM_Output : public SM_Object {
22 
23  //attributes
24 private :
25 
26  std::vector<tIndex> mSimulations;
29 
30 public:
31  // CONSTRUCTORS
34  SM_Output(void);
35 
36  // DESTRUCTORS
39  virtual ~SM_Output(void);
40 
41 
42 
43 public :
44  // CREATE class
45 
46 
52  }
53 
54 
55  //MEMORY
56 
70  virtual tMemSize getMemorySize() const {
71  return sizeof(*this)+getContentsMemorySize();
72  }
73 
82  virtual tMemSize getContentsMemorySize() const {
84  mem+=mOutputPath.size();
85  mem+=mPrefix.size();
86  mem+=mSimulations.size()*sizeof(tIndex);
87  return mem;
88  }
89 
90 public:
91  //SET & GET methods
92 
96  inline void setSimulations(std::initializer_list<tIndex>&& simulationIndices) {
97  mSimulations=simulationIndices;
98  }
102  inline void setSimulations(const std::vector<tIndex>& simulationIndices) {
103  mSimulations=simulationIndices;
104  }
105 
109  inline void setOutputPath(const tString& path) {
110  mOutputPath=path;
111  }
115  inline void setPrefix(const tString& prefix) {
116  mPrefix=prefix;
117  }
118 public:
119 
120  // MAIN Method
121  //output generator
126  tBoolean generateOutput(SM_Beam& beam) const;
127 
132  tBoolean saveStochasticIndicators(const SM_Beam& beam) const;
151  static tBoolean SaveMagneticMomentField(const tString& fileName,
152  const tReal& dt,const tInteger& nTimeSteps,
153  const tIndex& nParticles,const tDimension& dim,const tReal* mu_s);
154 
171  static tBoolean LoadMagneticMomentField(const tString& fileName,
172  tReal& dt,tInteger& nTimeSteps,
173  SM_RealField& mu_s);
174 };
175 
176 
177 #endif
tUCInt tDimension
Definition: CORE_StdPtrField.h:567
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:94
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:259
This class is a simulation of a beam of trajectories class for Stoch Microm package.
Definition: SM_Beam.h:46
This class is describes a a network.
Definition: SM_Network.h:18
This class is a base class for Stoch Microm package.
Definition: SM_Object.h:19
Definition: SM_Output.h:21
std::vector< tIndex > mSimulations
Definition: SM_Output.h:26
void setOutputPath(const tString &path)
set the output path
Definition: SM_Output.h:109
tBoolean saveStochasticIndicators(const SM_Beam &beam) const
save the stochastic output from beam
Definition: SM_Output.cpp:126
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_Output.h:82
static CORE_UniquePointer< SM_Output > New()
build a new instance of the class
Definition: SM_Output.h:50
tBoolean generateOutput(SM_Beam &beam) const
save the file for animations
Definition: SM_Output.cpp:29
tString mOutputPath
Definition: SM_Output.h:27
void setPrefix(const tString &prefix)
set the prefix of generated files
Definition: SM_Output.h:115
static tBoolean LoadMagneticMomentField(const tString &fileName, tReal &dt, tInteger &nTimeSteps, SM_RealField &mu_s)
save the particles coordinate from field mu at simulation
Definition: SM_Output.cpp:224
void setSimulations(const std::vector< tIndex > &simulationIndices)
set the simulations index to save
Definition: SM_Output.h:102
tString mPrefix
Definition: SM_Output.h:28
static tBoolean SaveMagneticMomentField(const tString &fileName, const tReal &dt, const tInteger &nTimeSteps, const tIndex &nParticles, const tDimension &dim, const tReal *mu_s)
save the particles coordinate from field mu at simulation
Definition: SM_Output.cpp:193
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_Output.h:70
SM_Output(void)
create
Definition: SM_Output.cpp:18
virtual ~SM_Output(void)
destroy
Definition: SM_Output.cpp:24
void setSimulations(std::initializer_list< tIndex > &&simulationIndices)
set the simulations index to save
Definition: SM_Output.h:96
This class is a simulation of one trajectory class for Stoch Microm package.
Definition: SM_System.h:51
typename std::unique_ptr< T, CORE_Object::Delete > CORE_UniquePointer
Definition: sp.h:8
#define tIndex
Definition: types.h:157
#define tString
Definition: types.h:147
#define tMemSize
Definition: types.h:166
#define tInteger
Definition: types.h:114
#define tBoolean
Definition: types.h:151
#define tReal
Definition: types.h:137