1 #ifndef SM_StochasticXDMF_H
2 #define SM_StochasticXDMF_H
5 #include "SM_StochasticOutput.h"
8 #include "SM_LandauLifschitzSystem.h"
36 std::vector<tIndex> mSimulations;
37 std::vector<tIndex>::const_iterator mISimulation;
38 tRelativeInteger mLastTimeIndexSaved;
57 mSimulations.resize(1);
59 mLastTimeIndexSaved=-1;
104 mem+=mSimulations.size()*
sizeof(tIndex);
112 inline static CORE_UniquePointer<SM_StochasticXDMF>
New() {
119 CORE_UniquePointer<SM_StochasticXDMF> p=
New();
139 mSimulations=simulationIndices;
145 mSimulations=simulationIndices;
170 std::sort(mSimulations.begin(),mSimulations.end());
171 mISimulation=mSimulations.begin();
182 while (mISimulation!=mSimulations.end()) {
183 if (s<(*mISimulation)) {
186 if (s==(*mISimulation)) {
191 "-s"+std::to_string(s)+
196 ok=ok && mVTK.
open();
197 mLastTimeIndexSaved=0;
198 mVTK.
save(system,mLastTimeIndexSaved,0.0);
199 mLastTimeIndexSaved=-1;
205 "-s"+std::to_string(s)));
206 ok=ok && mVTK.
open();
207 mLastTimeIndexSaved=0;
208 mVTK.
save(system,mLastTimeIndexSaved,0.0);
228 if (((tRelativeInteger)llSystem->
getTimeIndex())!=mLastTimeIndexSaved) {
230 mVTK.
save(*llSystem,mLastTimeIndexSaved,llSystem->
getTime());
240 inline tBoolean
close(
const tIndex& s,
const SM_System& system,
const tBoolean& hasSucceeded) {
262 const tIndex& rawValuesNumber,
263 const std::valarray<tReal>& rawValues)
override {
static tString GetAbsolutePath(const tString &path)
get the absolute path of the path
Definition: CORE_IO.h:365
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
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
This class is a simulation of one trajectory class for Stoch Magnet package.
Definition: SM_LandauLifschitzSystem.h:59
const tIndex & getTimeIndex() const
get the time index
Definition: SM_LandauLifschitzSystem.h:221
const tReal & getTime() const
get the time
Definition: SM_LandauLifschitzSystem.h:214
This class describes a materials defined by state attributes:
Definition: SM_Material.h:61
This class stores stochastic outpus computed for each trajectory of a simulation of trajectories of a...
Definition: SM_StochasticOutputComponent.h:36
const int & getRootIndex() const
get the root index of the output component
Definition: SM_StochasticOutputComponent.h:222
const tString & getPrefix() const
return the prefix
Definition: SM_StochasticOutputComponent.h:190
const int & getIndex() const
get the index of the output component
Definition: SM_StochasticOutputComponent.h:217
const tString & getOutputPath() const
return the output path
Definition: SM_StochasticOutputComponent.h:178
const int & getIndicesNumber() const
get the number of output components
Definition: SM_StochasticOutputComponent.h:227
this class implements the virtual methods of its base class SM_StochasticOutputComponent with templat...
Definition: SM_StochasticOutput.h:24
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_StochasticOutput.h:84
virtual void copy(const SM_StochasticOutputComponent &c)
copy
Definition: SM_StochasticOutput.h:94
This class stores stochastic 3D trajectory For each point of the network it stores at any time Mu(t,...
Definition: SM_StochasticXDMF.h:21
virtual void copy(const SM_StochasticOutputComponent &c) override
copy the stochastic data
Definition: SM_StochasticXDMF.h:128
tBoolean open(const tIndex &s, const SM_System &system)
open the stochastic data for simulation s
Definition: SM_StochasticXDMF.h:179
void setSimulations(std::initializer_list< tIndex > &&simulationIndices)
set the simulations index to save
Definition: SM_StochasticXDMF.h:138
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_StochasticXDMF.h:90
void setSimulations(const std::vector< tIndex > &simulationIndices)
set the simulations index to save
Definition: SM_StochasticXDMF.h:144
tBoolean close(const tIndex &s, const SM_System &system, const tBoolean &hasSucceeded)
close the stochastic data for the simulation s
Definition: SM_StochasticXDMF.h:240
virtual ~SM_StochasticXDMF(void)
destroy
Definition: SM_StochasticXDMF.h:69
tBoolean store(const SM_System &system)
store the stochastic data during the relation method of the system
Definition: SM_StochasticXDMF.h:224
static CORE_UniquePointer< SM_StochasticXDMF > New()
build a new instance of a stochastic data
Definition: SM_StochasticXDMF.h:112
tBoolean open(const SM_Beam &beam)
open the stochastic data
Definition: SM_StochasticXDMF.h:168
virtual void closePackedSimulations(const SM_Beam &beam, const tIndex &rawValuesNumber, const std::valarray< tReal > &rawValues) override
close stochastic data at the end of all packed simulations
Definition: SM_StochasticXDMF.h:261
SM_StochasticXDMF(void)
create
Definition: SM_StochasticXDMF.h:54
tBoolean close(const SM_Beam &beam)
close stochastic data at the end of all simulations
Definition: SM_StochasticXDMF.h:250
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_StochasticXDMF.h:102
static CORE_UniquePointer< SM_StochasticXDMF > New(const SM_StochasticXDMF &c)
build a new instance of a stochastic data
Definition: SM_StochasticXDMF.h:118
virtual void adimensionize(const SM_Material &material) override
adimensionize the output compoent with material characteristic
Definition: SM_StochasticXDMF.h:159
const std::vector< tIndex > & getSimulations() const
get the simulations
Definition: SM_StochasticXDMF.h:151
This class is a one simulation of a beam for Stoch Magnet package.
Definition: SM_System.h:53
void setFileName(const tString &fn)
set the file name without extension
Definition: SM_VTK.h:146
const tBoolean & isFileOpened() const
return true if the file is open
Definition: SM_VTK.h:210
tBoolean save(const SM_Network &network, const tIndex &it, const tReal &time)
save the system at time
Definition: SM_VTK.h:228
This class is a beam interface output for XMF format for paraview visualization software.
Definition: SM_XDMF.h:22
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_XDMF.h:112
tBoolean close(const tIndex &t)
close the file for the time step t
Definition: SM_XDMF.h:337
tBoolean open()
open the vtkfile
Definition: SM_XDMF.h:161