revision: v0.14
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 
)
40  {
41  if (coordinate == "O") {
42  cg.copyAndAddObject(CGType<CGCoordinates::O, BaseFunction, Fields>());
43  } else if (coordinate == "X") {
44  cg.copyAndAddObject(CGType<CGCoordinates::X, BaseFunction, Fields>());
45  } else if (coordinate == "Y") {
46  cg.copyAndAddObject(CGType<CGCoordinates::Y, BaseFunction, Fields>());
47  } else if (coordinate == "Z") {
48  cg.copyAndAddObject(CGType<CGCoordinates::Z, BaseFunction, Fields>());
49  } else if (coordinate == "XY") {
50  cg.copyAndAddObject(CGType<CGCoordinates::XY, BaseFunction, Fields>());
51  } else if (coordinate == "XZ") {
52  cg.copyAndAddObject(CGType<CGCoordinates::XZ, BaseFunction, Fields>());
53  } else if (coordinate == "YZ") {
54  cg.copyAndAddObject(CGType<CGCoordinates::YZ, BaseFunction, Fields>());
55  } else if (coordinate == "XYZ") {
56  cg.copyAndAddObject(CGType<CGCoordinates::XYZ, BaseFunction, Fields>());
57  } else {
58  logger(ERROR, "CGCoordinate % not understood; options are O,X,Y,Z,XY,XZ,YZ,XYZ", coordinate);
59  }
60 }

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 
)
78  {
79  if (function == "Gauss") {
80  addObject<CGFunctions::Gauss, Fields>(cg, type, coordinate);
81  } else if (function == "Lucy") {
82  addObject<CGFunctions::Lucy, Fields>(cg, type, coordinate);
83  } else if (function == "Linear") {
84  addObject<CGFunctions::Linear, Fields>(cg, type, coordinate);
85  } else if (function == "Heaviside") {
86  addObject<CGFunctions::Heaviside, Fields>(cg, type, coordinate);
87  } else {
88  logger(ERROR, "CGFunction % not understood; options are Gauss, Lucy, Linear, Heaviside", function);
89  }
90 }

References ERROR, and logger.

◆ 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.

98  {
99  //change strings to lower case
100  std::string fields = fieldsOrig;
101  std::transform(fields.begin(), fields.end(), fields.begin(), ::tolower);
102  if (fields == "standardfields" || fields == "standard") {
103  addObject<CGFields::StandardFields>(cg, type, coordinate, function);
104  } else if (fields == "gradvelocityfield" || fields == "gradvelocity") {
105  addObject<CGFields::GradVelocityField>(cg, type, coordinate, function);
106  } else if (fields == "liquidmigrationfields" || fields == "liquidmigration") {
107  addObject<CGFields::LiquidMigrationFields>(cg, type, coordinate, function);
108  } else {
109  logger(ERROR, "CGFields % not understood; options are standard, gradVelocity, liquidMigration ", fieldsOrig);
110  }
111  return cg.getLastObject();
112 }

References ERROR, BaseHandler< T >::getLastObject(), and logger.

◆ addObject() [4/4]

template<template< class > class BaseFunction, class Fields >
void addObject ( CGHandler cg,
std::string  typeOrig,
std::string  coordinate 
)
63  {
64  std::string type = typeOrig;
65  std::transform(type.begin(), type.end(), type.begin(), ::tolower);
66  if (type == "cg") {
67  addObject<CG, BaseFunction, Fields>(cg, coordinate);
68  } else if (type == "timesmoothedcg") {
69  addObject<TimeSmoothedCG, BaseFunction, Fields>(cg, coordinate);
70  } else if (type == "timeaveragedcg") {
71  addObject<TimeAveragedCG, BaseFunction, Fields>(cg, coordinate);
72  } else {
73  logger(ERROR, "CGType % not understood; options are CG, TimeSmoothedCG, TimeAveragedCG", typeOrig);
74  }
75 }

References ERROR, and logger.

◆ 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.

