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

This class is a simulation of one trajectory class for Stoch Microm package based on Stratonovich system. More...

#include <SMOMPI_StratonovichSystem.h>

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

Public Member Functions

 SMOMPI_StratonovichSystem (void)
 create a class
 
virtual ~SMOMPI_StratonovichSystem (void)
 destroy the class
 
virtual tMemSize getMemorySize () const
 return the memory size of the class and the memory size of all its attributes/associations More...
 
const tReal & getK () const
 return the stratonovich constant More...
 
virtual void discretize () override
 discretize the system It computes the Stratonovich constant depending on the parameters of the Landau Lifschitz function More...
 
virtual tBoolean computeMagneticMomentDirectionsAtNextTimeStep (const tReal &dt, const tReal &epsilon_t, const SM_RealField &deltaSt, SM_RealField &St) final
 compute direction of magnetic moments at next time step More...
 
- Public Member Functions inherited from SMOMPI_LandauLifschitzSystem
virtual tMemSize getContentsMemorySize () const
 return the memory size of the included associations More...
 
virtual void sumOverNetworks (const int &rootNetwork, tIndex &n, const tIndex &nValues, tReal *values) const final
 sum the values of all network More...
 
virtual tBoolean updateInitialMagneticMomentDirections (const SM_RealField &S0) final
 update the initial unit direction of spins More...
 
virtual tBoolean initializeMagneticMomentDirections () final
 initialize magnetic moments direction More...
 
template<class StochFImplement , class NoiseFImplement >
tBoolean stochasticRunWithSCStochasticFunctions (const tIndex &steppersNumber, SM_MultiStochasticFunctions< StochFImplement > &stochasticFunctions, const SM_NoiseRateFunction< NoiseFImplement > &noiseRateFunction)
 compute the relaxation process by calling only virtual methods More...
 
template<class StochFImplement , class NoiseImplement , class StochOutputImplement >
tBoolean stochasticRunWithSCStochasticFunctions (const tIndex &steppersNumber, SM_MultiStochasticFunctions< StochFImplement > &stochasticFunctions, const SM_NoiseRateFunction< NoiseImplement > &noiseRateFunction, SM_StochasticOutput< StochOutputImplement > &stochasticOutput)
 compute the relaxation process by calling only virtual methods More...
 
virtual tReal computeNetTorque (const tIndex &nSParticles, const tReal *S, const tIndex &nHParticles, const tReal *H) const final
 compute Net Torque \( |S \wedge H |_\infty \) More...
 
virtual void computeVariationMagneticField (const tReal &dt, SM_RealField &H) const final
 computes \( H:=H.dt \) More...
 
virtual void computeBrownianVariationMagneticField (SM_MultiStochasticFunctionsInterface &stochFs, const tReal &dt, const tReal &bdt, const tReal &epsilon, const tBoolean &incdWt, tReal *dWt, SM_RealField &H) final
 add stochastic brownian field \( H:=dt.H+ sdt.\varepsilon.N(0,1) \) More...
 
template<class StochFImpl >
void computeBrownianVariationMagneticFieldWithSCStochasticFunctions (SM_MultiStochasticFunctions< StochFImpl > &stochFs, const tReal &dt, const tReal &bdt, const tReal &epsilon, const tBoolean &incdWt, tReal *dWt, SM_RealField &H)
 add stochastic brownian field \( H:=dt.H+ sdt.\varepsilon.N(0,1) \) More...
 
template<class StochFImpl , class NoiseFImpl >
tBoolean stochasticRunWithSCStochasticFunctions (const tIndex &steppersNumber, SM_MultiStochasticFunctions< StochFImpl > &stochasticFunctions, const SM_NoiseRateFunction< NoiseFImpl > &noiseRateFunction)
 
template<class StochFImpl , class NoiseImpl , class StochOutputImpl >
tBoolean stochasticRunWithSCStochasticFunctions (const tIndex &steppersNumber, SM_MultiStochasticFunctions< StochFImpl > &stochasticFunctions, const SM_NoiseRateFunction< NoiseImpl > &noiseRateFunction, SM_StochasticOutput< StochOutputImpl > &stochasticOutput)
 
- Public Member Functions inherited from SM_LandauLifschitzSystem
const SM_TimeSteppergetTimeStepper () const
 get the time stepper More...
 
SM_TimeSteppergetTimeStepper ()
 get the time stepper More...
 
const tReal & getTime () const
 get the time More...
 
const tIndex & getTimeIndex () const
 get the time index More...
 
tIndex & getTimeIndex ()
 get the time index More...
 
tReal & getTime ()
 get the time More...
 
void resetTime ()
 reset time
 
const tReal & getNoiseRate () const
 get the noise rate More...
 
tReal & getNoiseRate ()
 get the noise rate More...
 
