statistics_while_running_XZ.cpp File Reference
#include "scr/Chute.h"
#include "scr/StatisticsVector.h"

Classes

class  statistics_while_running< T >
 

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
67 {
68  //select file name to restart from
69  string name;
70  if (argc>1) {name=argv[1]; argv++; argc--;} else name="../ini_statistics/H10A22L1M0.5B0.5";
71  //select time interval
72  Mdouble tint=.2;
73  if (argc>1) {tint=atof(argv[1]); argv++; argc--; cout << "tint=" << tint << endl;}
74  argv--; argc++;
75  //load restart data
76  cout << "restart data: " << name << ".restart" << endl;
78  problem.setName(name.c_str());
79  problem.load_restart_data();
81  problem.writeRestartFile();
82  problem.auto_set_z();
83  //keep file name but create files in the local directory, i.e. remove folder
84  cout << "old name: " << problem.getName() << endl;
85  size_t found=name.find_last_of("/\\");
86  problem.setName(name.substr(found+1).c_str());
87  cout << "new name: " << problem.getName() << endl;
88  //set output to minimum
93  //set statistical parameters
94  problem.setDoPeriodicWalls(false);
95  //~ problem.setZMinStat(-1);
96  problem.setNX(50);
97  problem.setNZ(10);
98  problem.setCGWidth(.1);
99  problem.setSaveCount(25);
101  problem.setCGTimeMin(problem.getTime());
102  problem.setTimeMax(problem.getTime()+tint);
103  //solve and create live statistics
104  problem.readStatArguments(argc, argv);
105  problem.write(std::cout,false);
106  problem.solve();
107 }
@ NO_FILE
file will not be created/read
@ ONE_FILE
all data will be written into/ read from a single file called name_
void write(std::ostream &os, bool writeAllParticles=true) const override
This function writes the Chute properties to an ostream, and adds the properties of ALL chute particl...
Definition: Chute.cc:206
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1488
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1483
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:399
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:808
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1478
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1493
virtual void writeRestartFile()
Stores all the particle data for current save time step to a "restart" file, which is a file simply i...
Definition: DPMBase.cc:2942
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
void readStatArguments(int argc, char *argv[])
void set_infiniteStressForFixedParticles(bool new_)
Definition: StatisticsVector.h:432
void setCGTimeMin(Mdouble t)
Definition: StatisticsVector.h:223
void setNX(int new_)
Definition: StatisticsVector.h:127
void setCGWidth(Mdouble w)
Set CG variables w2 and CG_invvolume.
Definition: StatisticsVector.h:317
void setNZ(int new_)
Definition: StatisticsVector.h:159
void setDoPeriodicWalls(bool new_)
Definition: StatisticsVector.h:563
Definition: statXY.cpp:30
void auto_set_z()
Definition: obsolete_codes/statistics_while_running.cpp:112
std::string name
Definition: MercuryProb.h:48