C++ mpi module for stochmagnet_main Package
SM_ConstantZeemanOperator.h
1 #ifndef SM_ConstantZeemanOperator_H
2 #define SM_ConstantZeemanOperator_H
3 
4 //base classes
5 #include "SM_ZeemanOperator.h"
6 
15 
16  //attributes
17 private :
18 
19 
20  //association
21 
22  //super class type
24 
25 
26 protected:
27  // CONSTRUCTORS
33 
34  }
35 
36  // DESTRUCTORS
40  }
41 
42 public :
43 
44  //Instance building
45  //=================
46 
47 
51  inline static CORE_UniquePointer<SM_ConstantZeemanOperator> New() {
52  return CORE_UniquePointer<SM_ConstantZeemanOperator>(new SM_ConstantZeemanOperator(),
54  }
55 
59  virtual CORE_UniquePointer<SM_SliceOperator> NewInstance() const override {
60  return New();
61  }
62 
63 
77  virtual tMemSize getMemorySize() const {
78  return sizeof(*this)+this->getContentsMemorySize();
79  }
80 
81 
82 public:
83 
88  virtual void discretize(const SM_Network& network, const SM_Material& material) override {
91  }
92 
93 
94 
95 
111  virtual void computeMagneticFieldSlice(const tIndex& timeIndex,
112  const SM_Network& network,
113  const SM_Material& material,
114  const tIndex& startIndex,
115  const tIndex& endIndex,
116  const tReal *S,
117  const tBoolean& alpha,
118  const tIndex& nH,
119  tReal *H) const;
120 
121  //spin energy
122  //===========
123 
132  virtual tReal computeSpinEnergy(const tIndex& i,
133  const tIndex& timeIndex,
134  const SM_Network& network,
135  const SM_Material& material,
136  const SM_RealField& S) const final {
137  //begin iterator on direction of magnetic moment of spin i
138  const tReal *Si=&S[0];Si+=i*SM_Constants::DIM;
139  //end iterator on direction of magnetic moment of spin i
140  const tReal *eSi=Si;eSi+=SM_Constants::DIM;
141  //energy of the spin i
142  tReal Ei;
143  ComputeSpinEnergy(material.getAtomicSpinMoment()/material.getAdimensionizedDerivativeEnergyFactor(),//Mu_s
144  getHextValues(),//Hext
145  Si,eSi,Ei);
146  return Ei;
147  }
148 
149  //total energy
150  //============
151 
161  virtual tReal computeEnergySlice(const tIndex& stepIndex,
162  const SM_Network& network,
163  const SM_Material& material,
164  const tIndex& startIndex,
165  const tIndex& endIndex,
166  const tReal *S) const final;
167 
168 
169 
170 
171 };
172 
173 
174 #endif
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
This class is describes a Zeman operator with const external applied field by time and particles.
Definition: SM_ConstantZeemanOperator.h:14
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
compute the anisotropy magnetic field by virtual method
Definition: SM_ConstantZeemanOperator.cpp:4
virtual ~SM_ConstantZeemanOperator(void)
destroy
Definition: SM_ConstantZeemanOperator.h:39
virtual CORE_UniquePointer< SM_SliceOperator > NewInstance() const override
create a New instance of this
Definition: SM_ConstantZeemanOperator.h:59
virtual tReal computeSpinEnergy(const tIndex &i, const tIndex &timeIndex, const SM_Network &network, const SM_Material &material, const SM_RealField &S) const final
compute the spin energy by virtual method
Definition: SM_ConstantZeemanOperator.h:132
virtual tReal computeEnergySlice(const tIndex &stepIndex, const SM_Network &network, const SM_Material &material, const tIndex &startIndex, const tIndex &endIndex, const tReal *S) const final
compute the energy by virtual method
Definition: SM_ConstantZeemanOperator.cpp:65
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_ConstantZeemanOperator.h:77
virtual void discretize(const SM_Network &network, const SM_Material &material) override
discretize the operator on the network
Definition: SM_ConstantZeemanOperator.h:88
SM_ConstantZeemanOperator(void)
create a network class
Definition: SM_ConstantZeemanOperator.h:30
static CORE_UniquePointer< SM_ConstantZeemanOperator > New()
build a new instance of the operator
Definition: SM_ConstantZeemanOperator.h:51
static constexpr tDimension DIM
space dimension
Definition: SM_Constants.h:80
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 describes a Zeeman operator interface.
Definition: SM_ZeemanOperator.h:26
const tReal * getHextValues() const
return Hext at time 0
Definition: SM_ZeemanOperator.h:174
void setParticlesNumber(const tIndex &p)
set zeeman particlules number
Definition: SM_ZeemanOperator.h:122
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: SM_ZeemanOperator.h:93
static void ComputeSpinEnergy(const tReal &mu_s, const tReal *Hext, const tReal *iS, const tReal *eSi, tReal &E)
compute spin energy
Definition: SM_ZeemanOperator.h:325
void setTimeStepsNumber(const tIndex &n)
set zeeman time steps
Definition: SM_ZeemanOperator.h:128