void setNoiseRateFunction (CORE_UniquePointer< SM_NoiseRateFunctionInterface > &f)
 gst the noise rate function More...
 
tBoolean hasNoiseRateFunction () const
 return true if the noise rate function is not null More...
 
SM_NoiseRateFunctionInterfacegetNoiseRateFunction ()
 get the noise rate function More...
 
const SM_NoiseRateFunctionInterfacegetNoiseRateFunction () const
 get the noise rate function More...
 
virtual void setNoiseTemperature (const tReal &T) override
 set the noise as a temperature in Kelvin More...
 
void setIsRelaxed (const tBoolean &isRelaxed)
 set if the system runs until relaxation More...
 
const tBoolean & isRelaxed () const
 get if the system runs until relaxation More...
 
void setRelaxationTolerance (const tReal &eps)
 set the relaxation tolerance to detect relaxation More...
 
const tReal & getRelaxationTolerance () const
 get the relaxation tolerance to detect relaxation More...
 
const tReal & getRelaxationValue () const
 get the relaxation value to detect relaxation for reading More...
 
tReal & getRelaxationValue ()
 get the relaxation value to detect relaxation for writing More...
 
tReal computeNetTorque () const
 compute Net Torque \( |S \wedge H |_\infty \)
 
const SM_LandauLifschitzFunctiongetLandauLifschitzFunction () const
 get the Landau Lifschitz function return the Landau lifschitz function for reading
 
SM_LandauLifschitzFunctiongetLandauLifschitzFunction ()
 get the Landau Lifschitz function More...
 
virtual void normalize (const tBoolean &isAdimensionized) override
 normalize the system More...
 
const SM_RealFieldgetMagneticField () const
 get the magnetic field for writting More...
 
const SM_RealFieldgetMagneticMomentDirectionsVariation () const
 get the variation of the direction of the magnetic moments for writting More...
 
virtual tULLInt getGeneratedRandomNumbers () const override
 get the generated of random number within a stochastic run per one step of run
 
template<class StochOutputI >
tBoolean deterministicRun (const tIndex &steppersNumber, SM_StochasticOutput< StochOutputI > &stochasticOutput)
 compute deterministic running of steppers number of the system with computing statistics More...
 
tBoolean stochasticRun (const tIndex &steppersNumber, SM_MultiStochasticFunctionsInterface &sfs)
 compute the steppers number of system without stochastic output More...
 
template<class StochOutputImplement >
tBoolean stochasticRun (const tIndex &steppersNumber, SM_MultiStochasticFunctionsInterface &multiStochasticFunctions, SM_StochasticOutput< StochOutputImplement > &stochasticOutput)
 compute the steppers number of system without stochastic output More...
 
tBoolean stochasticJRun (const tIndex &steppersNumber, SM_StochasticFunctionsInterface &stochasticFunctions, const std::function< void(const tReal &, const tReal &, const tReal &, tReal &)> &F)
 compute the steppers number of system for reaching the relaxed state More...
 
template<class StochOutputImpl >
tBoolean stochasticJRun (const tIndex &steppersNumber, SM_StochasticFunctionsInterface &stochasticFunctions, SM_StochasticOutput< StochOutputImpl > &stochasticOutput, const std::function< void(const tReal &, const tReal &, const tReal &, tReal &)> &F)
 compute the steppers number of system for reaching the relaxed state More...
 
virtual tString toString () const override
 turn the class into a string representation More...
 
- Public Member Functions inherited from SM_System
void setNetwork (CORE_UniquePointer< SM_Network > net)
 set the network More...
 
const SM_NetworkgetNetwork () const
 get the network More...
 
SM_NetworkgetNetwork ()
 get the network More...
 
tBoolean hasNetwork () const
 return true if the system has a network More...
 
const SM_MaterialgetMaterial () const
 get the material of the network More...
 
SM_MaterialgetMaterial ()
 get the material of the network More...
 
void setInitialMagneticMomentDirections (const std::valarray< tReal > &S0)
 set the initial unit direction of spins More...
 
void setInitialMagneticMomentDirections (const SM_RealField &S0)
 set the initial unit direction of spins More...
 
void setInitialMagneticMomentDirections (const tIndex &N, const std::array< tReal, SM_Constants::DIM > &S0)
 set the initial unit direction of spins More...
 
const SM_RealFieldgetInitialMagneticMomentDirections () const
 get the initial unit direction of spins More...
 
SM_RealFieldgetInitialMagneticMomentDirections ()
 get the initial unit direction of spins for writting More...
 
const SM_RealFieldgetMagneticMomentDirections () const
 get the unit direction of spins at time More...
 
SM_RealFieldgetMagneticMomentDirections ()
 get the unit direction of spins at time for writting More...
 
void addOperator (CORE_UniquePointer< SM_Operator > op)
 add operator More...
 
