C++ main module for stochmagnet Package
1.0
|
#include <SM_Output.h>
Public Member Functions | |
SM_Output (void) | |
create More... | |
virtual | ~SM_Output (void) |
destroy More... | |
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 | setSimulations (std::initializer_list< tIndex > &&simulationIndices) |
set the simulations index to save More... | |
void | setSimulations (const std::vector< tIndex > &simulationIndices) |
set the simulations index to save More... | |
void | setOutputPath (const tString &path) |
set the output path More... | |
void | setPrefix (const tString &prefix) |
set the prefix of generated files More... | |
tBoolean | generateOutput (SM_Beam &beam) const |
save the file for animations More... | |
tBoolean | saveStochasticIndicators (const SM_Beam &beam) const |
save the stochastic output from beam 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... | |
virtual tString | toString () const |
return the string representation of the object node More... | |
Static Public Member Functions | |
static CORE_UniquePointer< SM_Output > | New () |
build a new instance of the class More... | |
static tBoolean | SaveMagneticMomentField (const tString &fileName, const tReal &dt, const tInteger &nTimeSteps, const tIndex &nParticles, const tDimension &dim, const tReal *mu_s) |
save the particles coordinate from field mu at simulation More... | |
static tBoolean | LoadMagneticMomentField (const tString &fileName, tReal &dt, tInteger &nTimeSteps, SM_RealField &mu_s) |
save the particles coordinate from field mu at simulation 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... | |
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 | |
std::vector< tIndex > | mSimulations |
tString | mOutputPath |
tString | mPrefix |
std::weak_ptr< CORE_Object > | mThis |
SM_Output::SM_Output | ( | void | ) |
create
References mOutputPath, mPrefix, and mSimulations.
Referenced by New().
|
virtual |
destroy
|
inlinestaticinherited |
disable the memory stack
Referenced by CORE_Object::EnableMemoryStack().
|
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().
save the file for animations
[in] | beam | the beam to print the results |
References SM_Beam::getBeamSize(), SM_Network::getDimension(), SM_TimeStepper::getMaximumTimeStepsNumber(), SM_System::getNetwork(), SM_System::getOperatorNames(), SM_Network::getParticlesNumber(), SM_Beam::getSystem(), SM_TimeStepper::getTimeStep(), SM_System::getTimeStepper(), mSimulations, SM_XDMF::New(), tBoolean, tIndex, tNaturalInteger, tReal, and tString.
Referenced by SM_Run::generateOutput(), SM_Test::grid3DParticlesTestCase(), and SM_Test::linedParticlesTestCase().
|
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(), mOutputPath, mPrefix, mSimulations, tIndex, and tMemSize.
Referenced by 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().
|
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.
|
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().
|
static |
save the particles coordinate from field mu at simulation
[in] | fileName | name of the simulation |
[out] | dt | : time step |
[out] | nTimeSteps | : number of time steps |
[out] | mu_s | : magnetic moment field at simulation s of size (nTimeSteps+1) x nParticles and dimension dim |
Load a file of type
nTimesSteps nParticles dim ti P0.0 P0.1..P0.{dim-1} P1.0...... Pi.0 Pi.1...Pi.{dim-1}.... Pp.0 Pp.1...Pp.{dim-1} :
References CORE_Field< T, K, D, S, I >::getSize(), CORE_Field< T, K, D, S, I >::getValues(), core_functions::max(), CORE_Field< T, K, D, S, I >::setElementsNumber(), tIndex, tInt, tReal, and tString.
Referenced by SM_Test::validate().
|
inlinestaticinherited |
get the memory stack in string
Referenced by main().
|
inlinestatic |
build a new instance of the class
References SM_Output().
|
static |
save the particles coordinate from field mu at simulation
[in] | fileName | name of the simulation |
[in] | dt | : time step |
[in] | nTimeSteps | : number of time steps |
[in] | nParticles | number of particles |
[in] | dim | : dimension of the field |
[in] | mu_s | : magnetic moment at simlation s of size (nTimeSteps+1) x nParticles x dim |
Generates a file of type
nTimesSteps nParticles dim ti P0.0 P0.1..P0.{dim-1} P1.0...... Pi.0 Pi.1...Pi.{dim-1}.... Pp.0 Pp.1...Pp.{dim-1} :
References tBoolean, tIndex, tInteger, and tReal.
Referenced by SM_Test::validate().
save the stochastic output from beam
[in] | beam | the simulated beam |
References SM_NoiseRateFunction::computeFunction(), SM_Beam::getBeamSize(), SM_Beam::getDeterministicEnergies(), SM_Beam::getEnergies(), SM_TimeStepper::getMaximumTimeStepsNumber(), SM_System::getNoiseRateFunction(), SM_System::getOperatorsNumber(), SM_Beam::getSystem(), SM_TimeStepper::getTimeStep(), SM_System::getTimeStepper(), mOutputPath, mPrefix, tBoolean, tIndex, tNaturalInteger, tReal, and tString.
|
inline |
set the output path
[in] | path | : output path to generate the files |
References mOutputPath.
Referenced by SM_Run::generateOutput(), SM_Test::grid3DParticlesTestCase(), and SM_Test::linedParticlesTestCase().
|
inline |
set the prefix of generated files
[in] | prefix | : prefix of the generated files |
References mPrefix.
Referenced by SM_Run::generateOutput(), SM_Test::grid3DParticlesTestCase(), and SM_Test::linedParticlesTestCase().
|
inline |
set the simulations index to save
[in] | simulationIndices | : simulation index to save |
References mSimulations.
|
inline |
set the simulations index to save
[in] | simulationIndices | : simulation index to save |
References mSimulations.
Referenced by SM_Run::generateOutput(), SM_Test::grid3DParticlesTestCase(), and SM_Test::linedParticlesTestCase().
|
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.
|
inlinevirtualinherited |
return the string representation of the object node
Reimplemented in SM_TimeStepper, SM_System, SM_StochasticFunction, SM_Network, SM_LandauLifschitzFunction, SM_Beam, CORE_Field< T, K, D, S, I >, CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >, CORE_Field< T, K, D, CORE_StdValArray< T >, CORE_StdValField< T, K, D > >, CORE_Collection< T, I >, CORE_ClassFactory, and SM_NoiseRateFunction.
References CORE_Object::getIdentityString().
Referenced by SM_Run::run(), CORE_Collection< T, I >::toString(), SM_Beam::toString(), SM_Network::toString(), SM_StochasticFunction::toString(), SM_System::toString(), and SM_TimeStepper::toString().
|
private |
Referenced by getContentsMemorySize(), saveStochasticIndicators(), setOutputPath(), and SM_Output().
|
private |
Referenced by getContentsMemorySize(), saveStochasticIndicators(), setPrefix(), and SM_Output().
|
private |
Referenced by generateOutput(), getContentsMemorySize(), setSimulations(), and SM_Output().
|
privateinherited |
Referenced by CORE_Object::getConstSharedPointer(), CORE_Object::getSharedPointer(), and CORE_Object::setThis().