C++ mpi module for stochmagnet_main Package
SM_SliceOperator.h
1 #ifndef SM_SliceOperator_H
2 #define SM_SliceOperator_H
3 
4 #include "SM_Object.h"
5 
6 
7 //system class
8 class SM_System;
9 
10 //network class
11 #include "SM_Network.h"
12 
13 //material class
14 #include "SM_Material.h"
15 
32 class SM_SliceOperator : public virtual SM_Object {
33 
34  //attributes
35 private :
36 
37 
38  //name of the operator
39  tString mName;
40 
41 
42 
43  //association
44 
45 
46 
47 protected:
48  // CONSTRUCTORS
52  mName="";
53  }
54 
55  // DESTRUCTORS
58  virtual ~SM_SliceOperator(void) {
59  }
60 
61 public :
62 
63  //Instance building
64  //=================
65 
69  virtual CORE_UniquePointer<SM_SliceOperator> NewInstance() const=0;
70 
71  //MEMORY
72 
86  virtual tMemSize getMemorySize() const {
87  return sizeof(*this)+getContentsMemorySize();
88  }
97  virtual tMemSize getContentsMemorySize() const {
98  tMemSize mem=SM_Object::getContentsMemorySize();
99  mem+=mName.size();
100  return mem;
101  }
102 
103 
104 
105  //SET & GET
106  //=========
107 protected:
108 
112  inline void setName(const tString& name) {
113  mName=name;
114  }
115 public:
119  inline const tString& getName() const {
120  return mName;
121  }
122 
123 
124 public:
125 
129  virtual void copy(const SM_SliceOperator& op) {
130  mName=op.getName();
131  }
135  virtual void adimensionize(const tReal& cH) {
136  }
137 
142  virtual void discretize(const SM_Network& network, const SM_Material& material) {
143  }
144 
145  //Fields computation
146  //==================
147 
154  virtual void updateState(const tIndex& timeIndex,
155  const SM_Network& network,
156  const SM_Material& material,
157  const SM_RealField& S) {
158  }
159 
173  virtual void computeMagneticFieldSlice(const tIndex& timeIndex,
174  const SM_Network& network,
175  const SM_Material& material,
176  const tIndex& startIndex,
177  const tIndex& endIndex,
178  const tReal *S,
179  const tBoolean& alpha,
180  const tIndex& nH,
181  tReal *H) const=0;
182 
183  //Spin energy computation
184  //=======================
185 
186 
187 
196  virtual tReal computeSpinEnergy(const tIndex& i,
197  const tIndex& timeIndex,
198  const SM_Network& network,
199  const SM_Material& material,
200  const SM_RealField& S) const=0;
201 
202  //Total energy computation
203  //========================
204 
205 
215  virtual tReal computeEnergySlice(const tIndex& timeIndex,
216  const SM_Network& network,
217  const SM_Material& material,
218  const tIndex& startIndex,
219  const tIndex& endIndex,
220  const tReal *S) const=0;
221 
222 
223 
224 
227  virtual tString toString() const override {
228  return mName+":"+getIdentityString();
229  }
230 };
231 
232 
233 #endif
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:278
tString getIdentityString() const
retrun the string identification of the class
Definition: CORE_Object.h:321
This class describes a materials defined by state attributes:
Definition: SM_Material.h:61
This class is describes a network composed by.
Definition: SM_Network.h:66
This class is a base class for Stoch Microm package.
Definition: SM_Object.h:36
This class is describes an operator operating on slice of particles of a network SM_Network.
Definition: SM_SliceOperator.h:32
virtual tString toString() const override
return string representaton of the operator
Definition: SM_SliceOperator.h:227
SM_SliceOperator(void)
create a network class
Definition: SM_SliceOperator.h:51
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_SliceOperator.h:86
virtual void updateState(const tIndex &timeIndex, const SM_Network &network, const SM_Material &material, const SM_RealField &S)
update the stae of the operator at time index
Definition: SM_SliceOperator.h:154
virtual tReal computeSpinEnergy(const tIndex &i, const tIndex &timeIndex, const SM_Network &network, const SM_Material &material, const SM_RealField &S) const =0
compute the spin energy by virtual method
virtual ~SM_SliceOperator(void)
destroy
Definition: SM_SliceOperator.h:58
virtual void computeMagneticFieldSlice(const tIndex &timeIndex, const SM_Network &network, const SM_Material &material, const tIndex &startIndex, const tIndex &endIndex, const tReal *S, const tBoolean &alpha, const tIndex &nH, tReal *H) const =0
compute the magnetic field slice by virtual method for particles in indices [startIndex,...
const tString & getName() const
return the operator name
Definition: SM_SliceOperator.h:119
virtual void copy(const SM_SliceOperator &op)
copy
Definition: SM_SliceOperator.h:129
virtual void adimensionize(const tReal &cH)
adimensionize operator with characteric field value in J
Definition: SM_SliceOperator.h:135
void setName(const tString &name)
set the name
Definition: SM_SliceOperator.h:112
virtual void discretize(const SM_Network &network, const SM_Material &material)
discretize the operator on the network
Definition: SM_SliceOperator.h:142
virtual tReal computeEnergySlice(const tIndex &timeIndex, const SM_Network &network, const SM_Material &material, const tIndex &startIndex, const tIndex &endIndex, const tReal *S) const =0
compute the energy by virtual method
virtual CORE_UniquePointer< SM_SliceOperator > NewInstance() const =0
create a New instance of this
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: SM_SliceOperator.h:97
This class is a one simulation of a beam for Stoch Magnet package.
Definition: SM_System.h:53