const SM_SliceOperatorgetOperator (const tString &name) const
 get the operator with name More...
 
SM_SliceOperatorgetOperator (const tString &name)
 get the operator with name More...
 
void copyOperators (const SM_System &system)
 copy the operator More...
 
const std::map< tString, CORE_UniquePointer< SM_Operator > > & getOperators () const
 get the operators More...
 
std::map< tString, CORE_UniquePointer< SM_Operator > > & getOperators ()
 get the operators More...
 
tIndex getOperatorsNumber () const
 get the operators number More...
 
void getOperatorsName (std::vector< tString > &names) const
 get the operator names More...
 
virtual void setStochasticNoise (const tReal &eps)
 set the stochastic noise without dimension More...
 
const tReal & getStochasticNoise () const
 get the stochastic noise without dimension More...
 
const tReal & getNoiseTemperature () const
 get the noise temperature in Kelvin More...
 
const tIndex & getStepIndex () const
 get the step index More...
 
tIndex & getStepIndex ()
 get the step index More...
 
void computeMagneticMomentDirectionsSumOverNetworks (const int &rootNetwork, std::array< tReal, SM_Constants::DIM > &sumS) const
 compute the sum over the domain of magnetic moment dierctions More...
 
void computeMagneticMomentDirectionsMeanOverNetworks (const int &rootNetwork, std::array< tReal, SM_Constants::DIM > &meanS) const
 compute the mean over the domain of magneticmoment directions More...
 
void computeMagneticMomentDirectionsSum (const tInteger &start, const tInteger &end, std::array< tReal, SM_Constants::DIM > &sumS) const
 compute the sum of magnetic moment directions over the network More...
 
void updateOperatorsState (const tIndex &timeIndex, const SM_Network &network, const SM_Material &material, const SM_RealField &S)
 update the operators state before computeing magnetic field More...
 
void computeMagneticField (const tIndex &timeIndex, const SM_Network &network, const SM_Material &material, const SM_RealField &S, SM_RealField &H) const
 compute the magnetic field at time step index t by calling the virtual method SM_Operator::computeMagneticField() More...
 
tReal computeSpinEnergy (const tIndex &i, const SM_Network &network, const SM_Material &material, const SM_RealField &S) const
 compute the energy of the spin of the system More...
 
tReal computeSpinEnergy (const tIndex &i, const tIndex &timeIndex, const SM_Network &network, const SM_Material &material, const SM_RealField &S) const
 compute the energy of the spin of the system More...
 
const tReal & computeEnergies (std::valarray< tReal > &energies) const
 compute the energies per operators More...
 
const tReal & computeEnergies (const tIndex &timeIndex, std::valarray< tReal > &energies) const
 compute the energies per operators 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< SMOMPI_StratonovichSystemNew ()
 build a new instance of a system More...
 
- Static Public Member Functions inherited from SMOMPI_LandauLifschitzSystem
static void ComputeMagneticMomentDirectionsAtNextTimeStep (const tIndex &nParticles, const SM_RealField &deltaS, const SM_RealField &S, SM_RealField &nextS)
 compute \( St:=St+deltaS \) More...
 
static void ComputeMagneticMomentDirectionsAtNextTimeStep (const tIndex &nParticles, const SM_RealField &deltaSt, const tReal &alpha, const SM_RealField &S, SM_RealField &nextS)
 compute \( St:=St+deltaS \) More...
 
- Static Public Member Functions inherited from SM_System
static void ComputeFieldSum (const tInteger &start, const tInteger &end, const SM_RealField &F, std::array< tReal, SM_Constants::DIM > &sumF)
 compute the sum of F over the network 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...
 

Additional Inherited Members

- Protected Member Functions inherited from SMOMPI_LandauLifschitzSystem
 SMOMPI_LandauLifschitzSystem (void)
 create a class
 
virtual ~SMOMPI_LandauLifschitzSystem (void)
 destroy the class
 
- Protected Member Functions inherited from SM_LandauLifschitzSystem
 SM_LandauLifschitzSystem (void)
 create a class
 
virtual ~SM_LandauLifschitzSystem (void)
 destroy the class
 
