C++ mpi module for stochmagnet_main Package
Public Member Functions | Protected Member Functions | List of all members
SM_AnisotropyOperator< I > Class Template Reference

This class is describes the general anisotropy operatoor. More...

#include <SM_AnisotropyOperator.h>

Inheritance diagram for SM_AnisotropyOperator< I >:
Inheritance graph
[legend]
Collaboration diagram for SM_AnisotropyOperator< I >:
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 void computeMagneticFieldSlice (const tIndex &stepIndex, 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 &stepIndex, const SM_Network &network, const SM_Material &material, const SM_RealField &S) const final
 compute the i-th spin anisotropy energy
More...
 
void computeSpinEnergy (const tReal &K, const tReal *iU, const tReal *eU, const tReal *iS, const tReal *eS, tReal &Ei, tReal &W) const
 compute the anisotropy spin energy 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...
 
void computePhi (const tReal *U, const tReal *eU, const tReal *S, const tReal *eS, tReal &phi, tReal &W) const
 compute the \( \Phi_U(S) \) function More...
 
void computePhiDerivatives (const tReal *U, const tReal *eU, const tReal *S, const tReal *eS, tReal &phi, std::array< tReal, SM_Constants::DIM > &gradPhi, tReal &W, tReal &W3) const
 compute the \( \nabla. \Phi_U(S) . U \) function More...
 
- Public Member Functions inherited from SM_SliceOperator
virtual CORE_UniquePointer< SM_SliceOperatorNewInstance () const =0
 create a New instance of this More...
 
virtual tMemSize getContentsMemorySize () const
 return nthe memory size of the included associations More...
 
const tString & getName () const
 return the operator name More...
 
virtual void copy (const SM_SliceOperator &op)
 copy More...
 
virtual void adimensionize (const tReal &cH)
 adimensionize operator with characteric field value in J More...
 
virtual void discretize (const SM_Network &network, const SM_Material &material)
 discretize the operator on the network 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...
 
virtual tString toString () const override
 return string representaton of the operator
 
- 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...
 

Protected Member Functions

 SM_AnisotropyOperator (void)
 create a network class
 
virtual ~SM_AnisotropyOperator (void)
 destroy
 
- 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

 

Additional Inherited Members

- 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...
 

Detailed Description

template<class I>
class SM_AnisotropyOperator< I >

This class is describes the general anisotropy operatoor.

The anisotropy energy for the spin i is \( E_i= \displaystyle K. \Phi_U(S_i)\)

In order to have \(\displaystyle \forall i \in [0,P[, \frac{dE}{dSi}(P)=- \mu_s ^mu_B. H(P) \),

the corresponding magnetic excitation field at particle i is \( H(P_i)=H^i= -\frac{K}{\mu_s.\mu_B}. \nabla Phi_U(S_i) \)

The total anistropy for the system of all \(P\) particles is \( E= \sum_i E_i = \sum_i \tilde \displaystyle K. \Phi_U(S_i)\)

Author
Stephane Despreaux
Version
2.0

Member Function Documentation

◆ computeEnergySlice()

template<class I >
tReal SM_AnisotropyOperator< I >::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.

◆ computeMagneticFieldSlice()

template<class I >
void SM_AnisotropyOperator< I >::computeMagneticFieldSlice ( const tIndex &  stepIndex,
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]stepIndex: 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.

◆ computePhi()

template<class I >
void SM_AnisotropyOperator< I >::computePhi ( const tReal *  U,
const tReal *  eU,
const tReal *  S,
const tReal *  eS,
tReal &  phi,
tReal &  W 
) const
inline

compute the \( \Phi_U(S) \) function

Parameters
[in]Ubegin iterator on anisotropy directions
[in]eUend iterator on anisotropy directions
[in]Sbegin iterator on direction of spin magnetic moment
[in]eSend iterator on direction of spin magnetic moment
[out]phi: the phi value
[out]Wwork value

◆ computePhiDerivatives()

template<class I >
void SM_AnisotropyOperator< I >::computePhiDerivatives ( const tReal *  U,
const tReal *  eU,
const tReal *  S,
const tReal *  eS,
tReal &  phi,
std::array< tReal, SM_Constants::DIM > &  gradPhi,
tReal &  W,
tReal &  W3 
) const
inline

compute the \( \nabla. \Phi_U(S) . U \) function

Parameters
[in]Uanisotropy direction
[in]eUend iterator on anisotropy directions
[in]Sdirection of spin magnetic moment
[in]eSend iterator on direction of spin magnetic moment
[out]phi: the phi value
[out]gradPhireturn value : \( \nabla \Phi_U(S)\)
[out]Wwork value
[out]W3work value

◆ computeSpinEnergy() [1/2]

template<class I >
virtual tReal SM_AnisotropyOperator< I >::computeSpinEnergy ( const tIndex &  i,
const tIndex &  stepIndex,
const SM_Network network,
const SM_Material material,
const SM_RealField S 
) const
inlinefinalvirtual

compute the i-th spin anisotropy energy

Parameters
[in]i: index of the particles
[in]stepIndex: 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=-K.\mu_s Phi(S_i,U) \)

Implements SM_SliceOperator.

◆ computeSpinEnergy() [2/2]

template<class I >
void SM_AnisotropyOperator< I >::computeSpinEnergy ( const tReal &  K,
const tReal *  iU,
const tReal *  eU,
const tReal *  iS,
const tReal *  eS,
tReal &  Ei,
tReal &  W 
) const
inline

compute the anisotropy spin energy

Parameters
[in]Kanisotropy factor
[in]iUbegin of directions of anisotropy
[in]eUend of directions of anisotropy
[in]iSbegin iterator on direction of the spin
[in]eSend iterator on direction of the spin
[out]Eienergy of the spin \( E_i=-K.\mu_s Phi(S_i,U) \)
[out]Wwork value

◆ getMemorySize()

template<class I >
virtual tMemSize SM_AnisotropyOperator< I >::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_UniaxialAnisotropyOperator, SM_PlanarAnisotropyOperator, and SM_CubicAnisotropyOperator.


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