revision: v0.14
MercuryData.h
Go to the documentation of this file.
1 //Copyright (c) 2015, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef TOOLS_MERCURYDATA_H
27 #define TOOLS_MERCURYDATA_H
28 
29 #include <fstream>
30 #include <iostream>
31 #include <string>
32 #include <sstream>
33 #include <vector>
34 
40 template<std::size_t NDIMS>
42 {
43  public:
47  double position[NDIMS];
51  double velocity[NDIMS];
55  double rotation[NDIMS];
59  double angularV[NDIMS];
60 
64  double radius;
65 
69  std::size_t speciesID;
70 };
71 
79 template<>
80 struct MercuryParticle<2>
81 {
82  public:
86  double position[3];
90  double velocity[3];
94  double rotation[3];
98  double angularV[3];
99 
103  double radius;
104 
108  std::size_t speciesID;
109 
110 };
111 
115 template<std::size_t NDIMS>
116 std::istream& operator>>(std::istream& in, MercuryParticle<NDIMS>& part)
117 {
118  std::size_t i;
119  for (i = 0; i < NDIMS; i++)
120  in >> part.position[i];
121 
122  for (i = 0; i < NDIMS; i++) {
123  in >> part.velocity[i];
124  // convert velocities to float, because paraview cannot handle doubles
125  part.velocity[i] = (float)part.velocity[i];
126  }
127 
128  in >> part.radius;
129 
130  for (i = 0; i < NDIMS; i++)
131  in >> part.rotation[i];
132 
133  for (i = 0; i < NDIMS; i++) {
134  in >> part.angularV[i];
135  // convert velocities to float, because paraview cannot handle doubles
136  part.angularV[i] = (float)part.angularV[i];
137  }
138 
139  in >> part.speciesID;
140 
141  return in;
142 }
143 
144 template<>
145 std::istream& operator>><2>(std::istream& in, MercuryParticle<2>& part)
146 {
147  std::size_t i;
148  in >> part.position[0] >> part.position[2];
149  part.position[1] = 0;
150 
151  in >> part.velocity[0] >> part.velocity[2];
152  part.velocity[1] = 0;
153 
154  in >> part.radius;
155 
156  in >> part.rotation[1];
157  part.rotation[0] = part.rotation[2] = 0;
158 
159  in >> part.angularV[1];
160  part.angularV[0] = part.angularV[2] = 0;
161 
162  in >> part.speciesID;
163 
164  return in;
165 }
166 
167 
168 class MercuryDataFile;
169 
170 template<std::size_t NDIMS>
177 template<std::size_t NDIMS>
179 {
180  public:
185  double getTime() const
186  {
187  return time_;
188  }
189 
196  std::size_t getTimeStepID() const
197  {
198  return ID_;
199  }
200 
206  std::size_t getNumberOfParticles() const
207  {
208  return numParticles_;
209  }
210 
216  std::size_t size() const
217  {
218  return numParticles_;
219  }
220 
225  constexpr std::size_t getNumberOfDimensions() const
226  {
227  return NDIMS;
228  }
229 
233  typename std::vector< MercuryParticle<NDIMS> >::iterator begin()
234  {
235  return storage_.begin();
236  }
237 
241  typename std::vector< MercuryParticle<NDIMS> >::const_iterator begin() const
242  {
243  return storage_.begin();
244  }
245 
249  typename std::vector< MercuryParticle<NDIMS> >::iterator end()
250  {
251  return storage_.end();
252  }
253 
257  typename std::vector< MercuryParticle<NDIMS> >::const_iterator end() const
258  {
259  return storage_.end();
260  }
261 
266  {
267  return storage_[idx];
268  }
269 
273  const MercuryParticle<NDIMS>& operator[](std::size_t idx) const
274  {
275  return storage_[idx];
276  }
277 
278  private:
284  MercuryTimeStep(std::size_t id, MercuryDataFile *pData)
285  : time_(0), ID_(id), numParticles_(0), dataFile_(pData)
286  {
287  }
288 
293  : time_(0), ID_(0), numParticles_(0), dataFile_(nullptr)
294  {
295  }
296 
300  double time_;
304  std::size_t ID_;
308  std::size_t numParticles_;
312  double min_[NDIMS], max_[NDIMS];
319 
323  std::vector< MercuryParticle<NDIMS> > storage_;
324 
325  template<std::size_t NDIMS2>
326  friend std::istream& operator>>(std::istream&, MercuryTimeStep<NDIMS2>&);
327 
328  friend class MercuryTimeStepIterator<NDIMS>;
329 
330  friend class MercuryDataFile;
331 };
332 
339 template<std::size_t NDIMS>
340 std::istream& operator>>(std::istream& in, MercuryTimeStep<NDIMS>& step)
341 {
342  std::size_t i;
343  in >> step.numParticles_ >> step.time_;
344 
345  for (i = 0; i < NDIMS; i++)
346  in >> step.min_[i];
347 
348  for (i = 0; i < NDIMS; i++)
349  in >> step.max_[i];
350 
351  return in;
352 }
353 
363 template<std::size_t NDIMS>
365 {
366  public:
371  {
372  return (isEOFTimeStep_ != other.isEOFTimeStep_);
373  }
374 
379  {
380  return lastReadTimeStep_;
381  }
382 
387  {
388  return lastReadTimeStep_;
389  }
390 
396  void operator++();
397 
398  private:
403  : isEOFTimeStep_(true), dataFile_(nullptr)
404  {
405  }
406 
412  : lastReadTimeStep_(0,pData), isEOFTimeStep_(false), dataFile_(pData)
413  {
414  ++(*this);
415  lastReadTimeStep_.ID_ = 0;
416  }
417 
430 
431  friend class MercuryDataFile;
432 };
433 
434 
442 {
443  public:
449  MercuryDataFile(std::string name)
450  : file_(name)
451  { }
452 
460  operator bool() const
461  {
462  return file_.good();
463  }
464 
476  template<std::size_t NDIMS>
478  {
479  //Store the position, so we can jump back at the end of the function..
480  std::ios::pos_type currentPosition = file_.tellg();
481  //and jump to the start
482  file_.seekg(0);
483  //get the first line
484  std::string line;
485  std::getline(file_, line);
486  file_.seekg(currentPosition); //and pretend nothing has happened
487 
488  std::istringstream lineStream(line);
489 
490  //We'll try to find out if there were exactly enough arguments.
492  lineStream >> step;
493 
494  //Did we reach the end yet?
495  bool isValid = lineStream.good();
496  double dummy;
497  lineStream >> dummy;
498 
499  //now we should have reached it.
500  isValid = isValid && !lineStream.good();
501  return isValid;
502  }
503 
510  template<std::size_t NDIMS>
512  {
513  private:
515  : data_(pData)
516  { }
517 
519  public:
521  {
522  return data_->begin<NDIMS>();
523  }
525  {
526  return data_->end<NDIMS>();
527  }
528  friend class MercuryDataFile;
529  };
530 
531  template<std::size_t NDIMS>
533  {
534  return {this};
535  };
536 
546  template<std::size_t NDIMS>
548  {
549  file_.seekg(0);
550  return {this};
551  }
552 
556  template<std::size_t NDIMS>
558  {
559  return {};
560  }
561  private:
565  std::ifstream file_;
566 
567  template<std::size_t NDIMS>
568  friend class MercuryTimeStep;
569  template<std::size_t NDIMS>
571 };
572 
573 template<std::size_t NDIMS>
575 {
576  lastReadTimeStep_.ID_++;
577 
578  std::string line;
579  std::getline(dataFile_->file_, line);
580 
581  std::istringstream lineStream(line);
582 
583  lineStream >> lastReadTimeStep_;
584 
585  //I hope we didn't went beyond end of file...
586  if (lineStream.eof())
587  {
588 // logger(WARN, "The time step header detected an EOF.. Usually this"
589 // " means that the format was not what it appeared to be."
590 // "\nproceed with caution!");
591  }
592  //Resize the backing storage container to make sure we can actually
593  //fit all the particles in there.
594  lastReadTimeStep_.storage_.resize(lastReadTimeStep_.numParticles_);
595  //Well, now that we're set up, read all the particles
597  {
598  //line by line, because no data format can be trusted.
599  std::getline(dataFile_->file_, line);
600  lineStream.clear();
601  lineStream.str(line);
602 
603  lineStream >> part;
604  }
605 
606  if (dataFile_->file_.eof())
607  isEOFTimeStep_ = true;
608 }
609 
610 #endif
DPMBase::setMax
void setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1073
main
int main(int argc UNUSED, char *argv[] UNUSED)
Definition: MercuryCGSelfTest.cpp:93
MercuryTimeStep::numParticles_
std::size_t numParticles_
Definition: MercuryData.h:308
CGHandler::setInitialFileCounter
void setInitialFileCounter(unsigned initialFileCounter)
Definition: CGHandler.h:141
MercuryParticle::rotation
double rotation[NDIMS]
Definition: MercuryData.h:55
DPMBase::setName
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:420
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
DPMBase::setTimeStep
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
MercuryCGSelfTest
In this file a cubic packing of 5^3 particles in a tri-axial box is created and allowed to settle und...
Definition: MercuryCGSelfTest.cpp:44
MercuryTimeStep::operator[]
const MercuryParticle< NDIMS > & operator[](std::size_t idx) const
Random access function into the particles.
Definition: MercuryData.h:273
DPMBase::setMin
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1109
BaseCG::setNZ
void setNZ(std::size_t nZ)
Sets nZ_, the number of spatial mesh points in the z-direction.
Definition: BaseCG.cc:101
CGHandler
Container that stores all CG objects.
Definition: CGHandler.h:65
constants::pi
const Mdouble pi
Definition: ExtendedMath.h:45
StatisticsVector.h
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
MercuryTimeStep::min_
double min_[NDIMS]
Definition: MercuryData.h:312
MercuryParticle< 2 >
Definition: MercuryData.h:81
MercuryDataFile
Definition: MercuryData.h:442
BaseObject::getName
virtual std::string getName() const =0
A purely virtual function.
MercuryDataFile::begin
MercuryTimeStepIterator< NDIMS > begin()
Returns a forwarditerator to the time steps Returns a forwarditerator to the time steps,...
Definition: MercuryData.h:547
LinearViscoelasticReversibleAdhesiveSpecies.h
Heaviside.h
MercuryTimeStep::operator>>
friend std::istream & operator>>(std::istream &, MercuryTimeStep< NDIMS2 > &)
DPMBase::getXMax
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:607
BaseInteractable::setPosition
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
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
MercuryTimeStep::MercuryTimeStep
MercuryTimeStep(std::size_t id, MercuryDataFile *pData)
Constructor used by the MercuryTimeStepIterator, to flag a functional time step.
Definition: MercuryData.h:284
MercuryDataFile::IteratorProxy::data_
MercuryDataFile * data_
Definition: MercuryData.h:518
MercuryTimeStep::end
std::vector< MercuryParticle< NDIMS > >::iterator end()
Iterator functions for range based for loops.
Definition: MercuryData.h:249
MercuryTimeStep::getTime
double getTime() const
Gets the time associated with this time step.
Definition: MercuryData.h:185
operator>>
std::istream & operator>>(std::istream &in, MercuryParticle< NDIMS > &part)
Read a single particle from a istream.
Definition: MercuryData.h:116
CGHandler::restartAndEvaluateDataFiles
void restartAndEvaluateDataFiles(const std::string &name, bool evaluateFStatFiles=true)
Definition: CGHandler.cc:188
BaseCG::setNY
void setNY(std::size_t nY)
Sets nY_, the number of spatial mesh points in the y-direction.
Definition: BaseCG.cc:111
MercuryCGSelfTest::MercuryCGSelfTest
MercuryCGSelfTest(const unsigned n=5)
Definition: MercuryCGSelfTest.cpp:45
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
MercuryTimeStep::getNumberOfParticles
std::size_t getNumberOfParticles() const
Gets the number of particles recorded in this time step.
Definition: MercuryData.h:206
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
MercuryTimeStep::max_
double max_[NDIMS]
Definition: MercuryData.h:312
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
MercuryDataFile::IteratorProxy::end
MercuryTimeStepIterator< NDIMS > end()
Definition: MercuryData.h:524
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
MercuryParticle
Definition: MercuryData.h:42
LiquidMigrationFields.h
BaseParticle::setRadius
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:542
Vec3D
Definition: Vector.h:50
DPMBase::solve
void solve()
The work horse of the code.
Definition: DPMBase.cc:4003
bool
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
MercuryTimeStep::time_
double time_
Definition: MercuryData.h:300
MercuryTimeStepIterator::operator!=
bool operator!=(MercuryTimeStepIterator< NDIMS > other) const
Not-equals operator, as defined for ForwardIterators.
Definition: MercuryData.h:370
DPMBase::getYMin
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:613
MercuryTimeStepIterator::operator*
MercuryTimeStep< NDIMS > & operator*()
Dereference operator, as defined for ForwardIterators.
Definition: MercuryData.h:378
MercuryDataFile::as
IteratorProxy< NDIMS > as()
Definition: MercuryData.h:532
addObject
void addObject(CGHandler &cg, std::string coordinate)
Definition: MercuryCG.cpp:40
OrientationField.h
MercuryTimeStep::getTimeStepID
std::size_t getTimeStepID() const
Gets the time step ID Returns the time step ID, which is a consecutively ascending number unique for ...
Definition: MercuryData.h:196
MercuryTimeStep::MercuryTimeStep
MercuryTimeStep()
EOF-TimeStep constructor used by MercuryTimeStepIterator (and MercuryDataFile::isMercury3DDataFile())
Definition: MercuryData.h:292
MercuryDataFile::IteratorProxy::begin
MercuryTimeStepIterator< NDIMS > begin()
Definition: MercuryData.h:520
MercuryDataFile::isMercuryDataFile
bool isMercuryDataFile()
Checks if this file is a valid Mercury 3D data file. This function jumps to the start of the file,...
Definition: MercuryData.h:477
MercuryTimeStep::size
std::size_t size() const
Gets the number of particles recorded in this time step.
Definition: MercuryData.h:216
MercuryTimeStep::end
std::vector< MercuryParticle< NDIMS > >::const_iterator end() const
Iterator functions for range based for loops.
Definition: MercuryData.h:257
MercuryDataFile::IteratorProxy::IteratorProxy
IteratorProxy(MercuryDataFile *pData)
Definition: MercuryData.h:514
MercuryParticle::speciesID
std::size_t speciesID
Definition: MercuryData.h:69
BaseCG::setTimeMax
void setTimeMax(Mdouble timeMax)
Sets timeMax_, the upper limit of the temporal domain.
Definition: BaseCG.cc:150
double
DPMBase::getMax
Vec3D getMax() const
Definition: DPMBase.h:643
ERROR
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
MercuryTimeStepIterator::operator*
const MercuryTimeStep< NDIMS > & operator*() const
Const dereference operator, as defined for constant ForwardIterators.
Definition: MercuryData.h:386
MercuryTimeStep::ID_
std::size_t ID_
Definition: MercuryData.h:304
MercuryTimeStep::storage_
std::vector< MercuryParticle< NDIMS > > storage_
Definition: MercuryData.h:323
BaseParticle::setSpecies
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:804
TimeSmoothedCG.h
BaseCG::setStandardDeviation
virtual void setStandardDeviation(Mdouble std)=0
LinearViscoelasticSpecies.h
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
Species
Contains material and contact force properties.
Definition: Species.h:35
main
int main(int argc, char *argv[])
MercuryCG is the postprocessing tool for extracting coarse-grained fields from particle data....
Definition: MercuryCG.cpp:404
WARN
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:54
InfiniteWall.h
MercuryTimeStepIterator::lastReadTimeStep_
MercuryTimeStep< NDIMS > lastReadTimeStep_
Definition: MercuryData.h:421
MercuryTimeStep::begin
std::vector< MercuryParticle< NDIMS > >::const_iterator begin() const
Iterator functions for range based for loops.
Definition: MercuryData.h:241
DPMBase::speciesHandler
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1385
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
CG.h
MercuryParticle::velocity
double velocity[NDIMS]
Definition: MercuryData.h:51
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
SphericalParticle
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
MercuryTimeStepIterator::dataFile_
MercuryDataFile * dataFile_
Definition: MercuryData.h:429
DPMBase::wallHandler
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1405
MercuryTimeStep::begin
std::vector< MercuryParticle< NDIMS > >::iterator begin()
Iterator functions for range based for loops.
Definition: MercuryData.h:233
DPMBase::setTimeMax
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:870
TimeAveragedCG
Evaluates time-averaged continuum fields and writes the data into a stat file.
Definition: TimeAveragedCG.h:59
DPMBase::setGravity
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1374
InfiniteWall
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:48
MercuryTimeStepIterator::MercuryTimeStepIterator
MercuryTimeStepIterator()
Definition: MercuryData.h:402
MercuryTimeStepIterator::MercuryTimeStepIterator
MercuryTimeStepIterator(MercuryDataFile *pData)
Definition: MercuryData.h:411
MercuryParticle::angularV
double angularV[NDIMS]
Definition: MercuryData.h:59
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
MercuryDataFile::MercuryDataFile
MercuryDataFile(std::string name)
Definition: MercuryData.h:449
MercuryTimeStepIterator::isEOFTimeStep_
bool isEOFTimeStep_
Definition: MercuryData.h:425
constants::i
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
BaseWall::setSpecies
void setSpecies(const ParticleSpecies *species)
Defines the species of the current wall.
Definition: BaseWall.cc:171
DPMBase::getZMin
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:625
MercuryParticle< 2 >::speciesID
std::size_t speciesID
Definition: MercuryData.h:108
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
BaseHandler::getObject
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
BaseCG::getWidth
virtual Mdouble getWidth() const =0
Returns width_, the coarse-graining width.
MercuryTimeStep::getNumberOfDimensions
constexpr std::size_t getNumberOfDimensions() const
returns the number of dimensions used.
Definition: MercuryData.h:225
MercuryDataFile::file_
std::ifstream file_
Definition: MercuryData.h:565
UNUSED
#define UNUSED
Definition: GeneralDefine.h:39
GradVelocityField.h
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
MercuryTimeStepIterator
Definition: MercuryData.h:365
n
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
helpers::more
void more(std::string filename, unsigned nLines=constants::unsignedMax)
Definition: Helpers.cc:580
MercuryDataFile::end
MercuryTimeStepIterator< NDIMS > end() const
Returns a forwarditerator one past the last time step.
Definition: MercuryData.h:557
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
helpers::writeToFile
bool writeToFile(std::string filename, std::string filecontent)
Writes a string to a file.
Definition: Helpers.cc:445
MercuryParticle< 2 >::radius
double radius
Definition: MercuryData.h:103
DPMBase::getYMax
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:619
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
DPMBase::getZMax
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:631
MercuryTimeStepIterator::operator++
void operator++()
Pre-increment operator, as defined for ForwardIterators This method populates the time step,...
Definition: MercuryData.h:574
CGHandler::evaluateRestartFiles
bool evaluateRestartFiles()
Definition: CGHandler.cc:247
Linear.h
MercuryTimeStep::dataFile_
MercuryDataFile * dataFile_
Definition: MercuryData.h:318
DPMBase::particleHandler
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1395
DPMBase::readSpeciesFromDataFile
void readSpeciesFromDataFile(bool read=true)
Definition: DPMBase.h:341
MercuryParticle::radius
double radius
Definition: MercuryData.h:64
MercuryTimeStep::operator[]
MercuryParticle< NDIMS > & operator[](std::size_t idx)
Random access function into the particles.
Definition: MercuryData.h:265
DPMBase::setSaveCount
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:406
MercuryTimeStep
Definition: MercuryData.h:179
MercuryDataFile::IteratorProxy
Definition: MercuryData.h:512
InfiniteWall::set
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
Definition: InfiniteWall.cc:118
LiquidMigrationWilletInteraction.h
mathsFunc::cubic
T cubic(const T val)
calculates the cube of a number
Definition: ExtendedMath.h:115
Mercury3D.h
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
TimeAveragedCG.h
File::getFileType
FileType getFileType() const
Gets the file type e.g. NOFILE, ONEFILE and MULTIPLE FILES. File::fileType_.
Definition: File.cc:207
DPMBase::getXMin
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:600
BaseCG
Base class of all CG objects, needed to store the various CG objects in the CGHandler.
Definition: BaseCG.h:57
MercuryTime.h
MercuryParticle::position
double position[NDIMS]
Definition: MercuryData.h:47
DPMBase::setAppend
void setAppend(bool newAppendFlag)
Sets whether the "append" option is on or off.
Definition: DPMBase.cc:1513