MercuryCG.cpp File Reference

Functions

template<template< class, template< class > class, class > class CGType, template< class > class BaseFunction, class Fields >
void addObject (CGHandler &cg, std::string coordinate)
 
template<template< class > class BaseFunction, class Fields >
void addObject (CGHandler &cg, std::string typeOrig, std::string coordinate)
 
template<class Fields >
void addObject (CGHandler &cg, std::string type, std::string coordinate, std::string function)
 
BaseCGaddObject (CGHandler &cg, std::string type, std::string coordinate, std::string function, std::string fieldsOrig)
 
void commandLineCG (Mercury3D &dpm, int argc, char **argv)
 
int main (int argc, char *argv[])
 MercuryCG is the postprocessing tool for extracting coarse-grained fields from particle data. See MercuryCG: Post-processing discrete particle data using the coarse-graining formulation (in development) for details. More...
 

Function Documentation

◆ addObject() [1/4]

template<template< class, template< class > class, class > class CGType, template< class > class BaseFunction, class Fields >
void addObject ( CGHandler cg,
std::string  coordinate 
)
22  {
23  if (coordinate == "O") {
24  cg.copyAndAddObject(CGType<CGCoordinates::O, BaseFunction, Fields>());
25  } else if (coordinate == "X") {
26  cg.copyAndAddObject(CGType<CGCoordinates::X, BaseFunction, Fields>());
27  } else if (coordinate == "Y") {
28  cg.copyAndAddObject(CGType<CGCoordinates::Y, BaseFunction, Fields>());
29  } else if (coordinate == "Z") {
30  cg.copyAndAddObject(CGType<CGCoordinates::Z, BaseFunction, Fields>());
31  } else if (coordinate == "XY") {
32  cg.copyAndAddObject(CGType<CGCoordinates::XY, BaseFunction, Fields>());
33  } else if (coordinate == "XZ") {
34  cg.copyAndAddObject(CGType<CGCoordinates::XZ, BaseFunction, Fields>());
35  } else if (coordinate == "YZ") {
36  cg.copyAndAddObject(CGType<CGCoordinates::YZ, BaseFunction, Fields>());
37  } else if (coordinate == "XYZ") {
38  cg.copyAndAddObject(CGType<CGCoordinates::XYZ, BaseFunction, Fields>());
39  } else {
40  logger(ERROR, "CGCoordinate % not understood; options are O,X,Y,Z,XY,XZ,YZ,XYZ", coordinate);
41  }
42 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:32
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:360

References ERROR, and logger.

Referenced by commandLineCG(), BaseHandler< T >::copyAndAddObject(), BaseHandler< T >::copyContentsFromOtherHandler(), and RotatingDrum::setupInitialConditions().

◆ addObject() [2/4]

template<class Fields >
void addObject ( CGHandler cg,
std::string  type,
std::string  coordinate,
std::string  function 
)
60  {
61  if (function == "Gauss") {
62  addObject<CGFunctions::Gauss, Fields>(cg, type, coordinate);
63  } else if (function == "Lucy") {
64  addObject<CGFunctions::Lucy, Fields>(cg, type, coordinate);
65  } else if (function == "Linear") {
66  addObject<CGFunctions::Linear, Fields>(cg, type, coordinate);
67  } else if (function == "Heaviside") {
68  addObject<CGFunctions::Heaviside, Fields>(cg, type, coordinate);
69  } else if (function == "ExactOverlap") {
70  addObject<CGFunctions::ExactOverlap, Fields>(cg, type, coordinate);
71  } else {
72  logger(ERROR, "CGFunction % not understood; options are Gauss, Lucy, Linear, Heaviside, ExactOverlap", function);
73  }
74 }
type
Definition: compute_granudrum_aor.py:141

References ERROR, logger, and compute_granudrum_aor::type.

◆ addObject() [3/4]

BaseCG* addObject ( CGHandler cg,
std::string  type,
std::string  coordinate,
std::string  function,
std::string  fieldsOrig 
)

Creates a CG-object with the template parameters and parent class specified by string arguments. The object is added to the cgHandler and a BaseCG pointer to it is returned. To obtain the right template parameters from the string arguments, a cascade of 4 functions is used (see above). Each function expresses one of the strings to a tempate parameter.

82  {
83  //change strings to lower case
84  std::string fields = fieldsOrig;
85  std::transform(fields.begin(), fields.end(), fields.begin(), ::tolower);
86  if (fields == "standardfields" || fields == "standard") {
87  addObject<CGFields::StandardFields>(cg, type, coordinate, function);
88  } else if (fields == "gradvelocityfield" || fields == "gradvelocity") {
89  addObject<CGFields::GradVelocityField>(cg, type, coordinate, function);
90  } else if (fields == "liquidmigrationfields" || fields == "liquidmigration") {
91  addObject<CGFields::LiquidMigrationFields>(cg, type, coordinate, function);
92  } else if (fields == "standardfieldsbinning" || fields == "standardbinning") {
93  addObject<CGFields::StandardFieldsBinning>(cg, type, coordinate, function);
94  } else if (fields == "displacement" || fields == "displacementfields") {
95  addObject<CGFields::DisplacementField>(cg, type, coordinate, function);
96  } else {
97  logger(ERROR, "CGFields % not understood; options are standard, gradVelocity, liquidMigration, standardBinning ", fieldsOrig);
98  }
99  return cg.getLastObject();
100 }
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:642
EIGEN_DONT_INLINE void transform(const Transformation &t, Data &data)
Definition: geometry.cpp:25
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References ERROR, BaseHandler< T >::getLastObject(), logger, oomph::Global_string_for_annotation::string(), transform(), and compute_granudrum_aor::type.

◆ addObject() [4/4]

template<template< class > class BaseFunction, class Fields >
void addObject ( CGHandler cg,
std::string  typeOrig,
std::string  coordinate 
)
45  {
46  std::string type = typeOrig;
47  std::transform(type.begin(), type.end(), type.begin(), ::tolower);
48  if (type == "cg") {
49  addObject<CG, BaseFunction, Fields>(cg, coordinate);
50  } else if (type == "timesmoothedcg") {
51  addObject<TimeSmoothedCG, BaseFunction, Fields>(cg, coordinate);
52  } else if (type == "timeaveragedcg") {
53  addObject<TimeAveragedCG, BaseFunction, Fields>(cg, coordinate);
54  } else {
55  logger(ERROR, "CGType % not understood; options are CG, TimeSmoothedCG, TimeAveragedCG", typeOrig);
56  }
57 }

References ERROR, logger, oomph::Global_string_for_annotation::string(), transform(), and compute_granudrum_aor::type.

◆ commandLineCG()

void commandLineCG ( Mercury3D dpm,
int  argc,
char **  argv 
)

Creates an object in the cgHandler of the dpm class that satisfies the options specified by the command line arguments.

First, it checks if -help was specified. In this case, the help file is displayed, and the program exits.

Second, the correct type of CG object is determined, based on the following command line arguments: name, -coordinate, -function, -fields, -timeaverage, -timesmooth

Third, all other command line arguments are read and passed into the CG object.

113 {
114  //change options to lower case
115  for (unsigned i = 2; i < argc; i++) {
116  if (argv[i][0] == '-')
117  for (unsigned j = 1; j < strlen(argv[i]); ++j) {
118  argv[i][j] = tolower(argv[i][j]);
119  }
120  }
121 
122  //checks if if -help option was requested
123  for (unsigned i = 1; i < argc; i++)
124  if (!strcmp(argv[i], "-help")) {
125  helpers::more(std::string(argv[0]) + ".txt");
126  exit(-1);
127  }
128 
129  //coordinate
130  //Stores the CGCoordinate type.
131  //This variable is a template parameter of CG and needs to be specified by the argument -stattype
132  //If unspecified, it is set to default value O.
133  std::string coordinate = "O";
134  for (unsigned i = 1; i < argc; i++)
135  if (!strcmp(argv[i], "-coordinates") || !strcmp(argv[i], "-stattype")) {
136  coordinate = argv[i + 1];
137  logger(INFO, "Set CGCoordinates to %", coordinate);
138  }
139 
140  //function
141  //Stores the CGFunction type.
142  //This variable is a template parameter of CG and needs to be specified by the argument -cgtype
143  //If unspecified, it is set to default value Lucy.
144  std::string function = "Lucy";
145  for (unsigned i = 1; i < argc; i++)
146  if (!strcmp(argv[i], "-function") || !strcmp(argv[i], "-cgtype")) {
147  function = argv[i + 1];
148  logger(INFO, "Set CGFunction to %", function);
149  }
150 
151  //fields
152  //Stores the CGField type.
153  //This variable is a template parameter of CG and needs to be specified by the argument -function
154  //If unspecified, it is set to default value Standard.
155  std::string fields = "StandardFields";
156  for (unsigned i = 1; i < argc; i++)
157  if (!strcmp(argv[i], "-fields")) {
158  fields = argv[i + 1];
159  logger(INFO, "Set CGFields to %", fields);
160  }
161 
162  //type
163  //Determines the CG type (CG or TimeAveragedCG)
164  //It needs to be specified by the argument -timeAverage
165  //If unspecified, it is set to default value 'false'.
166  // take the 'T' off the coordinate name if time averaged
167  std::string type = "CG";
168  if (coordinate[0] == 'T') {
169  type = "TimeSmoothedCG";
170  coordinate = coordinate.substr(1);
171  }
172  for (unsigned i = 1; i < argc; i++)
173  if (!strcmp(argv[i], "-timeaverage")) {
174  type = "TimeAveragedCG";
175  logger(INFO, "Creating time-averaged CG");
176  } else if (!strcmp(argv[i], "-timeaveraging")) {
177  logger(ERROR, "% is not a valid argument; use -timeaverage instead",argv[i]);
178  }
179  for (unsigned i = 1; i < argc; i++)
180  if (!strcmp(argv[i], "-timesmooth")) {
181  type = "TimeSmoothedCG";
182  logger(INFO, "Activating time smoothing");
183  }
184 
185  //Now create the right CG object and a pointer to it
186  BaseCG *cg = addObject(dpm.cgHandler, type, coordinate, function, fields);
187 
188  //Reads the name of the file name to be restarted.
189  //This variable needs to be specified as the second argument ("./MercuryCG name ...")
190  //If unspecified, it is set to default value "Chain".
192  if (argc > 1 && argv[1][0] != '-') {
193  name = argv[1];
194  //logger(INFO, "Evaluating files %.*", name);
195  }
196  if (name.empty()) {
197  logger(ERROR, "Please enter a base name base name of the files to be analysed.\n"
198  "For more information, enter './MercuryCG -help'");
199  }
200 
201  //restarting from file
202  dpm.cgHandler.restart(name);
203 
204  //make sure no data is written; if data is written (e.g. using the -writedata option, the files will be overwritten, not appended)
205  //dpm.setFileType(FileType::NO_FILE);
206  dpm.setAppend(false);
207 
208  //set a default stat file name
209  cg->statFile.setName(dpm.getName() + ".stat");
210 
211  //set min/max, so h can be set
212  cg->setMin(dpm.getMin());
213  cg->setMax(dpm.getMax());
214 
215  // Now all other arguments are read
216  // find first argument that begins with '-'
217  unsigned i = 1;
218  while (i < argc && argv[i][0] != '-') i++;
219  //logger(INFO, "Reading argument % of %", i, argc);
220  // interpret arguments
221  for (; i < argc; i += 2) {
222  if (!strcmp(argv[i], "-w") || !strcmp(argv[i], "-width")) {
223  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
224  cg->setWidth(atof(argv[i + 1]));
225  logger(INFO, "Set cg width to %", cg->getWidth());
226  } else if (!strcmp(argv[i], "-wt") || !strcmp(argv[i], "-widthTime")) {
227  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
228  cg->setWidthTime(atof(argv[i + 1]));
229  logger(INFO, "Set cg time width to %", cg->getWidthTime());
230  } else if (!strcmp(argv[i], "-dt") || !strcmp(argv[i], "-timeStep")) {
231  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
232  cg->setTimeStep(atof(argv[i + 1]));
233  logger(INFO, "Set timestep to %", cg->getTimeStep());
234  } else if (!strcmp(argv[i], "-std")) {
235  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
236  cg->setStandardDeviation(atof(argv[i + 1]));
237  logger(INFO, "Set cg width to % (std %)", cg->getWidth(),atof(argv[i + 1]));
238  } else if (!strcmp(argv[i], "-eps")) {
239  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
240  cg->setEps(atof(argv[i + 1]));
241  logger(INFO, "Set eps to %", cg->getEps());
242  } else if (!strcmp(argv[i], "-verbose")) {
243  cg->setVerbose(true);
244  logger(INFO, "Verbose output");
245  ++i;
246  } else if (!strcmp(argv[i], "-averagebeyonddomain")) {
247  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
248  cg->setAverageBeyondDomain(atoi(argv[i + 1]));
249  logger(INFO, "Set averageBeyondDomain to %", argv[i + 1]);
250  } else if (!strcmp(argv[i], "-n")) {
251  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
252  cg->setN(atoi(argv[i + 1]));
253  logger(INFO, "Set n to %", argv[i + 1]);
254  } else if (!strcmp(argv[i], "-nx")) {
255  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
256  cg->setNX(atoi(argv[i + 1]));
257  logger(INFO, "Set nx to %", argv[i + 1]);
258  } else if (!strcmp(argv[i], "-ny")) {
259  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
260  cg->setNY(atoi(argv[i + 1]));
261  logger(INFO, "Set ny to %", argv[i + 1]);
262  } else if (!strcmp(argv[i], "-nz")) {
263  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
264  cg->setNZ(atoi(argv[i + 1]));
265  logger(INFO, "Set nz to %", argv[i + 1]);
266  } else if (!strcmp(argv[i], "-h")) {
267  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
268  cg->setH(atof(argv[i + 1]));
269  logger(INFO, "Set n to %x%x% for h=%", cg->getNX(), cg->getNY(), cg->getNZ(), argv[i + 1]);
270  } else if (!strcmp(argv[i], "-hx")) {
271  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
272  cg->setHX(atof(argv[i + 1]));
273  logger(INFO, "Set nx to % to satisfy hx=%", cg->getNX(), argv[i + 1]);
274  } else if (!strcmp(argv[i], "-hy")) {
275  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
276  cg->setHY(atof(argv[i + 1]));
277  logger(INFO, "Set ny to % to satisfy hy=%", cg->getNY(), argv[i + 1]);
278  } else if (!strcmp(argv[i], "-hz")) {
279  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
280  cg->setHZ(atof(argv[i + 1]));
281  logger(INFO, "Set nz to % to satisfy hz=%", cg->getNZ(), argv[i + 1]);
282  } else if (!strcmp(argv[i], "-x")) {
283  logger.assert_debug(i+2<argc,"% requires two arguments",argv[i]);
284  cg->setX(atof(argv[i + 1]), atof(argv[i + 2]));
285  logger(INFO, "Set x to (%,%)", argv[i + 1], argv[i + 2]);
286  ++i;
287  } else if (!strcmp(argv[i], "-y")) {
288  logger.assert_debug(i+2<argc,"% requires two arguments",argv[i]);
289  cg->setY(atof(argv[i + 1]), atof(argv[i + 2]));
290  logger(INFO, "Set y to (%,%)", argv[i + 1], argv[i + 2]);
291  ++i;
292  } else if (!strcmp(argv[i], "-z")) {
293  logger.assert_debug(i+2<argc,"% requires two arguments",argv[i]);
294  cg->setZ(atof(argv[i + 1]), atof(argv[i + 2]));
295  logger(INFO, "Set z to (%,%)", argv[i + 1], argv[i + 2]);
296  ++i;
297  } else if (!strcmp(argv[i], "-t")) {
298  logger.assert_debug(i+2<argc,"% requires two arguments",argv[i]);
299  cg->setTimeMin(atof(argv[i + 1]));
300  cg->setTimeMax(atof(argv[i + 2]));
301  logger(INFO, "Set t to (%,%)", argv[i + 1], argv[i + 2]);
302  i++;
303  } else if (!strcmp(argv[i], "-savecount")) {
304  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
305  cg->statFile.setSaveCount(atof(argv[i + 1]));
306  logger(INFO, "Set savecount to %", argv[i + 1]);
307  } else if (!strcmp(argv[i], "-writedata")) {
309  logger(INFO, "Turn on data file output. Execute %.xballs to visualise output", dpm.getName());
310  --i;
311  } else if (!strcmp(argv[i], "-tmin")) {
312  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
313  cg->setTimeMin(atof(argv[i + 1]));
314  logger(INFO, "Set tMin to %", argv[i + 1]);
315  } else if (!strcmp(argv[i], "-timemin")) {
316  logger(ERROR, "% is not a valid argument; use -tMin instead",argv[i]);
317  } else if (!strcmp(argv[i], "-tmax")) {
318  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
319  cg->setTimeMax(atof(argv[i + 1]));
320  logger(INFO, "Set tMax to %", argv[i + 1]);
321  } else if (!strcmp(argv[i], "-dt")) {
322  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
323  dpm.setTimeMax(dpm.getTime()+atof(argv[i + 1]));
324  logger(INFO, "Set evaluation time interval to %", argv[i + 1]);
325  } else if (!strcmp(argv[i], "-initialfilecounter")) {
326  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
327  dpm.cgHandler.setInitialFileCounter(atoi(argv[i+1]));
328  logger(INFO, "Initial file counter set to %", argv[i + 1]);
329  } else if (!strcmp(argv[i], "-timemax")) {
330  logger(ERROR, "% is not a valid argument; use -tMax instead",argv[i]);
331  } else if (!strcmp(argv[i], "-species")) {
332  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
333  cg->selectSpecies(atoi(argv[i + 1]));
334  logger(INFO, "Evaluating species #%", atoi(argv[i + 1]));
335  } else if (!strcmp(argv[i], "-o")) {
336  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
337  cg->statFile.setName(argv[i + 1]);
338  logger(INFO, "Set output file name to %", argv[i + 1]);
339  } else if (!strcmp(argv[i], "-coordinates") || !strcmp(argv[i], "-stattype") || !strcmp(argv[i], "-cgtype") || !strcmp(argv[i], "-function") || !strcmp(argv[i], "-fields") || !strcmp(argv[i], "-restartandanalyse")) {
340  //these are commands with one argument that should be ignored here because they are read somewhere else
341  } else if (!strcmp(argv[i], "-help") || !strcmp(argv[i], "-readfromrestart") || !strcmp(argv[i], "-timeaverage") || !strcmp(argv[i], "-timesmooth")) {
342  //these are commands with no argument that should be ignored here because they are read somewhere else
343  --i;
344  } else if (!strcmp(argv[i], "-timeaveragereset")) {
345  //these are commands with no argument that should be ignored here because they are read somewhere else
346  logger(WARN, "This fstatistics command has no equivalent yet in MercuryCG and will be ignored: %", argv[i]);
347  } else {
348  logger(ERROR, "Could not read argument %", argv[i]);
349  }
350  }
351 
352  if (!std::isnormal(cg->getEps()))
353  {
354  cg->setEps(cg->getWidth()*0.1);
355  logger(VERBOSE, "Set eps to default value % (0.1*width)", cg->getEps());
356  }
357 
358  logger(INFO, "Created object of type %", cg->getName());
359 
361 
362  //Determine what kind of input to read from (data files, restart files, or live cg)
363  //Variable that stores the type of data source
364  enum class DataSource {
365  readFromData,
366  readFromRestart,
367  restartAndAnalyse
368  } dataSource = DataSource::readFromData;
369  //read command line arguments to determine dataSource
370  for (unsigned i = 1; i < argc; i++) {
371  if (!strcmp(argv[i], "-readfromrestart")) {
372  dataSource = DataSource::readFromRestart;
373  } else if (!strcmp(argv[i], "-restartandanalyse")) {
374  dataSource = DataSource::restartAndAnalyse;
375  dpm.setTimeMax(dpm.getTime()+atof(argv[i+1]));
376  }
377  }
378  //Evaluate based on dataSource
379  if (dataSource == DataSource::readFromData) {
380  logger(INFO, "Reading from data files.");
381  if (!dpm.cgHandler.evaluateDataFiles()) {
382  logger(ERROR,"Evaluation of data files has failed. Check input files.");
383  }
384  } else if (dataSource == DataSource::readFromRestart){
385  logger(INFO, "Reading from restart files.");
388  logger(ERROR,"Evaluation of restart files requires multiple restart files. Check input.");
389  }
391  } else {
392  logger(INFO,"Restarting simulation for live analysis");
393  //dpm.write(std::cout,false);
394  //dpm.setSaveCount(25);
395  dpm.solve();
396  }
397  logger(INFO, "\n"
398  "MercuryCG has finished.\n"
399  "Coarse-grained output is written to %\n"
400  "To load output into Matlab, use data=readMercuryCG('%')",
402 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
@ MULTIPLE_FILES
each time-step will be written into/read from separate files numbered consecutively: name_....
@ MULTIPLE_FILES_PADDED
each time-step will be written into/read from separate files numbered consecutively,...
@ ONE_FILE
all data will be written into/ read from a single file called name_
LL< Log::VERBOSE > VERBOSE
Verbose information.
Definition: Logger.cc:36
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:33
void addObject(CGHandler &cg, std::string coordinate)
Definition: MercuryCG.cpp:22
Base class of all CG objects, needed to store the various CG objects in the CGHandler.
Definition: BaseCG.h:36
virtual Mdouble getWidth() const =0
Returns width_, the coarse-graining width.
void setHX(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX,...
Definition: BaseCG.cc:229
void setNY(std::size_t nY)
Sets nY_, the number of spatial mesh points in the y-direction.
Definition: BaseCG.cc:91
void setMax(Vec3D max)
Sets max_, the upper limit of the spatial domain.
Definition: BaseCG.cc:150
void setVerbose(const bool verbose)
Definition: BaseCG.h:258
void setZ(Mdouble min, Mdouble max)
Sets min_.Z, max_.Z, the limits of the spatial domain in Z.
Definition: BaseCG.cc:177
File statFile
File class to handle the output into a .stat file.
Definition: BaseCG.h:363
void setNX(std::size_t nX)
Sets nX_, the number of spatial mesh points in the x-direction.
Definition: BaseCG.cc:101
std::size_t getNY() const
Returns nY_, the number of spatial mesh points in the y-direction.
Definition: BaseCG.cc:96
Mdouble getEps() const
Definition: BaseCG.cc:76
void setHY(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX,...
Definition: BaseCG.cc:238
virtual void setWidth(Mdouble width)=0
Sets width_, the coarse-graining width.
virtual Mdouble getTimeStep() const
Definition: BaseCG.cc:272
virtual void setWidthTime(Mdouble widthTime)
Definition: BaseCG.cc:256
void setTimeMin(Mdouble timeMin)
Sets timeMin_, the lower limit of the temporal domain.
Definition: BaseCG.cc:125
void setX(Mdouble min, Mdouble max)
Sets min_.X, max_.X, the limits of the spatial domain in X.
Definition: BaseCG.cc:165
void setH(Mdouble h)
Sets nX_, nY_, nZ_, the number of spatial mesh points in each cartesian direction....
Definition: BaseCG.cc:221
void setAverageBeyondDomain(const bool val)
Definition: BaseCG.h:254
void setEps(Mdouble eps)
Definition: BaseCG.cc:71
void setMin(Vec3D min)
Sets max_, the lower limit of the spatial domain.
Definition: BaseCG.cc:145
void selectSpecies(unsigned speciesIndex)
Definition: BaseCG.cc:208
void setNZ(std::size_t nZ)
Sets nZ_, the number of spatial mesh points in the z-direction.
Definition: BaseCG.cc:81
std::size_t getNZ() const
Returns nZ_, the number of spatial mesh points in the z-direction.
Definition: BaseCG.cc:86
void setTimeMax(Mdouble timeMax)
Sets timeMax_, the upper limit of the temporal domain.
Definition: BaseCG.cc:130
void setN(std::size_t n)
Sets nX_, nY_, nZ_, the number of spatial mesh points in each cartesian direction.
Definition: BaseCG.cc:111
std::size_t getNX() const
Returns nX_, the number of spatial mesh points in the x-direction.
Definition: BaseCG.cc:106
void setHZ(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX,...
Definition: BaseCG.cc:247
virtual Mdouble getWidthTime() const
Definition: BaseCG.cc:266
virtual void setStandardDeviation(Mdouble std)=0
virtual void setTimeStep(Mdouble timeStep)
Definition: BaseCG.cc:261
void setY(Mdouble min, Mdouble max)
Sets min_.Y, max_.Y, the limits of the spatial domain in Y.
Definition: BaseCG.cc:171
virtual std::string getName() const =0
A purely virtual function.
bool evaluateDataFiles(bool evaluateFStatFiles=true)
does the same as StatisticsVector::statistics_from_fstat_and_data: loads a restart file (if existing)...
Definition: CGHandler.cc:307
bool evaluateRestartFiles()
Definition: CGHandler.cc:232
void setInitialFileCounter(unsigned initialFileCounter)
Definition: CGHandler.h:121
void restart(std::string name)
loads restart file, before evaluateDataFiles is run
Definition: CGHandler.cc:110
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:377
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:799
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1484
Vec3D getMax() const
Returns the maximum coordinates of the problem domain.
Definition: DPMBase.h:659
CGHandler cgHandler
Object of the class cgHandler.
Definition: DPMBase.h:1479
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1499
Vec3D getMin() const
Returns the minimum coordinates of the problem domain.
Definition: DPMBase.h:653
void readSpeciesFromDataFile(bool read=true)
Definition: DPMBase.h:331
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:864
void solve()
The work horse of the code.
Definition: DPMBase.cc:4334
void setAppend(bool newAppendFlag)
Sets whether the "append" option is on or off.
Definition: DPMBase.cc:1513
const std::string & getName() const
Allows to access the file name, e.g., "problem.data".
Definition: File.cc:143
void setName(const std::string &name)
Sets the file name, e.g. "Name.data".
Definition: File.cc:176
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_.
Definition: File.cc:251
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:193
FileType getFileType() const
Gets the file type e.g. NOFILE, ONEFILE and MULTIPLE FILES. File::fileType_.
Definition: File.cc:185
#define INFO(i)
Definition: mumps_solver.h:54
void more(const std::string &filename, unsigned nLines=constants::unsignedMax)
Definition: FileIOHelpers.cc:151
string name
Definition: plotDoE.py:33
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References addObject(), DPMBase::cgHandler, DPMBase::dataFile, ERROR, CGHandler::evaluateDataFiles(), CGHandler::evaluateRestartFiles(), BaseCG::getEps(), File::getFileType(), BaseHandler< T >::getLastObject(), DPMBase::getMax(), DPMBase::getMin(), DPMBase::getName(), File::getName(), BaseObject::getName(), BaseCG::getNX(), BaseCG::getNY(), BaseCG::getNZ(), DPMBase::getTime(), BaseCG::getTimeStep(), BaseCG::getWidth(), BaseCG::getWidthTime(), i, INFO, j, logger, helpers::more(), MULTIPLE_FILES, MULTIPLE_FILES_PADDED, plotDoE::name, ONE_FILE, DPMBase::readSpeciesFromDataFile(), CGHandler::restart(), DPMBase::restartFile, BaseCG::selectSpecies(), DPMBase::setAppend(), BaseCG::setAverageBeyondDomain(), BaseCG::setEps(), File::setFileType(), BaseCG::setH(), BaseCG::setHX(), BaseCG::setHY(), BaseCG::setHZ(), CGHandler::setInitialFileCounter(), BaseCG::setMax(), BaseCG::setMin(), BaseCG::setN(), File::setName(), BaseCG::setNX(), BaseCG::setNY(), BaseCG::setNZ(), File::setSaveCount(), BaseCG::setStandardDeviation(), DPMBase::setTimeMax(), BaseCG::setTimeMax(), BaseCG::setTimeMin(), BaseCG::setTimeStep(), BaseCG::setVerbose(), BaseCG::setWidth(), BaseCG::setWidthTime(), BaseCG::setX(), BaseCG::setY(), BaseCG::setZ(), DPMBase::solve(), BaseCG::statFile, oomph::Global_string_for_annotation::string(), compute_granudrum_aor::type, VERBOSE, and WARN.

Referenced by main().

◆ main()

int main ( int argc  ,
char argv[] 
)

MercuryCG is the postprocessing tool for extracting coarse-grained fields from particle data. See MercuryCG: Post-processing discrete particle data using the coarse-graining formulation (in development) for details.

409  {
410  Mercury3D dpm;
411  commandLineCG(dpm, argc, argv);
412  return 0;
413 }
void commandLineCG(Mercury3D &dpm, int argc, char **argv)
Definition: MercuryCG.cpp:112
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:16

References commandLineCG().