tReal computeNetSliceTorque (const tIndex &startS, const tIndex &endS, const tReal *S, const tIndex &startH, const tReal *H) const
 compute Net Torque \( |S \wedge H |_\infty \) for all particules in indices in [start,end[ More...
 
void setIsBrownianNull (const tBoolean &v)
 set if the brownian variable is null More...
 
const tBoolean & isBrownianNull () const
 get if the brownian variable is null
 
void setIsRealBrownianVariable (const tBoolean &v)
 set if the brownian variable is a field or a real
 
const tBoolean & isRealBrownianVariable () const
 get if the brownian variable is a field or a real
 
const SM_RealFieldgetBrownianField () const
 get the generated brownian variable for reading More...
 
SM_RealFieldgetBrownianField ()
 get the generated brownian variable for reading More...
 
void setLandauLifschitzFunction (CORE_UniquePointer< SM_LandauLifschitzFunction > llF)
 set the landau lifschitz function
 
SM_RealFieldgetMagneticField ()
 get the magnetic field for writting More...
 
SM_RealFieldgetMagneticMomentDirectionsVariation ()
 get the variation of the direction of the magnetic moments for writting More...
 
void computeVariationMagneticFieldSlice (const tIndex &start, const tIndex &end, const tReal &dt, tReal *H) const
 computes \( H:=H.dt \) for particle indices in [start,end[ More...
 
void computeBrownianVariationMagneticFieldSlice (SM_StochasticFunctionsInterface &randF, const tIndex &start, const tIndex &end, const tReal &dt, const tReal &bdt, const tReal &epsilon, const tBoolean &incdWt, tReal *dWt, tReal *H)
 add stochastic brownian field \( H:=dt.H+ sdt.\varepsilon.N(0,1) \) for particle indices in [start,end[ More...
 
template<class StochFImpl >
void computeBrownianVariationMagneticFieldSliceWithSCStochasticFunctions (SM_StochasticFunctions< StochFImpl > &randF, tIndex start, tIndex end, const tReal &dt, const tReal &bdt, const tReal &epsilon, const tBoolean &incdWt, tReal *dWt, tReal *H)
 add stochastic brownian field \( H:=dt.H+ sdt.\varepsilon.N(0,1) \) for particle indices in [start,end[ More...
 
- Protected Member Functions inherited from SM_System
 SM_System (void)
 create a class
 
virtual ~SM_System (void)
 destroy the class
 
tReal computeEnergy (const SM_Network &network, const SM_Material &material, const SM_RealField &S) const
 compute the energy of the system More...
 
tReal computeEnergy (const tIndex &timeIndex, const SM_Network &network, const SM_Material &material, const SM_RealField &S) const
 compute the energy of the system 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 inherited from SM_LandauLifschitzSystem
static void ComputeMagneticMomentDirectionsSliceAtNextTimeStep (tIndex startS, tIndex endS, const tIndex &nDeltaS, const tReal *deltaS, const tIndex &nS, const tReal *S, tReal *nextS)
 compute \( nextS:=St+deltaS \) for all particle indices in [start,end[ More...
 
static void ComputeMagneticMomentDirectionsSliceAtNextTimeStep (tIndex startS, tIndex endS, const tIndex &nDeltaS, const tReal *deltaSt, const tReal &alpha, const tIndex &nS, const tReal *S, tReal *nextS)
 compute \( nextSt = alpha.St+deltaS \) for all particle indices in [start,end[ More...
 

Detailed Description

This class is a simulation of one trajectory class for Stoch Microm package based on Stratonovich system.

Author
Stephane Despreaux
Version
2.0

Member Function Documentation

◆ computeMagneticMomentDirectionsAtNextTimeStep()

tBoolean SMOMPI_StratonovichSystem::computeMagneticMomentDirectionsAtNextTimeStep ( const tReal &  dt,
const tReal &  epsilon_t,
const SM_RealField deltaSt,
SM_RealField St 
)
finalvirtual

compute direction of magnetic moments at next time step

Parameters
[in]dttime step
[in]epsilon_t: epsilon at time t
[in]deltaSt: stochastic variation of mu at time t
[in,out]St:
  • in input S at time t
  • in output S at time t+dt

    \( S_{t+dt}=\delta S(t)+(1-K.\varepsilon_t^2.dt).S_t \) with \( K=\alpha^2.(1+\beta^2)\)

Returns
false if there is a point \( P_i \) where at the coordinate k , \( |S(P_i)| \) is too much greater than 1 (10 for instance)

Implements SM_LandauLifschitzSystem.

◆ discretize()

virtual void SMOMPI_StratonovichSystem::discretize ( )
inlineoverridevirtual

discretize the system It computes the Stratonovich constant depending on the parameters of the Landau Lifschitz function

\( K=\alpha^2.(1+\beta^2)\)

Reimplemented from SMOMPI_LandauLifschitzSystem.

◆ getK()

const tReal& SMOMPI_StratonovichSystem::getK ( ) const
inline

return the stratonovich constant

Returns
the stratonivhc constant : \( \alpha^2.(1+\beta^2) \) where \((\alpha,\beta) \) is the coefficent of the landau lifschitz function see SMOMPI_LandauLifschitzFunction

◆ getMemorySize()

virtual tMemSize SMOMPI_StratonovichSystem::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 SMOMPI_LandauLifschitzSystem.

◆ New()

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

build a new instance of a system

Returns
an unique pointer of system

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