1 #ifndef SM_BeamRandomJRange_H
2 #define SM_BeamRandomJRange_H
5 #include "SM_BeamCycle.h"
24 std::array<tReal,3> mRandomJRange;
83 mem+=mJFileName.length()*
sizeof(tChar);
91 static CORE_UniquePointer<SelfClass>
New() {
92 return CORE_UniquePointer<SelfClass>(
new SelfClass(),
105 const tReal *iRange=range.data();
106 for(
auto& Tk:mRandomJRange) {
132 const tInteger& outputId,tIndex& iCycleStep) {
144 std::ofstream file(mJFileName.c_str(),std::ios::out);
146 std::cout<<
"impossible to open J Range file "<<mJFileName<<
"\n";
158 if (mRandomJRange[0]==0) {
184 std::ofstream file(mJFileName.c_str(),std::ios::app);
186 for(
const auto& r:outputs) {
201 eps+=mRandomJRange[2];
227 std::stringstream ret;
229 ret<<
"\t Cycle temperature range:"<<functions_array::toString(mRandomJRange)<<
"\n";
238 inline void printHeader(std::ofstream& file,
const SM_Beam& beam,
const std::vector<tString>& outputDescription)
const {
241 tString str=
"J stochastic Range :"+this->
toString();
242 functions_string::replaceAll(
"\n",
"\n#",str);
243 file<<
"#"<<str<<
"\n";
246 functions_string::replaceAll(
"\n",
"\n#",str);
247 file<<
"#"<<str<<
"\n";
250 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_BeamRandomJRange.h:14
void setStochasticRange(const std::array< tReal, 3 > &range)
set the temperature range
Definition: SM_BeamRandomJRange.h:104
void nextCycleStep(const tIndex &iCycleStep, SM_Beam &beam, const tInteger &outputId, const SM_StochasticOutputComponent &output)
next the cycle of beam run
Definition: SM_BeamRandomJRange.h:173
virtual ~SM_BeamRandomJRange(void)
destroy
Definition: SM_BeamRandomJRange.h:40
tBoolean close(const tIndex &iCycle, const SM_Beam &beam)
return true if the cycle is close without error
Definition: SM_BeamRandomJRange.h:220
SM_BeamRandomJRange(void)
create
Definition: SM_BeamRandomJRange.h:33
void setJFileName(const tString &Jfile)
set the J file
Definition: SM_BeamRandomJRange.h:117
virtual tString toString() const override
return the string representation of the class
Definition: SM_BeamRandomJRange.h:226
tBoolean isCycleFinished(const tIndex &iCycle, const SM_Beam &beam)
return true if the cycle is finished
Definition: SM_BeamRandomJRange.h:212
static CORE_UniquePointer< SelfClass > New()
create an unique pointer to a new instance of this
Definition: SM_BeamRandomJRange.h:91
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_BeamRandomJRange.h:69
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_BeamRandomJRange.h:80
tBoolean open(SM_Beam &beam, SM_StochasticOutputComponent &stochasticOutput, const tInteger &outputId, tIndex &iCycleStep)
init the cycle of beam run
Definition: SM_BeamRandomJRange.h:131
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
virtual void setStochasticNoise(const tReal &eps)
set the stochastic noise without dimension
Definition: SM_System.h:379
const tReal & getStochasticNoise() const
get the stochastic noise without dimension
Definition: SM_System.h:385