C++ mpi module for stochmagnet_main Package
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
SM_ZeemanOperator Class Reference

This class is describes a Zeeman operator interface. More...

#include <SM_ZeemanOperator.h>

Inheritance diagram for SM_ZeemanOperator:
Inheritance graph
[legend]
Collaboration diagram for SM_ZeemanOperator:
Collaboration graph
[legend]

Public Member Functions

virtual tMemSize getMemorySize () const
 return the memory size of the class and the memory size of all its attributes/associations More...
 
virtual tMemSize getContentsMemorySize () const
 return nthe memory size of the included associations More...
 
virtual CORE_UniquePointer< SM_SliceOperatorNewInstance () const override
 create a New instance of this More...
 
virtual void copy (const SM_SliceOperator &op)
 copy More...
 
const tIndex & getParticlesNumber () const
 return the number of particles for the zeeman operatpr More...
 
const tIndex & getTimeStepsNumber () const
 return the number of time steps for the zeeman operatpr More...
 
const tReal * getHextAtTimeIndex (const tIndex &timeIndex) const
 return Hext at time step index t More...
 
tReal * getHextAtTimeIndex (const tIndex &timeIndex)
 return Hext at time step index t More...
 
const tReal * getHextValues () const
 return Hext at time 0 More...
 
tReal * getHexValues ()
 return Hext More...
 
void setHext (std::initializer_list< tReal > &&values)
 set the Hext value More...
 
void setHext (const std::vector< tReal > &values)
 set the Hext value More...
 
void setHext (const std::array< tReal, SM_Constants::DIM > &values)
 set the Hext value More...
 
virtual void adimensionize (const tReal &cH) override
 adimensionize the operator More...
 
