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

This class is a MPI implementation of simulation of a Monte Carlo method. More...

#include <SMOMPI_MonteCarloSystem.h>

Inheritance diagram for SMOMPI_MonteCarloSystem:
Inheritance graph
[legend]
Collaboration diagram for SMOMPI_MonteCarloSystem:
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 the memory size of the included associations More...
 
tBoolean initializeMagneticMomentDirections () final
 initialize magnetic moments of the particles of the network
 
- Public Member Functions inherited from SM_MonteCarloSystem
virtual void setNoiseTemperature (const tReal &T) override
 set the noise as a temperature in Kelvin More...
 
const tReal & getNoiseRate () const
 get the noise rate constant More...
 
const tReal & getEnergyScaling () const
 get the energy scaling More...
 
const tIndex & getRejectsNumber () const
 get the rejects number More...
 
const tIndex & getMovesNumber () const
 get the moves number More...
 
virtual void normalize (const tBoolean &isAdimensionized) override
 normalize the system More...
 
virtual void discretize () override
 discretize the system
 
virtual tULLInt getGeneratedRandomNumbers () const override
 get the generated of random number within a stochastic run
 
template<class StochOutputImplement >
tBoolean deterministicRun (const tIndex &steppersNumber, SM_StochasticOutput< StochOutputImplement > &data)
 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 for reaching the relaxed state More...
 
template<class StochOutputImplement >
tBoolean stochasticRun (const tIndex &steppersNumber, SM_MultiStochasticFunctionsInterface &sfs, SM_StochasticOutput< StochOutputImplement > &statistics)
 compute steppers number with statisics More...
 
template<class StochFunctionsImplement >
tBoolean stochasticRunWithSCStochasticFunctions (const tIndex &steppersNumber, SM_MultiStochasticFunctions< StochFunctionsImplement > &sfs)
 compute the relaxation process by calling only virtual methods More...
 
template<class StochFunctionsImplement , class StochOutputImplement >
tBoolean stochasticRunWithSCStochasticFunctions (const tIndex &steppersNumber, SM_MultiStochasticFunctions< StochFunctionsImplement > &sfs, SM_StochasticOutput< StochOutputImplement > &statistics)
 compute the relaxation process by calling only virtual methods 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...
 
virtual tBoolean updateInitialMagneticMomentDirections (const SM_RealField &S0)
 update 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...
 
virtual void sumOverNetworks (const int &rootNetwork, tIndex &n, const tIndex &nValues, tReal *values) const
 sum the values of all network 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< SelfNew ()
 build a new instance of a system 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...
 

Protected Member Functions

 SMOMPI_MonteCarloSystem (void)
 create a class
 
virtual ~SMOMPI_MonteCarloSystem (void)
 destroy the class
 
virtual void updateStateForNextStep (SM_RealField &St) final
 update the state for next step More...
 
- Protected Member Functions inherited from SM_MonteCarloSystem
 SM_MonteCarloSystem (void)
 create a class
 
virtual ~SM_MonteCarloSystem (void)
 destroy the class
 
tIndex & getMovesNumber ()
 get the move number More...
 
tIndex & getRejectsNumber ()
 get the rejects number More...
 
void MCStep (SM_MultiStochasticFunctionsInterface &multiStochasticFunctions, const SM_Material &material, const SM_Network &network, SM_RealField &S, const tIndex &stepIndex, const tReal &alpha, const tReal &sigma, tIndex &nMoves, tIndex &nRejects)
 stepper step More...
 
template<class StochFunctionsImplement >
void MCStepWithSCStochasticFunctions (SM_MultiStochasticFunctions< StochFunctionsImplement > &multiStochasticFunctions, const SM_Material &material, const SM_Network &network, SM_RealField &S, const tIndex &stepIndex, const tReal &alpha, const tReal &sigma, tIndex &nMoves, tIndex &nRejects)
 stepper step with templated stochastic function More...
 
template<class StochFunctionsImplement >
void randomTrialMoveWithSCStochasticFunctions (SM_StochasticFunctions< StochFunctionsImplement > &stochasticFunctions, const tReal &sigma, tReal *bS, const tReal *eS) const
 make a trial move More...
 
void randomTrialMove (SM_StochasticFunctionsInterface &stochasticFunctions, const tReal &sigma, tReal *bS, const tReal *eS) const
 make a trial move 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

 

Detailed Description

This class is a MPI implementation of simulation of a Monte Carlo method.

It implements the methods

The mpi algorithm of monte Carlo is

Author
Stephane Despreaux
Version
2.0

Member Function Documentation

◆ getContentsMemorySize()

virtual tMemSize SMOMPI_MonteCarloSystem::getContentsMemorySize ( ) const
inlinevirtual

return the 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_MonteCarloSystem.

◆ getMemorySize()

virtual tMemSize SMOMPI_MonteCarloSystem::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_MonteCarloSystem.

◆ New()

static CORE_UniquePointer<Self> SMOMPI_MonteCarloSystem::New ( )
inlinestatic

build a new instance of a system

Returns
an unique pointer of system

◆ updateStateForNextStep()

void SMOMPI_MonteCarloSystem::updateStateForNextStep ( SM_RealField St)
finalprotectedvirtual

update the state for next step

Parameters
[in]Stupdate St for next step Do othing in OPenMP version

Implements SM_MonteCarloSystem.


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