statXZ.cpp File Reference
#include "Chute.h"
#include "StatisticsVector.h"

Classes

class  statistics_while_running< T >
 

Functions

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

Variables

bool verbose = false
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
71 {
72  //select file name to restart from
73  std::string name;
74  if (argc > 1)
75  {
76  name = argv[1];
77  argv++;
78  argc--;
79  }
80  else exit(-1);
81  //select time interval
82  Mdouble tint = .2;
83  if (argc > 1)
84  {
85  tint = atof(argv[1]);
86  argv++;
87  argc--;
88  logger(INFO, "tint=", tint);
89  }
90  argv--;
91  argc++;
92 
93  //load restart data
94  logger(INFO, "obtaining XZ statictics\n", Flusher::NO_FLUSH);
96  logger(INFO, "loading restart data: %.restart", name);
97  problem.setName(name.c_str());
98  problem.readRestartFile();//load_restart_data();
101  problem.restartFile.setFileType(FileType::ONE_FILE); //problem.restartFile.setFileType(FileType::ONE_FILE);
102  problem.writeRestartFile();
103  problem.auto_set_domain();
104  //keep file name but create files in the local directory, i.e. remove folder
105  if (verbose)
106  {
107  logger(INFO, "old name: %", problem.getName());
108  }
109  size_t found = name.find_last_of("/\\");
110  problem.setName(name.substr(found + 1).c_str());
111  if (verbose)
112  {
113  logger(INFO, "new name: ", problem.getName());
114  }
115  //set output to minimum
120  //set statistical parameters
121  problem.setDoPeriodicWalls(false);
122  problem.setN(50);
123  problem.setCGWidth(.1);
124  problem.setSaveCount(25);
126  problem.setCGTimeMin(problem.getTime());
127  problem.setTimeMax(problem.getTime() + tint);
128  //solve and create live statistics
129  problem.readStatArguments(argc, argv);
130  problem.solve();
131 
132  //~ cout << endl << "Z averaging" << endl;
133  //~ statistics_while_running<Z> problemZ;
134  //~ problemZ.set_name(name.c_str());
135  //~ problemZ.load_restart_data();
136  //~ problemZ.setFixedParticleRadius(problemZ.getObjects()[0].Radius);
137  //~ problemZ.setInflowParticleRadius(problemZ.getObjects()[0].Radius);
138  //~ problemZ.restartFile.setFileType(FileType::ONE_FILE);
139  //~ problemZ.writeRestartFile();
140  //~ problemZ.auto_set_domain();
141  //~ //keep file name but create files in the local directory, i.e. remove folder
142  //~ cout << "old name: " << problemZ.get_name() << endl;
143  //~ stringstream ss;
144  //~ ss << name.substr(found+1).c_str() << "Z";
145  //~ problemZ.set_name(ss.str().c_str());
146  //~ cout << "new name: " << problemZ.get_name() << endl;
147  //~ //set output to minimum
148  //~ problemZ.dataFile.setFileType(FileType::NO_FILE);
149  //~ problemZ.restartFile.setFileType(FileType::ONE_FILE);
150  //~ problemZ.fStatFile.setFileType(FileType::NO_FILE);
151  //~ problemZ.eneFile.setFileType(FileType::ONE_FILE);
152  //~ //set statistical parameters
153  //~ problemZ.setDoPeriodicWalls(false);
154  //~ problemZ.setN(50);
155  //~ problemZ.setCGWidth(.1);
156  //~ problemZ.setSaveCount(25);
157  //~ problemZ.setStressTypeForFixedParticles(3);
158  //~ problemZ.setCGTimeMin(problemZ.get_t());
159  //~ problemZ.setTimeMax(problemZ.get_t()+tint);
160  //~ //solve and create live statistics
161  //~ problemZ.readStatArguments(argc, argv);
162  //~ problemZ.solve();
163 }
@ NO_FILE
file will not be created/read
@ ONE_FILE
all data will be written into/ read from a single file called name_
double Mdouble
Definition: GeneralDefine.h:34
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
void setInflowParticleRadius(Mdouble inflowParticleRadius)
Sets the radius of the inflow particles to a single one (i.e. ensures a monodisperse inflow).
Definition: Chute.cc:848
void setFixedParticleRadius(Mdouble fixedParticleRadius)
Sets the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:653
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
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
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
bool readRestartFile(ReadOptions opt=ReadOptions::ReadAll)
Reads all the particle data corresponding to a given, existing . restart file (for more details regar...
Definition: DPMBase.cc:3006
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 setN(int n)
Definition: StatisticsVector.h:179
void setStressTypeForFixedParticles(int new_)
Definition: StatisticsVector.h:414
void setCGTimeMin(Mdouble t)
Definition: StatisticsVector.h:223
void setCGWidth(Mdouble w)
Set CG variables w2 and CG_invvolume.
Definition: StatisticsVector.h:317
void setDoPeriodicWalls(bool new_)
Definition: StatisticsVector.h:563
Definition: statXY.cpp:30
void auto_set_domain()
Definition: statXY.cpp:48
std::string name
Definition: MercuryProb.h:48
bool verbose
Definition: statXZ.cpp:28

Variable Documentation

◆ verbose