statistics_while_running_XY.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[] 
)
76 {
77  //select file name to restart from
78  string name;
79  if (argc>1) {name=argv[1]; argv++; argc--;} else name="../ini_statistics/H10A22L1M0.5B0.5";
80  //select time interval
81  Mdouble tint=.2;
82  if (argc>1) {tint=atof(argv[1]); argv++; argc--; cout << "tint=" << tint << endl;}
83  argv--; argc++;
84  //load restart data
85  cout << "restart data: " << name << ".restart" << endl;
87  problem.setName(name.c_str());
88  problem.load_restart_data();
89  //problem.setRestarted(false);
91  problem.writeRestartFile();
92  //problem.auto_set_z();
93  //keep file name but create files in the local directory, i.e. remove folder
94  cout << "old name: " << problem.getName() << endl;
95  size_t found=name.find_last_of("/\\");
96  problem.setName(name.substr(found+1).c_str());
97  cout << "new name: " << problem.getName() << endl;
98  //set output to minimum
103  //set statistical parameters
104  problem.setDoPeriodicWalls(false);
105  //~ problem.setZMinStat(-1);
106  problem.setNX(50);
107  problem.setNY(10);
108  problem.setCGWidth(.1);
109  problem.setSaveCount(25);
110  //problem.set_infiniteStressForFixedParticles(true);
111  problem.setCGTimeMin(problem.getTime());
112  problem.setTimeMax(problem.getTime()+tint);
113  //solve and create live statistics
114  problem.readStatArguments(argc, argv);
115  problem.solve();
116 }
@ NO_FILE
file will not be created/read
@ ONE_FILE
all data will be written into/ read from a single file called name_
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 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 setDoPeriodicWalls(bool new_)
Definition: StatisticsVector.h:563
void setNY(int new_)
Definition: StatisticsVector.h:143
Definition: statXY.cpp:30
std::string name
Definition: MercuryProb.h:48