125 {
126  //change options to lower case
127  for (unsigned i = 2; i < argc; i++) {
128  if (argv[i][0] == '-')
129  for (unsigned j = 1; j < strlen(argv[i]); ++j) {
130  argv[i][j] = tolower(argv[i][j]);
131  }
132  }
133 
134  //checks if if -help option was requested
135  for (unsigned i = 1; i < argc; i++)
136  if (!strcmp(argv[i], "-help")) {
137  helpers::more(std::string(argv[0]) + ".txt");
138  exit(-1);
139  }
140 
141  //coordinate
142  //Stores the CGCoordinate type.
143  //This variable is a template parameter of CG and needs to be specified by the argument -stattype
144  //If unspecified, it is set to default value O.
145  std::string coordinate = "O";
146  for (unsigned i = 1; i < argc; i++)
147  if (!strcmp(argv[i], "-coordinates") || !strcmp(argv[i], "-stattype")) {
148  coordinate = argv[i + 1];
149  logger(INFO, "Set CGCoordinates to %", coordinate);
150  }
151 
152  //function
153  //Stores the CGFunction type.
154  //This variable is a template parameter of CG and needs to be specified by the argument -cgtype
155  //If unspecified, it is set to default value Lucy.
156  std::string function = "Lucy";
157  for (unsigned i = 1; i < argc; i++)
158  if (!strcmp(argv[i], "-function") || !strcmp(argv[i], "-cgtype")) {
159  function = argv[i + 1];
160  logger(INFO, "Set CGFunction to %", function);
161  }
162 
163  //fields
164  //Stores the CGField type.
165  //This variable is a template parameter of CG and needs to be specified by the argument -function
166  //If unspecified, it is set to default value Standard.
167  std::string fields = "StandardFields";
168  for (unsigned i = 1; i < argc; i++)
169  if (!strcmp(argv[i], "-fields")) {
170  fields = argv[i + 1];
171  logger(INFO, "Set CGFields to %", fields);
172  }
173 
174  //type
175  //Determines the CG type (CG or TimeAveragedCG)
176  //It needs to be specified by the argument -timeAverage
177  //If unspecified, it is set to default value 'false'.
178  // take the 'T' off the coordinate name if time averaged
179  std::string type = "CG";
180  if (coordinate[0] == 'T') {
181  type = "TimeSmoothedCG";
182  coordinate = coordinate.substr(1);
183  }
184  for (unsigned i = 1; i < argc; i++)
185  if (!strcmp(argv[i], "-timeaverage")) {
186  type = "TimeAveragedCG";
187  logger(INFO, "Creating time-averaged CG");
188  } else if (!strcmp(argv[i], "-timeaveraging")) {
189  logger(ERROR, "% is not a valid argument; use -timeaverage instead",argv[i]);
190  }
191  for (unsigned i = 1; i < argc; i++)
192  if (!strcmp(argv[i], "-timesmooth")) {
193  type = "TimeSmoothedCG";
194  logger(INFO, "Activating time smoothing");
195  }
196 
197  //Now create the right CG object and a pointer to it
198  BaseCG *cg = addObject(dpm.cgHandler, type, coordinate, function, fields);
199 
200  //Reads the name of the file name to be restarted.
201  //This variable needs to be specified as the second argument ("./MercuryCG name ...")
202  //If unspecified, it is set to default value "Chain".
203  std::string name;
204  if (argc > 1 && argv[1][0] != '-') {
205  name = argv[1];
206  //logger(INFO, "Evaluating files %.*", name);
207  }
208  if (name.empty()) {
209  logger(ERROR, "Please enter a base name base name of the files to be analysed.\n"
210  "For more information, enter './MercuryCG -help'");
211  }
212 
213  //restarting from file
214  dpm.cgHandler.restart(name);
215 
216  //make sure no data is written; if data is written (e.g. using the -writedata option, the files will be overwritten, not appended)
217  //dpm.setFileType(FileType::NO_FILE);
218  dpm.setAppend(false);
219 
220  //set a default stat file name
221  cg->statFile.setName(dpm.getName() + ".stat");
222 
223  //set min/max, so h can be set
224  cg->setMin(dpm.getMin());
225  cg->setMax(dpm.getMax());
226 
227  // Now all other arguments are read
228  // find first argument that begins with '-'
229  unsigned i = 1;
230  while (i < argc && argv[i][0] != '-') i++;
231  //logger(INFO, "Reading argument % of %", i, argc);
232  // interpret arguments
233  for (; i < argc; i += 2) {
234  if (!strcmp(argv[i], "-w") || !strcmp(argv[i], "-width")) {
235  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
236  cg->setWidth(atof(argv[i + 1]));
237  logger(INFO, "Set cg width to %", cg->getWidth());
238 // } else if (!strcmp(argv[i], "-wt") || !strcmp(argv[i], "-widthTime")) {
239 // logger.assert_always(i+1<argc,"% requires argument",argv[i]);
240 // auto cgs = dynamic_cast<TimeSmoothedCG>(cg);
241 // cgs->setWidthTime(atof(argv[i + 1]));
242 // logger(INFO, "Set cg width to %", cg->getWidth());
243  } else if (!strcmp(argv[i], "-std")) {
244  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
245  cg->setStandardDeviation(atof(argv[i + 1]));
246  logger(INFO, "Set cg width to % (std %)", cg->getWidth(),atof(argv[i + 1]));
247  } else if (!strcmp(argv[i], "-averagebeyonddomain")) {
248  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
249  cg->setAverageBeyondDomain(atoi(argv[i + 1]));
250  logger(INFO, "Set averageBeyondDomain to %", argv[i + 1]);
251  } else if (!strcmp(argv[i], "-n")) {
252  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
253  cg->setN(atoi(argv[i + 1]));
254  logger(INFO, "Set n to %", argv[i + 1]);
255  } else if (!strcmp(argv[i], "-nx")) {
256  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
257  cg->setNX(atoi(argv[i + 1]));
258  logger(INFO, "Set nx to %", argv[i + 1]);
259  } else if (!strcmp(argv[i], "-ny")) {
260  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
261  cg->setNY(atoi(argv[i + 1]));
262  logger(INFO, "Set ny to %", argv[i + 1]);
263  } else if (!strcmp(argv[i], "-nz")) {
264  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
265  cg->setNZ(atoi(argv[i + 1]));
266  logger(INFO, "Set nz to %", argv[i + 1]);
267  } else if (!strcmp(argv[i], "-h")) {
268  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
269  cg->setH(atof(argv[i + 1]));
270  logger(INFO, "Set n to %x%x% for h=%", cg->getNX(), cg->getNY(), cg->getNZ(), argv[i + 1]);
271  } else if (!strcmp(argv[i], "-hx")) {
272  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
273  cg->setHX(atof(argv[i + 1]));
274  logger(INFO, "Set nx to % to satisfy hx=%", cg->getNX(), argv[i + 1]);
275  } else if (!strcmp(argv[i], "-hy")) {
276  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
277  cg->setHY(atof(argv[i + 1]));
278  logger(INFO, "Set ny to % to satisfy hy=%", cg->getNY(), argv[i + 1]);
279  } else if (!strcmp(argv[i], "-hz")) {
280  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
281  cg->setHZ(atof(argv[i + 1]));
282  logger(INFO, "Set nz to % to satisfy hz=%", cg->getNZ(), argv[i + 1]);
283  } else if (!strcmp(argv[i], "-x")) {
284  logger.assert_debug(i+2<argc,"% requires two arguments",argv[i]);
285  cg->setX(atof(argv[i + 1]), atof(argv[i + 2]));
286  logger(INFO, "Set x to (%,%)", argv[i + 1], argv[i + 2]);
287  ++i;
288  } else if (!strcmp(argv[i], "-y")) {
289  logger.assert_debug(i+2<argc,"% requires two arguments",argv[i]);
290  cg->setY(atof(argv[i + 1]), atof(argv[i + 2]));
291  logger(INFO, "Set y to (%,%)", argv[i + 1], argv[i + 2]);
292  ++i;
293  } else if (!strcmp(argv[i], "-z")) {
294  logger.assert_debug(i+2<argc,"% requires two arguments",argv[i]);
295  cg->setZ(atof(argv[i + 1]), atof(argv[i + 2]));
296  logger(INFO, "Set z to (%,%)", argv[i + 1], argv[i + 2]);
297  ++i;
298  } else if (!strcmp(argv[i], "-t")) {
299  logger.assert_debug(i+2<argc,"% requires two arguments",argv[i]);
300  cg->setTimeMin(atof(argv[i + 1]));
301  cg->setTimeMax(atof(argv[i + 2]));
302  logger(INFO, "Set t to (%,%)", argv[i + 1], argv[i + 2]);
303  i++;
304  } else if (!strcmp(argv[i], "-savecount")) {
305  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
306  cg->statFile.setSaveCount(atof(argv[i + 1]));
307  logger(INFO, "Set savecount to %", argv[i + 1]);
308  } else if (!strcmp(argv[i], "-writedata")) {
309  dpm.dataFile.setFileType(FileType::ONE_FILE);
310  logger(INFO, "Turn on data file output. Execute %.xballs to visualise output", dpm.getName());
311  --i;
312  } else if (!strcmp(argv[i], "-tmin")) {
313  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
314  cg->setTimeMin(atof(argv[i + 1]));
315  logger(INFO, "Set tMin to %", argv[i + 1]);
316  } else if (!strcmp(argv[i], "-timemin")) {
317  logger(ERROR, "% is not a valid argument; use -tMin instead",argv[i]);
318  } else if (!strcmp(argv[i], "-tmax")) {
319  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
320  cg->setTimeMax(atof(argv[i + 1]));
321  logger(INFO, "Set tMax to %", argv[i + 1]);
322  } else if (!strcmp(argv[i], "-dt")) {
323  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
324  dpm.setTimeMax(dpm.getTime()+atof(argv[i + 1]));
325  logger(INFO, "Set evaluation time interval to %", argv[i + 1]);
326  } else if (!strcmp(argv[i], "-initialfilecounter")) {
327  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
328  dpm.cgHandler.setInitialFileCounter(atoi(argv[i+1]));
329  logger(INFO, "Initial file counter set to %", argv[i + 1]);
330  } else if (!strcmp(argv[i], "-timemax")) {
331  logger(ERROR, "% is not a valid argument; use -tMax instead",argv[i]);
332  } else if (!strcmp(argv[i], "-species")) {
333  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
334  cg->selectSpecies(atoi(argv[i + 1]));
335  logger(INFO, "Evaluating species #%", atoi(argv[i + 1]));
336  } else if (!strcmp(argv[i], "-o")) {
337  logger.assert_always(i+1<argc,"% requires argument",argv[i]);
338  cg->statFile.setName(argv[i + 1]);
339  logger(INFO, "Set output file name to %", argv[i + 1]);
340  } 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")) {
341  //these are commands with one argument that should be ignored here because they are read somewhere else
342  } else if (!strcmp(argv[i], "-help") || !strcmp(argv[i], "-readfromrestart") || !strcmp(argv[i], "-timeaverage") || !strcmp(argv[i], "-timesmooth")) {
343  //these are commands with no argument that should be ignored here because they are read somewhere else
344  --i;
345  } else if (!strcmp(argv[i], "-timeaveragereset")) {
346  //these are commands with no argument that should be ignored here because they are read somewhere else
347  logger(WARN, "This fstatistics command has no equivalent yet in MercuryCG and will be ignored: %", argv[i]);
348  } else {
349  logger(ERROR, "Could not read argument %", argv[i]);
350  }
351  }
352 
353  logger(INFO, "Created object of type %", cg->getName());
354 
356 
357  //Determine what kind of input to read from (data files, restart files, or live cg)
358  //Variable that stores the type of data source
359  enum class DataSource {
360  readFromData,
361  readFromRestart,
362  restartAndAnalyse
363  } dataSource = DataSource::readFromData;
364  //read command line arguments to determine dataSource
365  for (unsigned i = 1; i < argc; i++) {
366  if (!strcmp(argv[i], "-readfromrestart")) {
367  dataSource = DataSource::readFromRestart;
368  } else if (!strcmp(argv[i], "-restartandanalyse")) {
369  dataSource = DataSource::restartAndAnalyse;
370  dpm.setTimeMax(dpm.getTime()+atof(argv[i+1]));
371  }
372  }
373  //Evaluate based on dataSource
374  if (dataSource == DataSource::readFromData) {
375  logger(INFO, "Reading from data files.");
376  if (!dpm.cgHandler.evaluateDataFiles()) {
377  logger(ERROR,"Evaluation of data files has failed. Check input files.");
378  }
379  } else if (dataSource == DataSource::readFromRestart){
380  logger(INFO, "Reading from restart files.");
381  if (dpm.restartFile.getFileType()!=FileType::MULTIPLE_FILES &&
383  logger(ERROR,"Evaluation of restart files requires multiple restart files. Check input.");
384  }
386  } else {
387  logger(INFO,"Restarting simulation for live analysis");
388  //dpm.write(std::cout,false);
389  //dpm.setSaveCount(25);
390  dpm.solve();
391  }
392  logger(INFO, "\n"
393  "MercuryCG has finished.\n"
394  "Coarse-grained output is written to %\n"
395  "To load output into Matlab, use data=readMercuryCG('%')",
397 }