virtual void discretize (const SM_Network &network, const SM_Material &material) override
 discretize the operator on the network More...
 
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 More...
 
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 More...
 
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[ More...
 
virtual tString toString () const override
 return the string representation of the class
 
- Public Member Functions inherited from SM_SliceOperator
const tString & getName () const
 return the operator name More...
 
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 More...
 
- Public Member Functions inherited from SM_Object
 SM_Object (void)
 create
 
virtual ~SM_Object (void)
 destroy
 
- Public Member Functions inherited from CORE_Object
template<class T >
std::shared_ptr< T > getSharedPointer ()
 return the shared pointer for this More...
 
template<class T >
std::shared_ptr< const T > getConstSharedPointer () const
 return a const shared pointer for this More...
 
template<class T >
tBoolean isInstanceOf () const
 test if the clas T is an instance of this class More...
 
tString getClassName () const
 return the name of the class More...
 
tString getPointerString () const
 retrun the pointer of the class as a string More...
 
tString getIdentityString () const
 retrun the string identification of the class More...
 

Static Public Member Functions

static CORE_UniquePointer< SM_ZeemanOperatorNew ()
 build a new instance of the operator More...
 
static void ComputeSpinEnergy (const tReal &mu_s, const tReal *Hext, const tReal *iS, const tReal *eSi, tReal &E)
 compute spin energy More...
 
- Static Public Member Functions inherited from CORE_Object
static tBoolean EnableMemoryStack (const tBoolean &isMemoryChecked)
 enable the memory stack More...
 
static void EnableMemoryStack ()
 enable the memory stack
 
static void DisableMemoryStack ()
 disable the memory stack
 
static tBoolean IsMemoryStackEnabled ()
 return trur if the memory stack is enabled
 
static tString MemoryStackToString ()
 get the memory stack in string More...
 
static tIndex GetRegisteredClassesNumber ()
 get the memory stack in string More...
 

Protected Member Functions

 SM_ZeemanOperator (void)
 create a zeeman operator interface
 
virtual ~SM_ZeemanOperator (void)
 destroy
 
void setParticlesNumber (const tIndex &p)
 set zeeman particlules number More...
 
void setTimeStepsNumber (const tIndex &n)
 set zeeman time steps More...
 
const std::valarray< tReal > & getHext () const
 return Hext as an array More...
 
std::valarray< tReal > & getHext ()
 return Hext as an array More...
 
- Protected Member Functions inherited from SM_SliceOperator
 SM_SliceOperator (void)
 create a network class
 
virtual ~SM_SliceOperator (void)
 destroy
 
void setName (const tString &name)
 set the name More...
 
- Protected Member Functions inherited from CORE_Object
 CORE_Object ()
 build an instance of the object
 
virtual ~CORE_Object ()
 destroy the instance of object std

 

Static Protected Member Functions

static void ComputeUnscaledSpinEnergy (const tReal *Hext, const tReal *iS, const tReal *eS, tReal &E)
 compute the unscaled spin energy More...
 

Detailed Description

This class is describes a Zeeman operator interface.

The zeeman energy is \( E= - \tilde \mu_s . \sum_{i=0}^{i=P-1} < H_{ext}(P_i),S_i>\)

In order to have \(\displaystyle \forall i \in [0,P[, H(P_i)=-\frac{1}{\tilde \mu_s} \frac{dE}{dS_i}(P_i)\),

the corresponding magnetic excitation field is: \( H_z(P_i)= H_{ext}(P_i) \)

The energy is minimum when when the spin orientation at the particle is oriented along $H_{ext}$.

Author
Stephane Despreaux
Version
2.0

Member Function Documentation

◆ adimensionize()

virtual void SM_ZeemanOperator::adimensionize ( const tReal &  cH)
inlineoverridevirtual

adimensionize the operator

Parameters
[in]cH: characteristic field value in J

Reimplemented from SM_SliceOperator.

◆ computeEnergySlice()

tReal SM_ZeemanOperator::computeEnergySlice ( const tIndex &  timeIndex,
const SM_Network network,
const SM_Material material,
const tIndex &  startIndex,
const tIndex &  endIndex,
const tReal *  S 
) const
virtual

compute the energy at time t by virtual method for all particles in [startIndex,endIndex[

Parameters
[in]timeIndex: index of time
[in]network: network
[in]material: material of the network
[in]startIndex: start index of the particle to compute the energy
[in]endIndex: end index of the particle to compute the energy
[in]Sunit direction of magnetic spin moment of size nParticles x dim
Returns
the energy of the operator It returns \( E=\frac{1/2} \sum_i E_i \)

Implements SM_SliceOperator.

Reimplemented in SM_ConstantZeemanOperator.

◆ computeMagneticFieldSlice()

void SM_ZeemanOperator::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
virtual

compute the anisotropy magnetic field by virtual method

Parameters
[in]timeIndex: time step index
[in]network: network
[in]material: material of the network
[in]startIndex: start index of the particle to compute the energy
[in]endIndex: end index of the particle to compute the energy
[in]Sunit direction of magnetic spin moment of size nParticles x dim
[in]alphasum operator 0 or 1
[in]nHnumber of elements of H
[in,out]Htotal magnetic field of size nH x dim

Computes \( H=alpha.H+H_{op} \)

\( H_{op}= K. \nabla_{S_i} Phi(S_i,U) \)

Implements SM_SliceOperator.

Reimplemented in SM_ConstantZeemanOperator.

◆ computeSpinEnergy()

virtual tReal SM_ZeemanOperator::computeSpinEnergy ( const tIndex &  i,
const tIndex &  timeIndex,
const SM_Network network,
const SM_Material material,
const SM_RealField S 
) const
inlineoverridevirtual

compute the spin energy by virtual method

Parameters
[in]i: index of the particles
[in]timeIndex: time step index
[in]network: network
[in]material: material of the network
[in]Sunit direction of magnetic spin moment of size nParticles x dim
Returns
the energy of the operator \( E_i = - \mu_s <S_i,H_{ext}(P_i)> \)

Implements SM_SliceOperator.

Reimplemented in SM_ConstantZeemanOperator.

◆ ComputeSpinEnergy()

static void SM_ZeemanOperator::ComputeSpinEnergy ( const tReal &  mu_s,
const tReal *  Hext,
const tReal *  iS,
const tReal *  eSi,
tReal &  E 
)
inlinestatic

compute spin energy

Parameters
[in]mu_s: magnetic moment at particule i in \( J.T^{-1}\)
[in]Hext: external applied field at particule i
[in]iS: begin iterator on direction of magnetic moment of the spin at particule i
[in]eSi: end iterator on direction of magnetic moment of the spin at particule i
[out]Eenergy of the spin \( E = - \mu_s <S,H_{ext}> \)

◆ ComputeUnscaledSpinEnergy()

static void SM_ZeemanOperator::ComputeUnscaledSpinEnergy ( const tReal *  Hext,
const tReal *  iS,
const tReal *  eS,
tReal &  E 
)
inlinestaticprotected

compute the unscaled spin energy

Parameters
[in]Hext: external applied field at particule i
[in]iS: begin iterator on direction of magnetic moment of the spin at particule i
[in]eS: end iterator on direction of magnetic moment of the spin at particule i
[out]Eenergy of the spin E=<Hext,S>

◆ copy()

virtual void SM_ZeemanOperator::copy ( const SM_SliceOperator op)
inlinevirtual

copy

Parameters
[in]op: operator to copy

Reimplemented from SM_SliceOperator.

◆ discretize()

virtual void SM_ZeemanOperator::discretize ( const SM_Network network,
const SM_Material material 
)
inlineoverridevirtual

discretize the operator on the network

Parameters
[in]network: network on which the operator is applied
[in]material: material of the network

Reimplemented from SM_SliceOperator.

Reimplemented in SM_PermanentZeemanOperator, and SM_ConstantZeemanOperator.

◆ getContentsMemorySize()

virtual tMemSize SM_ZeemanOperator::getContentsMemorySize ( ) const
inlinevirtual

return nthe memory size of the included associations

Returns
the memory size of the storage in bytes 1 Kb = 1024 bytes 1 Mb = 1024 Kb 1 Gb = 1024 Mb 1 Tb = 1024 Gb 1 Hb = 1024 Tb

Reimplemented from SM_SliceOperator.

◆ getHext() [1/2]

std::valarray<tReal>& SM_ZeemanOperator::getHext ( )
inlineprotected

return Hext as an array

Returns
the external magnetic field for writing

◆ getHext() [2/2]

const std::valarray<tReal>& SM_ZeemanOperator::getHext ( ) const
inlineprotected

return Hext as an array

Returns
the external magnetic field for reading

◆ getHextAtTimeIndex() [1/2]

tReal* SM_ZeemanOperator::getHextAtTimeIndex ( const tIndex &  timeIndex)
inline

return Hext at time step index t

Parameters
[in]timeIndextime step index of Hext in [0,SM_TimeStepper::GetMaximimumTimeStepsNumber()[
Returns
the external magnetic field for writing

◆ getHextAtTimeIndex() [2/2]

const tReal* SM_ZeemanOperator::getHextAtTimeIndex ( const tIndex &  timeIndex) const
inline

return Hext at time step index t

Parameters
[in]timeIndextime step index of Hext in [0,SM_TimeStepper::GetMaximimumTimeStepsNumber()[
Returns
the external magnetic field for reading

◆ getHextValues()

const tReal* SM_ZeemanOperator::getHextValues ( ) const
inline

return Hext at time 0

Returns
the external magnetic field for reading

◆ getHexValues()

tReal* SM_ZeemanOperator::getHexValues ( )
inline

return Hext

Returns
the external magnetic field for writing

◆ getMemorySize()

virtual tMemSize SM_ZeemanOperator::getMemorySize ( ) const
inlinevirtual

return the memory size of the class and the memory size of all its attributes/associations

Returns
the memory size of the class and the memory size of its attributes/associations in bytes The mamory size is :
  • the added size of the base classes which contains:
    • the primary attributes size depends on the order: (first delare the smallest attributes size
    • all virtual functions costs <pointer-size> (4 32xor 8 64x) bytes by virtual function
    • virtual inherihtance will increase of (4 or 8) bytes
  • we add the size of the contains values of the attributes : for example the size of a string is the length of the string 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from SM_SliceOperator.

Reimplemented in SM_PermanentZeemanOperator, and SM_ConstantZeemanOperator.

◆ getParticlesNumber()

const tIndex& SM_ZeemanOperator::getParticlesNumber ( ) const
inline

return the number of particles for the zeeman operatpr

Returns
the number of particles for the zeeman operator

◆ getTimeStepsNumber()

const tIndex& SM_ZeemanOperator::getTimeStepsNumber ( ) const
inline

return the number of time steps for the zeeman operatpr

Returns
the number of time steps for the zeeman operator

◆ New()

static CORE_UniquePointer<SM_ZeemanOperator> SM_ZeemanOperator::New ( )
inlinestatic

build a new instance of the operator

Returns
an unique pointer of the operator

◆ NewInstance()

virtual CORE_UniquePointer<SM_SliceOperator> SM_ZeemanOperator::NewInstance ( ) const
inlineoverridevirtual

create a New instance of this

Returns
an unique pointer to the instance

Implements SM_SliceOperator.

Reimplemented in SM_PermanentZeemanOperator, and SM_ConstantZeemanOperator.

◆ setHext() [1/3]

void SM_ZeemanOperator::setHext ( const std::array< tReal, SM_Constants::DIM > &  values)
inline

set the Hext value

Parameters
[in]valuesinit value

◆ setHext() [2/3]

void SM_ZeemanOperator::setHext ( const std::vector< tReal > &  values)
inline

set the Hext value

Parameters
[in]valuesiniializer list of the values of Hext

◆ setHext() [3/3]

void SM_ZeemanOperator::setHext ( std::initializer_list< tReal > &&  values)
inline

set the Hext value

Parameters
[in]valuesiniializer list of the values of Hext

◆ setParticlesNumber()

void SM_ZeemanOperator::setParticlesNumber ( const tIndex &  p)
inlineprotected

set zeeman particlules number

Parameters
[in]p: the number of Zeeman particules number

◆ setTimeStepsNumber()

void SM_ZeemanOperator::setTimeStepsNumber ( const tIndex &  n)
inlineprotected

set zeeman time steps

Parameters
[in]n: the number of times steps of the zeeman values

The documentation for this class was generated from the following files: