C++ main module for stochmagnet Package  1.0
SM_ConstantZeemanOperator.h
Go to the documentation of this file.
1 #ifndef SM_ConstantZeemanOperator_H
2 #define SM_ConstantZeemanOperator_H
3 
4 //base classes
5 #include "SM_TemplatedOperator.h"
6 #include "SM_ZeemanOperator.h"
7 
16 
17  //attributes
18 private :
19 
20 
21  //association
22 
23 
24 
25 protected:
26  // CONSTRUCTORS
32 
33  }
34 
35  // DESTRUCTORS
39  }
40 
41 public :
42 
43  //Instance building
44  //=================
45 
46 
53  }
54 
58  virtual CORE_UniquePointer<SM_Operator> NewInstance() const override {
59  return New();
60  }
61 
62 
76  virtual tMemSize getMemorySize() const {
77  return sizeof(*this)+getContentsMemorySize();
78  }
79 
80 
81 public:
82 
86  virtual void discretize(const SM_System& system) override {
89  }
90 
91 
92 
96  inline void setBext(const std::array<tReal,3>& values) {
99  std::valarray<tReal>& Bext=getBextAsArray();
100  Bext.resize(3);
101  tReal *Bi=&Bext[0];
102  std::for_each(values.begin(),values.end(),[&](const auto& v){(*Bi)=v;Bi++;});
103  }
104 
105 
106 
107 
108 };
109 
110 
111 #endif
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:94
This class is describes a Zeman operator with const external magnetism by time and particles.
Definition: SM_ConstantZeemanOperator.h:15
void setBext(const std::array< tReal, 3 > &values)
set the Bext value
Definition: SM_ConstantZeemanOperator.h:96
virtual ~SM_ConstantZeemanOperator(void)
destroy
Definition: SM_ConstantZeemanOperator.h:38
virtual void discretize(const SM_System &system) override
discretize the operator : do nothing by default
Definition: SM_ConstantZeemanOperator.h:86
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_ConstantZeemanOperator.h:76
SM_ConstantZeemanOperator(void)
create a network class
Definition: SM_ConstantZeemanOperator.h:29
virtual CORE_UniquePointer< SM_Operator > NewInstance() const override
create a New instance of this @retrun an unique pointer to the instance
Definition: SM_ConstantZeemanOperator.h:58
static CORE_UniquePointer< SM_ConstantZeemanOperator > New()
build a new instance of the operator
Definition: SM_ConstantZeemanOperator.h:50
This class is a simulation of one trajectory class for Stoch Microm package.
Definition: SM_System.h:51
This class is describes a Zeeman operator interface.
Definition: SM_ZeemanOperator.h:27
void setZeemanParticlesNumber(const tIndex &p)
set zeeman particlules number
Definition: SM_ZeemanOperator.h:119
const std::valarray< tReal > & getBextAsArray() const
return Bext as an array
Definition: SM_ZeemanOperator.h:193
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: SM_ZeemanOperator.h:109
void setZeemanTimeStepsNumber(const tIndex &n)
set zeeman time steps
Definition: SM_ZeemanOperator.h:125
typename std::unique_ptr< T, CORE_Object::Delete > CORE_UniquePointer
Definition: sp.h:8
#define tMemSize
Definition: types.h:166
#define tReal
Definition: types.h:137