1 #ifndef SM_ZeemanOperator_H
2 #define SM_ZeemanOperator_H
4 #include "SM_Operator.h"
41 tIndex mTimeStepsNumber;
42 tIndex mParticlesNumber;
45 std::valarray<tReal> mHext;
95 mem+=mHext.size()*
sizeof(tReal);
105 inline static CORE_UniquePointer<SM_ZeemanOperator>
New() {
114 virtual CORE_UniquePointer<SM_SliceOperator>
NewInstance()
const override {
187 inline const std::valarray<tReal>&
getHext()
const {
200 inline void setHext(std::initializer_list<tReal>&& values) {
207 inline void setHext(
const std::vector<tReal>& values) {
208 mHext.resize(values.size());
210 for_each(values.begin(),values.end(),
220 inline void setHext(
const std::array<tReal,SM_Constants::DIM>& values) {
222 std::valarray<tReal>& Hext=
getHext();
232 tReal *iHext=&mHext[0];
235 const tReal *eHext=iHext;
243 while (iHext!=eHext) {
282 const tIndex& startIndex,
283 const tIndex& endIndex,
285 const tBoolean& alpha,
300 const tIndex& timeIndex,
327 const tReal *iS,
const tReal *eSi,
342 const tReal *iS,
const tReal *eS,
375 const tIndex& startIndex,
376 const tIndex& endIndex,
377 const tReal *S)
const;
389 ret+=
" Hext:"+functions_array::toString(
getHext())+
"\n";
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
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
const tReal & getAtomicSpinMoment() const
get the atomic spin moment in unit of Bohr magneton
Definition: SM_Material.h:242
const tReal & getAdimensionizedDerivativeEnergyFactor() const
get the characteristic dipolar energy factor
Definition: SM_Material.h:401
This class is describes a network composed by.
Definition: SM_Network.h:66
const tInteger & getParticlesNumber() const
return the particles number
Definition: SM_Network.h:349
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
virtual void copy(const SM_SliceOperator &op)
copy
Definition: SM_SliceOperator.h:129
void setName(const tString &name)
set the name
Definition: SM_SliceOperator.h:112
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: SM_SliceOperator.h:97
This class is describes a Zeeman operator interface.
Definition: SM_ZeemanOperator.h:26
static void ComputeUnscaledSpinEnergy(const tReal *Hext, const tReal *iS, const tReal *eS, tReal &E)
compute the unscaled spin energy
Definition: SM_ZeemanOperator.h:341
const std::valarray< tReal > & getHext() const
return Hext as an array
Definition: SM_ZeemanOperator.h:187
tReal * getHexValues()
return Hext
Definition: SM_ZeemanOperator.h:180
static CORE_UniquePointer< SM_ZeemanOperator > New()
build a new instance of the operator
Definition: SM_ZeemanOperator.h:105
virtual void discretize(const SM_Network &network, const SM_Material &material) override
discretize the operator on the network
Definition: SM_ZeemanOperator.h:252
const tIndex & getTimeStepsNumber() const
return the number of time steps for the zeeman operatpr
Definition: SM_ZeemanOperator.h:154
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_ZeemanOperator.h:82
SM_ZeemanOperator(void)
create a zeeman operator interface
Definition: SM_ZeemanOperator.h:52
virtual void adimensionize(const tReal &cH) override
adimensionize the operator
Definition: SM_ZeemanOperator.h:230
const tReal * getHextAtTimeIndex(const tIndex &timeIndex) const
return Hext at time step index t
Definition: SM_ZeemanOperator.h:161
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_ZeemanOperator.cpp:5
void setHext(const std::array< tReal, SM_Constants::DIM > &values)
set the Hext value
Definition: SM_ZeemanOperator.h:220
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 CORE_UniquePointer< SM_SliceOperator > NewInstance() const override
create a New instance of this
Definition: SM_ZeemanOperator.h:114
virtual tString toString() const override
return the string representation of the class
Definition: SM_ZeemanOperator.h:387
std::valarray< tReal > & getHext()
return Hext as an array
Definition: SM_ZeemanOperator.h:193
const tIndex & getParticlesNumber() const
return the number of particles for the zeeman operatpr
Definition: SM_ZeemanOperator.h:149
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: SM_ZeemanOperator.h:93
virtual ~SM_ZeemanOperator(void)
destroy
Definition: SM_ZeemanOperator.h:61
void setHext(std::initializer_list< tReal > &&values)
set the Hext value
Definition: SM_ZeemanOperator.h:200
virtual tReal computeEnergySlice(const tIndex &timeIndex, const SM_Network &network, const SM_Material &material, const tIndex &startIndex, const tIndex &endIndex, const tReal *S) const
compute the energy at time t by virtual method for all particles in [startIndex,endIndex[
Definition: SM_ZeemanOperator.cpp:56
virtual void copy(const SM_SliceOperator &op)
copy
Definition: SM_ZeemanOperator.h:136
void setHext(const std::vector< tReal > &values)
set the Hext value
Definition: SM_ZeemanOperator.h:207
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
virtual tReal computeSpinEnergy(const tIndex &i, const tIndex &timeIndex, const SM_Network &network, const SM_Material &material, const SM_RealField &S) const override
compute the spin energy by virtual method
Definition: SM_ZeemanOperator.h:299
tReal * getHextAtTimeIndex(const tIndex &timeIndex)
return Hext at time step index t
Definition: SM_ZeemanOperator.h:168
void setTimeStepsNumber(const tIndex &n)
set zeeman time steps
Definition: SM_ZeemanOperator.h:128