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

This class is an hysteresis cycle manager for running a cycle of a beam class for Stoch Microm package. More...

#include <SM_BeamHysteresis.h>

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

Public Member Functions

 SM_BeamHysteresis (void)
 create
 
virtual ~SM_BeamHysteresis (void)
 destroy
 
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...
 
void setAreCriticalPointsSaved (const tBoolean &flag)
 true to save magnetic moment dierctions at critical points More...
 
void setBackupsNumber (const tInteger &nBackups)
 set the number of backups More...
 
void setBackupStepsNumber (const tInteger &s)
 set the number of steps between 2 backups More...
 
void setHextRange (const std::array< tReal, 7 > &range)
 set the hext range More...
 
void setHysteresisFileName (const tString &hysteresisFile)
 set the hystersis file More...
 
tBoolean open (SM_Beam &beam, SM_StochasticOutputComponent &stochasticOutput, const tInteger &outputId, tIndex &iCycleStep)
 init the cycle of beam run More...
 
void nextCycleStep (const tIndex &iCycleStep, SM_Beam &beam, const tInteger &outputId, const SM_StochasticOutputComponent &output)
 next the cycle of beam run More...
 
tBoolean isCycleFinished (const tIndex &iCycle, const SM_Beam &beam)
 return true if the cycle is finished More...
 
virtual tString toString () const override
 return the string representation of the class
 
tBoolean close (const tIndex &iCycle, const SM_Beam &beam)
 return true if the cycle is close without error More...
 
- Public Member Functions inherited from SM_BeamCycle< SM_BeamHysteresis >
 SM_BeamCycle (void)
 create
 
virtual ~SM_BeamCycle (void)
 destroy
 
void setIsStochasticOutputSavedAtEachStep (const tBoolean &b)
 set is the output is saved at each step More...
 
const tBoolean & isStochasticOutputSavedAtEachStep () const
 get if the output is saved at each step More...
 
void setIsSeedUpdatedPerCycleStep (const tBoolean &b)
 set if the seed is generated at each step of the cycle More...
 
const tBoolean & isSeedUpdatedPerCycleStep () const
 return true if the seed is generated at each cycle step More...
 
void setSeedPerCycleStep (const tULLInt &seed)
 set the seed per step of each step cycle More...
 
const tULLInt & getSeedPerCycleStep () const
 get the seed
 
void setIsRestoring (const tBoolean &v)
 set to true if the cycle is restoring More...
 
const tBoolean & isRestoring () const
 return true if the cycle starts at last computed cycle index
 
tBoolean open (SM_Beam &beam, SM_StochasticOutputComponent &stochasticOutput, const tInteger &outputId, tIndex &iCycleStep)
 init the cycle of beam run More...
 
void nextCycleStep (const tIndex &iCycleStep, SM_Beam &beam, const SM_StochasticOutputComponent &output)
 next step of the cycle of beam run More...
 
void nextCycleStep (const tIndex &iCycleStep, SM_Beam &beam, const tInteger &outputId, const SM_StochasticOutputComponent &output)
 next step of the cycle of beam run More...
 
tBoolean isCycleFinished (const tIndex &iCycle, const SM_Beam &beam)
 return true if the cycle is finished More...
 
tBoolean close (const tIndex &iCycle, const SM_Beam &beam)
 return true if the cycle is close without error More...
 
- 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< SelfClassNew ()
 create an unique pointer to a new instance of this More...
 
static tBoolean LoadFromFile (const tString &fileName, std::array< tReal, SM_Constants::DIM > &direction, tReal &amplitude, tReal &dh, tInteger &nCycleSteps, tCInt &hysDirection, tRelativeInteger &hysStep, tReal &h, tInteger &nHysValues, std::valarray< tReal > &hs, std::valarray< tReal > &hys)
 read an hysteresis file 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 CORE_Object
 CORE_Object ()
 build an instance of the object
 
virtual ~CORE_Object ()
 destroy the instance of object std

 

Detailed Description

This class is an hysteresis cycle manager for running a cycle of a beam class for Stoch Microm package.

Author
Stephane Despreaux
Version
2.0

Member Function Documentation

◆ close()

