1 #ifndef SM_BeamTemperatureRange_H
2 #define SM_BeamTemperatureRange_H
5 #include "SM_BeamCycle.h"
23 std::array<tReal,3> mTemperatureRange;
81 mem+=mKFileName.length()*
sizeof(tChar);
89 static CORE_UniquePointer<SelfClass>
New() {
90 return CORE_UniquePointer<SelfClass>(
new SelfClass(),
103 const tReal *iRange=range.data();
104 for(
auto& Tk:mTemperatureRange) {
130 const tInteger& outputId,tIndex& iCycleStep) {
142 std::ofstream file(mKFileName.c_str(),std::ios::out);
144 std::cout<<
"impossible to open Temperature Range file "<<mKFileName<<
"\n";
156 if (mTemperatureRange[0]==0) {
183 std::ofstream file(mKFileName.c_str(),std::ios::app);
185 for(
const auto& r:outputs) {
186 file<<std::setprecision(12)<<r<<
"\t";
200 T+=mTemperatureRange[2];
229 std::stringstream ret;
231 ret<<
"\t Cycle temperature range:"<<functions_array::toString(mTemperatureRange)<<
"\n";
237 inline void printHeader(std::ofstream& file,
const SM_Beam& beam,
const std::vector<tString>& outputDescription)
const {
240 tString str=
"Temperature Range :"+this->
toString();
241 functions_string::replaceAll(
"\n",
"\n#",str);
242 file<<
"#"<<str<<
"\n";
245 functions_string::replaceAll(
"\n",
"\n#",str);
246 file<<
"#"<<str<<
"\n";
249 for(
const auto& d:outputDescription) file<<
"\t"<<d;
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:278
static const tString & GetSoftName()
get soft name
Definition: CORE_Run.h:115
static const tString & GetVersion()
get the version
Definition: CORE_Run.h:129
This class is an interface of Beam Cycle class for Stoch Microm package.
Definition: SM_BeamCycle.h:20
virtual tString toString() const override
return the string representation of the class
Definition: SM_BeamCycle.h:193
This class is an temperature cycle manager for running a cycle of beam class for Stoch Microm package...
Definition: SM_BeamTemperatureRange.h:14
tBoolean open(SM_Beam &beam, SM_StochasticOutputComponent &stochasticOutput, const tInteger &outputId, tIndex &iCycleStep)
init the cycle of beam run
Definition: SM_BeamTemperatureRange.h:129
static CORE_UniquePointer< SelfClass > New()
create an unique pointer to a new instance of this
Definition: SM_BeamTemperatureRange.h:89
void setTemperatureRange(const std::array< tReal, 3 > &range)
set the temperature range
Definition: SM_BeamTemperatureRange.h:102
void nextCycleStep(const tIndex &iCycleStep, SM_Beam &beam, const tInteger &outputId, const SM_StochasticOutputComponent &output)
next the cycle of beam run
Definition: SM_BeamTemperatureRange.h:171
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_BeamTemperatureRange.h:67
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_BeamTemperatureRange.h:78
virtual ~SM_BeamTemperatureRange(void)
destroy
Definition: SM_BeamTemperatureRange.h:38
virtual tString toString() const override
return the string representation of the class
Definition: SM_BeamTemperatureRange.h:228
SM_BeamTemperatureRange(void)
create
Definition: SM_BeamTemperatureRange.h:31
void setTemperaturesFileName(const tString &Kfile)
set the temperatures file
Definition: SM_BeamTemperatureRange.h:115
tBoolean isCycleFinished(const tIndex &iCycle, const SM_Beam &beam)
return true if the cycle is finished
Definition: SM_BeamTemperatureRange.h:214
tBoolean close(const tIndex &iCycle, const SM_Beam &beam)
return true if the cycle is close without error
Definition: SM_BeamTemperatureRange.h:222
This class defines a general stochastic beam of trajectories of system.
Definition: SM_Beam.h:61
const SM_System & getSystem() const
get the system
Definition: SM_Beam.h:264
virtual tString toString() const override
turn the class into a string representation
Definition: SM_Beam.h:315
const tIndex & getBeamSize() const
get the beam size
Definition: SM_Beam.h:166
void setBeamSize(const tIndex &n)
set the beam size
Definition: SM_Beam.h:149
static constexpr tDimension DIM
space dimension
Definition: SM_Constants.h:80
This class stores stochastic outpus computed for each trajectory of a simulation of trajectories of a...
Definition: SM_StochasticOutputComponent.h:36
const std::vector< tString > & getOutputDescription() const
get the string representation of the output values
Definition: SM_StochasticOutputComponent.h:316
const std::valarray< tReal > & getOutputValues() const
get the output values of the stochastic output for reading
Definition: SM_StochasticOutputComponent.h:330
This class is a one simulation of a beam for Stoch Magnet package.
Definition: SM_System.h:53
const SM_RealField & getMagneticMomentDirections() const
get the unit direction of spins at time
Definition: SM_System.h:267
const tReal & getNoiseTemperature() const
get the noise temperature in Kelvin
Definition: SM_System.h:399
virtual void setNoiseTemperature(const tReal &T)
set the noise as a temperature in Kelvin
Definition: SM_System.h:392
virtual tBoolean updateInitialMagneticMomentDirections(const SM_RealField &S0)
update the initial unit direction of spins
Definition: SM_System.h:241