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


class  statistics_while_running< T >


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 }
file will not be created/read
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...
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
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)
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Mdouble getTime() const
Returns the current simulation time.
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...
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
void solve()
The work horse of the code.
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
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