References addObject(), DPMBase::cgHandler, DPMBase::dataFile, ERROR, CGHandler::evaluateDataFiles(), CGHandler::evaluateRestartFiles(), File::getFileType(), BaseHandler< T >::getLastObject(), DPMBase::getMax(), DPMBase::getMin(), DPMBase::getName(), File::getName(), BaseObject::getName(), BaseCG::getNX(), BaseCG::getNY(), BaseCG::getNZ(), DPMBase::getTime(), BaseCG::getWidth(), constants::i, INFO, logger, helpers::more(), units::name, NO_FILE, DPMBase::readSpeciesFromDataFile(), CGHandler::restart(), DPMBase::restartFile, BaseCG::selectSpecies(), DPMBase::setAppend(), BaseCG::setAverageBeyondDomain(), 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::setWidth(), BaseCG::setX(), BaseCG::setY(), BaseCG::setZ(), DPMBase::solve(), BaseCG::statFile, 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.

404  {
405  Mercury3D dpm;
406  commandLineCG(dpm, argc, argv);
407  return 0;
408 }

References commandLineCG().

CGHandler::setInitialFileCounter
void setInitialFileCounter(unsigned initialFileCounter)
Definition: CGHandler.h:141
BaseCG::getNZ
std::size_t getNZ() const
Returns nZ_, the number of spatial mesh points in the z-direction.
Definition: BaseCG.cc:106
File::getName
const std::string & getName() const
Allows to access the file name, e.g., "problem.data".
Definition: File.cc:165
File::setFileType
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
BaseCG::setNZ
void setNZ(std::size_t nZ)
Sets nZ_, the number of spatial mesh points in the z-direction.
Definition: BaseCG.cc:101
BaseCG::setN
void setN(std::size_t n)
Sets nX_, nY_, nZ_, the number of spatial mesh points in each cartesian direction.
Definition: BaseCG.cc:131
BaseObject::getName
virtual std::string getName() const =0
A purely virtual function.
BaseCG::setH
void setH(Mdouble h)
Sets nX_, nY_, nZ_, the number of spatial mesh points in each cartesian direction....
Definition: BaseCG.cc:241
logger
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
commandLineCG
void commandLineCG(Mercury3D &dpm, int argc, char **argv)
Definition: MercuryCG.cpp:124
DPMBase::cgHandler
CGHandler cgHandler
Object of the class cgHandler.
Definition: DPMBase.h:1431
BaseCG::setNY
void setNY(std::size_t nY)
Sets nY_, the number of spatial mesh points in the y-direction.
Definition: BaseCG.cc:111
File::setSaveCount
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_.
Definition: File.cc:273
BaseCG::setWidth
virtual void setWidth(Mdouble width)=0
Sets width_, the coarse-graining width.
Mercury3D
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:37
BaseCG::setHX
void setHX(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX,...
Definition: BaseCG.cc:249
FileType::NO_FILE
@ NO_FILE
file will not be created/read
DPMBase::restartFile
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1451
BaseCG::getNY
std::size_t getNY() const
Returns nY_, the number of spatial mesh points in the y-direction.
Definition: BaseCG.cc:116
INFO
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
BaseCG::getNX
std::size_t getNX() const
Returns nX_, the number of spatial mesh points in the x-direction.
Definition: BaseCG.cc:126
DPMBase::solve
void solve()
The work horse of the code.
Definition: DPMBase.cc:4003
BaseCG::setAverageBeyondDomain
void setAverageBeyondDomain(const bool val)
Definition: BaseCG.h:275
BaseCG::setMax
void setMax(Vec3D max)
Sets max_, the upper limit of the spatial domain.
Definition: BaseCG.cc:170
BaseCG::setNX
void setNX(std::size_t nX)
Sets nX_, the number of spatial mesh points in the x-direction.
Definition: BaseCG.cc:121
addObject
void addObject(CGHandler &cg, std::string coordinate)
Definition: MercuryCG.cpp:40
BaseCG::setTimeMax
void setTimeMax(Mdouble timeMax)
Sets timeMax_, the upper limit of the temporal domain.
Definition: BaseCG.cc:150
DPMBase::getMax
Vec3D getMax() const
Definition: DPMBase.h:643
ERROR
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
BaseCG::setStandardDeviation
virtual void setStandardDeviation(Mdouble std)=0
File::setName
void setName(const std::string &name)
Sets the file name, e.g. "Name.data".
Definition: File.cc:198
DPMBase::getTime
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:805
WARN
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:54
BaseCG::setY
void setY(Mdouble min, Mdouble max)
Sets min_.Y, max_.Y, the limits of the spatial domain in Y.
Definition: BaseCG.cc:191
BaseCG::statFile
File statFile
File class to handle the output into a .stat file.
Definition: BaseCG.h:369
CGHandler::restart
void restart(std::string name)
loads restart file, before evaluateDataFiles is run
Definition: CGHandler.cc:127
BaseCG::setMin
void setMin(Vec3D min)
Sets max_, the lower limit of the spatial domain.
Definition: BaseCG.cc:165
DPMBase::setTimeMax
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:870
BaseCG::setHY
void setHY(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX,...
Definition: BaseCG.cc:258
DPMBase::getName
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:397
constants::i
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
BaseHandler::getLastObject
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:634
BaseCG::setTimeMin
void setTimeMin(Mdouble timeMin)
Sets timeMin_, the lower limit of the temporal domain.
Definition: BaseCG.cc:145
BaseCG::getWidth
virtual Mdouble getWidth() const =0
Returns width_, the coarse-graining width.
DPMBase::getMin
Vec3D getMin() const
Definition: DPMBase.h:637
BaseHandler::copyAndAddObject
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:379
helpers::more
void more(std::string filename, unsigned nLines=constants::unsignedMax)
Definition: Helpers.cc:580
CGHandler::evaluateDataFiles
bool evaluateDataFiles(bool evaluateFStatFiles=true)
does the same as StatisticsVector::statistics_from_fstat_and_data: loads a restart file (if existing)...
Definition: CGHandler.cc:315
BaseCG::setZ
void setZ(Mdouble min, Mdouble max)
Sets min_.Z, max_.Z, the limits of the spatial domain in Z.
Definition: BaseCG.cc:197
BaseCG::setHZ
void setHZ(Mdouble h)
Sets nX_ the number of spatial mesh points in the X-direction. Instead of explicitly defining nX,...
Definition: BaseCG.cc:267
BaseCG::setX
void setX(Mdouble min, Mdouble max)
Sets min_.X, max_.X, the limits of the spatial domain in X.
Definition: BaseCG.cc:185
CGHandler::evaluateRestartFiles
bool evaluateRestartFiles()
Definition: CGHandler.cc:247
DPMBase::readSpeciesFromDataFile
void readSpeciesFromDataFile(bool read=true)
Definition: DPMBase.h:341
DPMBase::dataFile
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1436
BaseCG::selectSpecies
void selectSpecies(unsigned speciesIndex)
Definition: BaseCG.cc:228
units::name
std::string name
Definition: MercuryProb.h:48
File::getFileType
FileType getFileType() const
Gets the file type e.g. NOFILE, ONEFILE and MULTIPLE FILES. File::fileType_.
Definition: File.cc:207
BaseCG
Base class of all CG objects, needed to store the various CG objects in the CGHandler.
Definition: BaseCG.h:57
DPMBase::setAppend
void setAppend(bool newAppendFlag)
Sets whether the "append" option is on or off.
Definition: DPMBase.cc:1513