tBoolean SM_BeamHysteresis::close ( const tIndex &  iCycle,
const SM_Beam beam 
)
inline

return true if the cycle is close without error

Parameters
[in]iCycle: index of the cycle
[in]beam: beam to run
Returns
return true if the cycle is close without error

◆ getContentsMemorySize()

virtual tMemSize SM_BeamHysteresis::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 CORE_Object.

◆ getMemorySize()

virtual tMemSize SM_BeamHysteresis::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_BeamCycle< SM_BeamHysteresis >.

◆ isCycleFinished()

tBoolean SM_BeamHysteresis::isCycleFinished ( const tIndex &  iCycle,
const SM_Beam beam 
)
inline

return true if the cycle is finished

Parameters
[in]iCycle: index of the cycle
[in]beam: beam to run

◆ LoadFromFile()

static tBoolean SM_BeamHysteresis::LoadFromFile ( const tString &  fileName,
std::array< tReal, SM_Constants::DIM > &  direction,
tReal &  amplitude,
tReal &  dh,
tInteger &  nCycleSteps,
tCInt &  hysDirection,
tRelativeInteger &  hysStep,
tReal &  h,
tInteger &  nHysValues,
std::valarray< tReal > &  hs,
std::valarray< tReal > &  hys 
)
inlinestatic

read an hysteresis file

Parameters
[in]fileNamehystereis file name
[out]directiondirection of Hext
[out]amplitudeamplitude of Hext
[out]dhvariation of Hext
[out]nCycleStepsnumber of steps of the cycle
[out]hysDirectiondirection of hysteresis at the last computed point
[out]hysStepindex of the hysteresis step at the last computed point within the direction cycle
[out]h: last value of h computed
[out]nHysValues: number of loaded hysteresis values
[out]hslist of hs computed
[out]hyslist of hysteresis values computed
Returns
false if the fileName does not exists of if the data can not be found in the file

◆ New()

static CORE_UniquePointer<SelfClass> SM_BeamHysteresis::New ( )
inlinestatic

create an unique pointer to a new instance of this

Returns
an unique pointer of an instance of this

◆ nextCycleStep()

void SM_BeamHysteresis::nextCycleStep ( const tIndex &  iCycleStep,
SM_Beam beam,
const tInteger &  outputId,
const SM_StochasticOutputComponent output 
)
inline

next the cycle of beam run

Parameters
[in]iCycleStep:index of the cycle step
[in,out]beam: beam to run
[in]outputId: id of the output
[in]output: stochastic output of the cycle

◆ open()

tBoolean SM_BeamHysteresis::open ( SM_Beam beam,
SM_StochasticOutputComponent stochasticOutput,
const tInteger &  outputId,
tIndex &  iCycleStep 
)
inline

init the cycle of beam run

Parameters
[in,out]beam: beam to run
[in,out]stochasticOutputstochastic output of the beam runner
[in]outputId: id of the output
[out]iCycleStepindex of the cycle step not equal to 0 for restore

◆ setAreCriticalPointsSaved()

void SM_BeamHysteresis::setAreCriticalPointsSaved ( const tBoolean &  flag)
inline

true to save magnetic moment dierctions at critical points

Parameters
[in]flag: true to save the spin directions at crtical points

◆ setBackupsNumber()

void SM_BeamHysteresis::setBackupsNumber ( const tInteger &  nBackups)
inline

set the number of backups

Parameters
[in]nBackups: number of backups

◆ setBackupStepsNumber()

void SM_BeamHysteresis::setBackupStepsNumber ( const tInteger &  s)
inline

set the number of steps between 2 backups

Parameters
[in]snumber of steps between 2 backups

◆ setHextRange()

void SM_BeamHysteresis::setHextRange ( const std::array< tReal, 7 > &  range)
inline

set the hext range

Parameters
[in]range: [Hext0,Hext1,nHext] range of Hext from hext0 to hext 1 with nHext steps

◆ setHysteresisFileName()

void SM_BeamHysteresis::setHysteresisFileName ( const tString &  hysteresisFile)
inline

set the hystersis file

Parameters
[in]hysteresisFile: relative path or absolute path of the hysteresis file

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