C++ main module for stochmagnet Package
1.0
|
This class is a simulation of a beam of trajectories class for Stoch Microm package. More...
#include <SM_Beam.h>
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... | |
void | setIsTemplatedSimulateVersion (const tBoolean &v) |
set true if the templated simulate method is called More... | |
void | setBeamSize (const tIndex &n) |
set the beam size More... | |
const tIndex & | getBeamSize () const |
get the beam size More... | |
void | setStochasticFunction (CORE_UniquePointer< SM_StochasticFunction > &f) |
set the stochastic function More... | |
const SM_StochasticFunction & | getStochasticFunction () const |
get the stochastic function More... | |
void | setSystem (CORE_UniquePointer< SM_System > &sys) |
set the system More... | |
virtual const SM_System & | getSystem () const |
return the system for reading More... | |
virtual SM_System & | getSystem () |
return the system for writing More... | |
const std::valarray< tReal > & | getMagneticMoment () const |
return the mu array More... | |
std::valarray< tReal > & | getMagneticMoment () |
return the mu array More... | |
const std::valarray< tReal > & | getEnergies () const |
return the Energy array More... | |
std::valarray< tReal > & | getEnergies () |
return the energies array More... | |
void | discretize () |
discretize the system More... | |
const std::valarray< tReal > & | getDeterministicEnergies () const |
return the deterministic energies More... | |
tIndex | runSimulations () |
run the simulations More... | |
virtual tString | toString () const override |
turn the class into a string representation More... | |
void | computeL2Convergence (std::valarray< tReal > &L2conv) const |
compute the L2 convergence for mu 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_Beam > | New () |
build a new instance of a SM_Beam 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 | |
SM_Beam (void) | |
create More... | |
virtual | ~SM_Beam (void) |
destroy More... | |
Private Member Functions | |
tIndex | simulate () |
simulate a beam by computing mu field by calling only virtual methods More... | |
tIndex | templatedSimulate () |
simulate a beam by computing mu field by calling only templated methods More... | |
template<class SystemImpl , class NoiseImpl > | |
tIndex | templatedSimulate (SystemImpl &system, const NoiseImpl &noise) |
simulate a beam by computing mu field by calling only templated methods More... | |
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 | |
tIndex | mBeamSize |
std::valarray< tReal > | mMu |
std::valarray< tReal > | mEs |
tBoolean | mIsTemplatedSimulateVersion |
CORE_UniquePointer< SM_StochasticFunction > | mStochasticFunction |
CORE_UniquePointer< SM_System > | mSystem |
CORE_UniquePointer< SM_System > | mDeterministicSystem |
std::valarray< tReal > | mDMu |
std::valarray< tReal > | mDEs |
std::weak_ptr< CORE_Object > | mThis |
This class is a simulation of a beam of trajectories class for Stoch Microm package.
The simulation of a beam follows the algorithm:
image html beamAlgorithm.png
|
inlineprotected |
create
References mBeamSize, and mIsTemplatedSimulateVersion.
Referenced by New().
|
inlineprotectedvirtual |
destroy
void SM_Beam::computeL2Convergence | ( | std::valarray< tReal > & | L2conv | ) | const |
compute the L2 convergence for mu
[out] | L2conv | : the L2 convergence of size getTimeStepsNumber(); |
References SM_NoiseRateFunction::computeFunction(), getBeamSize(), SM_ZeemanOperator::getBext(), SM_Network::getDimension(), getMagneticMoment(), SM_TimeStepper::getMaximumTimeStepsNumber(), SM_System::getNetwork(), SM_System::getNoiseRateFunction(), SM_System::getOperator(), SM_Network::getParticlesNumber(), getSystem(), SM_TimeStepper::getTimeStep(), SM_System::getTimeStepper(), tIndex, tNaturalInteger, and tReal.
|
inlinestaticinherited |
disable the memory stack
Referenced by CORE_Object::EnableMemoryStack().
|
inline |
discretize the system
References SM_Network::getDimension(), SM_System::getInitialMagneticMoment(), SM_System::getLandauLifschitzFunction(), SM_TimeStepper::getMaximumTimeStepsNumber(), SM_System::getNetwork(), SM_System::getOperatorsNumber(), SM_Network::getParticlesNumber(), getSystem(), SM_System::getTimeStepper(), mBeamSize, mDEs, mDeterministicSystem, mDMu, mEs, mMu, mSystem, SM_ConstantNoiseRateFunction::New(), SM_ItoSystem::New(), CORE_Run::Out(), CORE_Out::printError(), tIndex, and tReal.
Referenced by SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), and SM_Test::testEnergyOperatorsDerivatives().
|
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().
|
inline |
get the beam size
References mBeamSize.
Referenced by computeL2Convergence(), SM_Output::generateOutput(), SM_Output::saveStochasticIndicators(), simulate(), and templatedSimulate().
|
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.
|
inlinevirtual |
return the memory size of the included associations
Reimplemented from CORE_Object.
References CORE_Object::getContentsMemorySize(), mDEs, mDeterministicSystem, mDMu, mEs, mMu, mStochasticFunction, mSystem, tMemSize, and tReal.
Referenced by getMemorySize().
|
inline |
return the deterministic energies
References mDEs.
Referenced by SM_Output::saveStochasticIndicators().
|
inline |
|
inline |
return the Energy array
References mEs.
Referenced by SM_Output::saveStochasticIndicators(), simulate(), and templatedSimulate().
|
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().
|
inline |
|
inline |
return the mu array
References mMu.
Referenced by computeL2Convergence(), SM_VTK::save(), simulate(), templatedSimulate(), and SM_Test::validate().
|
inlinevirtual |
return the memory size of the class and the memory size of all its attributes/associations
Reimplemented from SM_Object.
References getContentsMemorySize().
|
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.
|
inline |
get the stochastic function
References mStochasticFunction.
Referenced by simulate(), and templatedSimulate().
|
inlinevirtual |
|
inlinevirtual |
return the system for reading
References mSystem.
Referenced by computeL2Convergence(), discretize(), SM_Output::generateOutput(), SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), SM_Run::loadBeamFromOptions(), SM_VTK::save(), SM_Output::saveStochasticIndicators(), templatedSimulate(), SM_Test::testEnergyOperatorsDerivatives(), SM_Test::testOperators(), and SM_Test::validate().
|
inlineinherited |
test if the clas T is an instance of this class
Referenced by templatedSimulate().
|
inlinestaticinherited |
return trur if the memory stack is enabled
Referenced by CORE_Object::EnableMemoryStack(), and main().
|
inlinestaticinherited |
get the memory stack in string
Referenced by main().
|
inlinestatic |
build a new instance of a SM_Beam
References SM_Beam().
Referenced by SM_ClassFactory::NewInstance().
|
inline |
run the simulations
References mDEs, mDeterministicSystem, mDMu, mIsTemplatedSimulateVersion, simulate(), and templatedSimulate().
Referenced by SM_Test::grid3DParticlesTestCase(), and SM_Test::linedParticlesTestCase().
|
inline |
set the beam size
[in] | n | number of trajectories to compute |
References mBeamSize.
Referenced by SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), SM_Run::loadBeamFromOptions(), and SM_Test::testOperators().
|
inline |
set true if the templated simulate method is called
[in] | v | true to call templated simulate method |
References mIsTemplatedSimulateVersion.
Referenced by SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), and SM_Run::loadBeamFromOptions().
|
inline |
set the stochastic function
[in,out] | f | stochastic funtion. Points to nothing at end |
References mStochasticFunction.
Referenced by SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), SM_Run::loadBeamFromOptions(), and SM_Test::testOperators().
|
inline |
set the system
[in,out] | sys | system to set |
References mSystem.
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.
|
private |
simulate a beam by computing mu field by calling only virtual methods
References getBeamSize(), getEnergies(), getMagneticMoment(), getStochasticFunction(), mSystem, tIndex, and tReal.
Referenced by runSimulations(), and templatedSimulate().
|
inlineprivate |
simulate a beam by computing mu field by calling only templated methods
References SM_System::getNoiseRateFunction(), getSystem(), CORE_Object::isInstanceOf(), and simulate().
Referenced by runSimulations().
|
private |
simulate a beam by computing mu field by calling only templated methods
References getBeamSize(), getEnergies(), getMagneticMoment(), getStochasticFunction(), CORE_Object::isInstanceOf(), tIndex, and tReal.
|
inlineoverridevirtual |
turn the class into a string representation
Reimplemented from CORE_Object.
References mBeamSize, mStochasticFunction, mSystem, and CORE_Object::toString().
|
private |
Referenced by discretize(), getBeamSize(), setBeamSize(), SM_Beam(), and toString().
|
private |
Referenced by discretize(), getContentsMemorySize(), getDeterministicEnergies(), and runSimulations().
|
private |
Referenced by discretize(), getContentsMemorySize(), and runSimulations().
|
private |
Referenced by discretize(), getContentsMemorySize(), and runSimulations().
|
private |
Referenced by discretize(), getContentsMemorySize(), and getEnergies().
|
private |
Referenced by runSimulations(), setIsTemplatedSimulateVersion(), and SM_Beam().
|
private |
Referenced by discretize(), getContentsMemorySize(), and getMagneticMoment().
|
private |
Referenced by getContentsMemorySize(), getStochasticFunction(), setStochasticFunction(), and toString().
|
private |
Referenced by discretize(), getContentsMemorySize(), getSystem(), setSystem(), simulate(), and toString().
|
privateinherited |
Referenced by CORE_Object::getConstSharedPointer(), CORE_Object::getSharedPointer(), and CORE_Object::setThis().