C++ main module for stochmagnet Package
1.0
|
This class is a simulation of one trajectory class for Stoch Microm package based on Stratonovich system where the magnetic moment is normalized. More...
#include <SM_StratonovichNormalizedSystem.h>
Public Member Functions | |
SM_StratonovichNormalizedSystem (void) | |
create a class More... | |
virtual | ~SM_StratonovichNormalizedSystem (void) |
destroy the class More... | |
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... | |
tBoolean | computeTemplatedMuAtNextTimeStep (const tReal &dt, const tReal &epsilon_t, const tIndex &nParticles, const tDimension &dim, const tReal *mu_t, tReal *mu_tpdt) const |
compute mu at time step More... | |
virtual void | getOperatorNames (std::vector< tString > &names) const override |
get the operator names More... | |
tBoolean | makeTemplatedRelaxation (const SM_TemplatedStochasticFunction< StochImpl > &randomFunction, tReal *mu, tReal *Es) |
compute the relaxation process by calling only templated methods More... | |
tBoolean | makeTemplatedRelaxation (const SM_TemplatedStochasticFunction< StochImpl > &randomFunction, const SM_TemplatedNoiseRateFunction< NoiseImpl > &noiseRateFunction, tReal *mu, tReal *Es) |
compute the relaxation process by calling only templated methods More... | |
virtual tMemSize | getContentsMemorySize () const |
return the memory size of the included associations More... | |
const SM_Network & | getNetwork () const |
get the network More... | |
SM_Network & | getNetwork () |
get the network More... | |
const SM_TimeStepper & | getTimeStepper () const |
get the time stepper More... | |
SM_TimeStepper & | getTimeStepper () |
get the time stepper More... | |
void | setInitialMagneticMoment (const std::valarray< tReal > &mu0) |
set the initial Magnetic Moment by moving More... | |
void | setInitialMagneticMoment (const SM_RealField &mu0) |
set the initial Magnetic Moment by moving More... | |
void | setInitialMagneticMoment (const tIndex &N, const std::array< tReal, 3 > &mu0) |
set the initial Magnetic Moment by copy More... | |
const SM_RealField & | getInitialMagneticMoment () const |
set the initial Magnetic Moment More... | |
void | setNoiseRateFunction (CORE_UniquePointer< SM_NoiseRateFunction > &f) |
gst the noise rate function More... | |
SM_NoiseRateFunction & | getNoiseRateFunction () |
get the noise rate function More... | |
const SM_NoiseRateFunction & | getNoiseRateFunction () const |
get the noise rate function More... | |
const SM_LandauLifschitzFunction & | getLandauLifschitzFunction () const |
get the Landau Lifschitz function return the Landau lifschitz function for reading More... | |
SM_LandauLifschitzFunction & | getLandauLifschitzFunction () |
get the Landau Lifschitz function More... | |
void | addOperator (CORE_UniquePointer< SM_Operator > op) |
add operator More... | |
const SM_Operator * | getOperator (const tString &name) const |
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... | |
tIndex | getOperatorsNumber () const |
get the operator with name More... | |
tBoolean | makeRelaxation (const SM_StochasticFunction *randomFunction, tReal *mu, tReal *Es) |
compute the relaxation process by calling only virtual methods More... | |
virtual tString | toString () const override |
turn the class into a string representation More... | |
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_StratonovichNormalizedSystem > | New () |
build a new instance of a system More... | |
static tBoolean | EnableMemoryStack (const tBoolean &isMemoryChecked) |
enable the memory stack More... | |
static void | EnableMemoryStack () |
enable the memory stack More... | |
static void | DisableMemoryStack () |
disable the memory stack More... | |
static tBoolean | IsMemoryStackEnabled () |
return trur if the memory stack is enabled More... | |
static tString | MemoryStackToString () |
get the memory stack in string More... | |
static tIndex | GetRegisteredClassesNumber () |
get the memory stack in string More... | |
Protected Member Functions | |
void | computeTemplatedMagneticField (const tIndex &t, const SM_Network &network, const tReal *mu, tReal *B) const |
compute the magnetic field at time step index t by calling the templated method SM_TemplatedOperator::computeTemplatedMagneticField() More... | |
void | computeTemplatedMagneticFieldAndEnergies (const tIndex &t, const SM_Network &network, const tReal *mu, tReal *B, tReal *Es) const |
compute the magnetic field at time t by calling the templated method SM_TemplatedOperator::computeTemplatedMagneticField() More... | |
virtual tBoolean | computeMuAtNextTimeStep (const tReal &dt, const tReal &epsilon_t, const tIndex &nParticles, const tDimension &dim, const tReal *mu_t, tReal *mu_tpdt) const |
compute mu at time step More... | |
SM_RealField & | getMagneticField () |
get the magnetic field More... | |
void | computeMagneticField (const tIndex &t, const SM_Network &network, const tReal *mu, tReal *B) const |
compute the magnetic field at time step index t by calling the virtual method SM_Operator::computeMagneticField() More... | |
void | computeMagneticFieldAndEnergies (const tIndex &t, const SM_Network &network, const tReal *mu, tReal *B, tReal *Es) const |
compute the magnetic field by calling the virtual method SM_Operator::computeMagneticField() More... | |
Private Member Functions | |
template<class T > | |
std::shared_ptr< T > | setThis (std::unique_ptr< T, CORE_Object::Delete > &up) |
set the shared pointer from an unique pointer More... | |
Private Attributes | |
tReal | mK |
const SM_ZeemanOperator * | mZeemanOperator |
const SM_DemagnetizedOperator * | mDemagnetizedOperator |
const SM_HeissenbergOperator * | mHeissenbergOperator |
SM_LandauLifschitzFunction | mLLFunction |
SM_Network | mNetwork |
SM_TimeStepper | mTimeStepper |
std::map< tString, CORE_UniquePointer< SM_Operator > > | mOperators |
SM_RealField | mB |
SM_RealField | mMu0 |
CORE_UniquePointer< SM_NoiseRateFunction > | mNoiseRateFunction |
std::weak_ptr< CORE_Object > | mThis |
This class is a simulation of one trajectory class for Stoch Microm package based on Stratonovich system where the magnetic moment is normalized.
|
inline |
|
inlinevirtual |
destroy the class
|
inlineinherited |
add operator
[in,out] | op | : operator to add. op points to null at the output |
References SM_System::mOperators.
Referenced by SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), SM_Run::loadOperatorsFromOptions(), and SM_Test::testOperators().
|
inlineprotectedinherited |
compute the magnetic field at time step index t by calling the virtual method SM_Operator::computeMagneticField()
[in] | t | index of the time step |
[in] | network | : network of the field |
[in] | mu | magnetic moments of size nParticles x dim |
[out] | B | magnetic field of size nParticles x dim |
References SM_Network::getDimension(), SM_Network::getParticlesNumber(), SM_System::mOperators, tIndex, and tReal.
|
inlineprotectedinherited |
compute the magnetic field by calling the virtual method SM_Operator::computeMagneticField()
[in] | t | index of the time step |
[in] | network | : network of the field |
[in] | mu | magnetic moments of size nParticles x dim |
[out] | B | magnetic field of size nParticles x dim |
[out] | Es | Energies of size nOpertaors+1 |
References SM_Network::getDimension(), SM_Network::getParticlesNumber(), SM_System::mOperators, tIndex, and tReal.
Referenced by SM_System::makeRelaxation().
|
inlineprotectedvirtualinherited |
compute mu at time step
[in] | dt | time step |
[in] | epsilon_t | : epsilon at time t |
[in] | nParticles | number of particles |
[in] | dim | dimension of space |
[in] | mu_t | : mu at time t |
[in,out] | mu_tpdt | mu at time t+dt |
\( \mu_{t+dt}=\mu_{t+dt}+(1-K.\varepsilon_t^2.dt).\mu_t \)
Implements SM_System.
|
inlineprotectedinherited |
compute the magnetic field at time step index t by calling the templated method SM_TemplatedOperator::computeTemplatedMagneticField()
[in] | t | : index of the time step |
[in] | network | : network of the field |
[in] | mu | magnetic moments of size nParticles x dim |
[out] | B | magnetic field of size nParticles x dim |
|
inlineprotectedinherited |
compute the magnetic field at time t by calling the templated method SM_TemplatedOperator::computeTemplatedMagneticField()
[in] | t | : index of the time step |
[in] | network | : network of the field |
[in] | mu | magnetic moments of size nParticles x dim |
[out] | B | magnetic field of size nParticles x dim |
[out] | Es | Energies of operator of size nOperators+1 |
|
inline |
compute mu at time step
[in] | dt | time step |
[in] | epsilon_t | : epsilon at time t |
[in] | nParticles | number of particles |
[in] | dim | dimension of space |
[in] | mu_t | : mu at time t |
[in,out] | mu_tpdt | mu at time t+dt |
\( \mu_{t+dt}=\mu_{t+dt}+(1-K.\varepsilon_t^2.dt).\mu_t \)
References getK(), tIndex, and tReal.
|
inlineinherited |
copy the operator
[in] | system | : the operators of the system are copied. |
References SM_System::getOperators().
|
inlinestaticinherited |
disable the memory stack
Referenced by CORE_Object::EnableMemoryStack().
|
inlineoverridevirtual |
discretize the system It computes the Stratonovich constant depending on the parameters of the Landau Lifschitz function
Reimplemented from SM_TemplatedSystem< SM_StratonovichNormalizedSystem >.
References SM_TemplatedSystem< SystemImpl >::discretize(), SM_LandauLifschitzFunction::getAlpha(), SM_LandauLifschitzFunction::getBeta(), SM_System::getLandauLifschitzFunction(), mK, and tReal.
|
inlinestaticinherited |
enable the memory stack
Referenced by CORE_Object::EnableMemoryStack(), and CORE_Run::SetDebugOptions().
|
inlinestaticinherited |
enable the memory stack
[in] | isMemoryChecked | : true to verify memory allocation of CORE_Object classes |
References CORE_Object::DisableMemoryStack(), CORE_Object::EnableMemoryStack(), and CORE_Object::IsMemoryStackEnabled().
|
inlineinherited |
return the name of the class
Referenced by CORE_Object::getIdentityString(), and CORE_Test::testTypes().
|
inlineinherited |
return a const shared pointer for this
References CORE_Object::mThis.
|
inlinevirtualinherited |
return the memory size of the included associations
Reimplemented from CORE_Object.
References CORE_Object::getContentsMemorySize(), SM_Network::getContentsMemorySize(), CORE_Field< T, K, D, S, I >::getContentsMemorySize(), SM_System::mB, SM_System::mLLFunction, SM_System::mMu0, SM_System::mNetwork, SM_System::mNoiseRateFunction, SM_System::mOperators, and tMemSize.
Referenced by SM_ItoSystem::getMemorySize(), getMemorySize(), SM_StratonovichSystem::getMemorySize(), SM_System::getMemorySize(), and SM_TemplatedSystem< SystemImpl >::getMemorySize().
|
inlineinherited |
retrun the string identification of the class
References CORE_Object::getClassName(), and core_functions::pointerToString().
Referenced by CORE_Test::testArray(), CORE_Test::testField(), CORE_Test::testTypes(), CORE_Object::toString(), CORE_ClassFactory::toString(), and CORE_Field< T, K, D, S, I >::toString().
|
inlineinherited |
set the initial Magnetic Moment
References SM_System::mMu0.
Referenced by SM_Beam::discretize(), SM_DemagnetizedOperator::discretize(), and SM_System::makeRelaxation().
|
inline |
return the stratonovich constant
References mK.
Referenced by computeTemplatedMuAtNextTimeStep().
|
inlineinherited |
get the Landau Lifschitz function
References SM_System::mLLFunction.
|
inlineinherited |
get the Landau Lifschitz function return the Landau lifschitz function for reading
References SM_System::mLLFunction.
Referenced by SM_Beam::discretize(), discretize(), SM_StratonovichSystem::discretize(), SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), SM_Run::loadBeamFromOptions(), SM_System::makeRelaxation(), and SM_Test::testOperators().
|
inlineprotectedinherited |
get the magnetic field
References SM_System::mB.
|
inlinevirtual |
return the memory size of the class and the memory size of all its attributes/associations
Reimplemented from SM_TemplatedSystem< SM_StratonovichNormalizedSystem >.
References SM_System::getContentsMemorySize().
|
inlineinherited |
|
inlineinherited |
get the network
References SM_System::mNetwork.
Referenced by SM_Beam::computeL2Convergence(), SM_Beam::discretize(), SM_System::discretize(), SM_PermanentZeemanOperator::discretize(), SM_ZeemanOperator::discretize(), SM_Output::generateOutput(), SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), SM_Run::loadMagneticMomentFromOptions(), SM_System::makeRelaxation(), SM_VTK::save(), SM_Test::testEnergyOperatorsDerivatives(), and SM_Test::validate().
|
inlineinherited |
get the noise rate function
References SM_System::mNoiseRateFunction.
Referenced by SM_Beam::computeL2Convergence(), SM_System::makeRelaxation(), SM_Output::saveStochasticIndicators(), and SM_Beam::templatedSimulate().
|
inlineinherited |
get the noise rate function
References SM_System::mNoiseRateFunction.
|
inlineinherited |
get the operator with name
[in] | name | : name of the operator |
References SM_System::mOperators.
Referenced by SM_Beam::computeL2Convergence(), SM_TemplatedSystem< SystemImpl >::discretize(), and SM_Test::testEnergyOperatorsDerivatives().
|
inlineoverridevirtualinherited |
|
inlineinherited |
get the operators
References SM_System::mOperators.
Referenced by SM_System::copyOperators().
|
inlineinherited |
get the operator with name
[in] | name | : name of the operator |
References SM_System::mOperators.
Referenced by SM_Beam::discretize(), SM_System::makeRelaxation(), and SM_Output::saveStochasticIndicators().
|
inlineinherited |
retrun the pointer of the class as a string
References core_functions::pointerToString().
|
inlinestaticinherited |
get the memory stack in string
|
inlineinherited |
return the shared pointer for this
References CORE_Object::mThis.
|
inlineinherited |
|
inlineinherited |
get the time stepper
References SM_System::mTimeStepper.
Referenced by SM_Beam::computeL2Convergence(), SM_Beam::discretize(), SM_ZeemanOperator::discretize(), SM_Output::generateOutput(), SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), SM_Run::loadBeamFromOptions(), SM_System::makeRelaxation(), SM_VTK::save(), SM_Output::saveStochasticIndicators(), SM_Test::testOperators(), and SM_Test::validate().
|
inlineinherited |
test if the clas T is an instance of this class
Referenced by SM_Beam::templatedSimulate().
|
inlinestaticinherited |
return trur if the memory stack is enabled
Referenced by CORE_Object::EnableMemoryStack(), and main().
|
inherited |
compute the relaxation process by calling only virtual methods
[in] | randomFunction | random function for the stochastic simulation |
[out] | mu | mu at all time of size nParticules x dim x nTimeSteps |
[out] | Es | energies of the system for each operatr & total operator |
References ASSERT_IN, SM_LandauLifschitzFunction::computeFunction(), SM_NoiseRateFunction::computeFunction(), SM_System::computeMagneticFieldAndEnergies(), SM_System::computeMuAtNextTimeStep(), CORE_Field< T, K, D, S, I >::getDimension(), SM_Network::getDimension(), CORE_Field< T, K, D, S, I >::getElementsNumber(), SM_System::getInitialMagneticMoment(), SM_System::getLandauLifschitzFunction(), SM_TimeStepper::getMaximumTimeStepsNumber(), SM_System::getNetwork(), SM_System::getNoiseRateFunction(), SM_System::getOperatorsNumber(), SM_Network::getParticlesNumber(), SM_TimeStepper::getTimeStep(), SM_System::getTimeStepper(), SM_System::mB, SM_System::mMu0, SM_StochasticFunction::random(), tBoolean, tIndex, and tReal.
|
inherited |
compute the relaxation process by calling only templated methods
[in] | randomFunction | : the stochastic random function |
[in] | noiseRateFunction | : the noise rate function |
[out] | mu | mu at all time |
[out] | Es | energy of alloperator at all time |
|
inlineinherited |
compute the relaxation process by calling only templated methods
[in] | randomFunction | : the stochastic random function |
[out] | mu | mu at all time |
[out] | Es | energy of alloperator at all time |
|
inlinestaticinherited |
get the memory stack in string
Referenced by main().
|
inlinestatic |
build a new instance of a system
References SM_StratonovichNormalizedSystem().
Referenced by SM_ClassFactory::NewInstance().
|
inlineinherited |
set the initial Magnetic Moment by moving
[in] | mu0 | constant value of Mu at time 0 by moving |
References SM_System::mMu0, and CORE_StdPtrField< T, K, D >::normalize().
|
inlineinherited |
set the initial Magnetic Moment by moving
[in] | mu0 | constant value of Mu at time 0 by moving |
References SM_System::mMu0, and CORE_StdPtrField< T, K, D >::normalize().
Referenced by SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), SM_Run::loadMagneticMomentFromOptions(), and SM_Test::testEnergyOperatorsDerivatives().
|
inlineinherited |
set the initial Magnetic Moment by copy
[in] | N | : number of particles |
[in] | mu0 | constant value of Mu |
References CORE_StdPtrField< T, K, D >::initialize(), SM_System::mMu0, and CORE_Field< T, K, D, S, I >::setElementsNumber().
|
inlineinherited |
gst the noise rate function
[in] | f | : the noise rate function |
References SM_System::mNoiseRateFunction.
Referenced by SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), SM_Run::loadBeamFromOptions(), and SM_Test::testOperators().
|
inlineprivateinherited |
set the shared pointer from an unique pointer
[in,out] | up | unique pointer of the class at input, points to null pointer at output |
Method only calledby the friend class CORE_ClassFactory::NewSharedInstance()
References CORE_Object::mThis.
|
overridevirtualinherited |
turn the class into a string representation
Reimplemented from CORE_Object.
References SM_Network::getDimension(), CORE_Field< T, K, D, S, I >::getElementsNumber(), SM_System::mLLFunction, SM_System::mMu0, SM_System::mNetwork, SM_System::mNoiseRateFunction, SM_System::mTimeStepper, tIndex, tNaturalInteger, CORE_Object::toString(), SM_LandauLifschitzFunction::toString(), SM_Network::toString(), SM_TimeStepper::toString(), tReal, and tUInt.
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
private |
Referenced by discretize(), and getK().
|
privateinherited |
|
privateinherited |
|
privateinherited |
Referenced by SM_System::getContentsMemorySize(), SM_System::getNetwork(), and SM_System::toString().
|
privateinherited |
|
privateinherited |
Referenced by SM_System::addOperator(), SM_System::computeMagneticField(), SM_System::computeMagneticFieldAndEnergies(), SM_System::discretize(), SM_System::getContentsMemorySize(), SM_System::getOperator(), SM_System::getOperatorNames(), SM_System::getOperators(), and SM_System::getOperatorsNumber().
|
privateinherited |
Referenced by CORE_Object::getConstSharedPointer(), CORE_Object::getSharedPointer(), and CORE_Object::setThis().
|
privateinherited |
Referenced by SM_System::getTimeStepper(), and SM_System::toString().
|
privateinherited |