MercuryDPM  0.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DPMBase.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2014, 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 MD_H
27 #define MD_H
28 
29 #include <string>
30 //This is the class that defines the std_save routines
31 #include "FilesAndRunNumber.h"
32 //The vector class contains a 3D vector class.
33 #include "Math/Vector.h"
34 //This class defines the particle handler
35 #include "ParticleHandler.h"
36 //This class defines the wall handler
37 #include "WallHandler.h"
38 //This class defines the boundary handler
39 #include "BoundaryHandler.h"
40 //This class defines the interaction handler
41 #include "InteractionHandler.h"
42 //This class defines the Species handler
43 #include "SpeciesHandler.h"
44 //#include "Species/Species.h"
45 //This class defines the posibleContact lists
46 #ifdef CONTACT_LIST_HGRID
47  #include "PossibleContactList.h"
48 #endif
49 //This class defines the random number generator
50 #include "Math/RNG.h"
51 
52 
61 class DPMBase : public FilesAndRunNumber
62 {
63 public:
69  void constructor();
70 
74  DPMBase();
75 
79  DPMBase(const FilesAndRunNumber& other);
80 
84  DPMBase(const DPMBase& other);
85 
89  virtual ~DPMBase();
90 
94  void solve();
95 
103  void checkSettings();
104 
108  virtual void writeOutputFiles();
109 
113  void solve(int argc, char* argv[]);
114 
125  virtual void setupInitialConditions();
126 
130  virtual void writeXBallsScript() const;
131 
136  virtual double getInfo(const BaseParticle& P) const;
137 
142  virtual void writeRestartFile();
143 
149  int readRestartFile();
150 
154  int readRestartFile(std::string fileName);
155 
156 // /*!
157 // * \brief Loads all MD data and plots statistics for all timesteps in the .data file
158 // */
159 // void statisticsFromRestartData(const char *name);
160 
164  virtual void write(std::ostream& os, bool writeAllParticles=true) const;
165 
169  virtual void read(std::istream& is);
170 
174  virtual void readOld(std::istream &is);
175 
187  bool readDataFile(const std::string fileName, unsigned int format = 0);
188 
192  bool readParAndIniFiles(const std::string fileName);
193 
199  bool readNextDataFile(unsigned int format = 0);
200 
204  bool findNextExistingDataFile(Mdouble tMin, bool verbose = true);
205 
209  friend inline std::ostream& operator<<(std::ostream& os, const DPMBase &md);
210 
215  bool readArguments(int argc, char *argv[]);
216 
220  virtual bool readNextArgument(int& i, int argc, char *argv[]);
221 
225  virtual bool checkParticleForInteraction(const BaseParticle& P);
226 
227  //getters and setters
228 
232  Mdouble getTime() const;
233 
237  unsigned int getNtimeSteps() const;
238 
242  void setTime(Mdouble time);
243 
247  void setTimeMax(Mdouble newTMax);
248 
253  Mdouble getTimeMax() const;
254 
255  #ifdef CONTACT_LIST_HGRID
256  PossibleContactList& getPossibleContactList();
257  #endif
258 
262  void setDoCGAlways(bool newDoCGFlag);
263 
272  void setRotation(bool newRotFlag);
273 
277  bool getRotation() const;
278 
282  bool getDoCGAlways() const;
283 
288  Mdouble getXMin() const;
289 
294  Mdouble getXMax() const;
295 
300  Mdouble getYMin() const;
301 
306  Mdouble getYMax() const;
307 
312  Mdouble getZMin() const;
313 
318  Mdouble getZMax() const;
319 
324  void setXMin(Mdouble newXMin);
325 
330  void setYMin(Mdouble newYMin);
331 
336  void setZMin(Mdouble newZMin);
337 
342  void setXMax(Mdouble newXMax);
343 
348  void setYMax(Mdouble newYMax);
349 
354  void setZMax(Mdouble newZMax);
355 
359  void setTimeStep(Mdouble newDt);
360 
364  Mdouble getTimeStep() const;
365 
369  void setXBallsColourMode(int newCMode);
370 
374  int getXBallsColourMode() const;
375 
379  void setXBallsVectorScale(double newVScale);
380 
384  double getXBallsVectorScale() const;
385 
389  void setXBallsAdditionalArguments(std::string newXBArgs);
390 
394  std::string getXBallsAdditionalArguments() const;
395 
400  void setXBallsScale(Mdouble newScale);
401 
405  double getXBallsScale() const;
406 
410  void setGravity(Vec3D newGravity);
411 
415  Vec3D getGravity() const;
416 
420  void setDimension(unsigned int newDim);
421 
425  void setSystemDimensions(unsigned int newDim);
426 
431  unsigned int getSystemDimensions() const;
432 
437  void setParticleDimensions(unsigned int particleDimensions);
438 
442  unsigned int getParticleDimensions() const;
443 
448  std::string getRestartVersion() const;
449 
453  void setRestartVersion(std::string newRV);
454 
458  bool getRestarted() const;
459 
463  void setRestarted(bool newRestartedFlag);
464 
468  bool getAppend() const;
469 
473  void setAppend(bool newAppendFlag);
474 
478  Mdouble getElasticEnergy() const;
479 
483  Mdouble getKineticEnergy() const;
484 
488  bool areInContact(const BaseParticle* pI, const BaseParticle* pJ) const;
489 
491 
494  virtual void hGridInsertParticle(BaseParticle *obj UNUSED);
495 
499  virtual void hGridUpdateParticle(BaseParticle *obj UNUSED);
500 
504  virtual void hGridRemoveParticle(BaseParticle *obj UNUSED);
505 
509  virtual void hGridUpdateMove(BaseParticle*, Mdouble);
510 
515  virtual void gatherContactStatistics(unsigned int index1 UNUSED, int index2 UNUSED, Vec3D Contact UNUSED, Mdouble delta UNUSED, Mdouble ctheta UNUSED, Mdouble fdotn UNUSED, Mdouble fdott UNUSED, Vec3D P1_P2_normal_ UNUSED, Vec3D P1_P2_tangential UNUSED);
516 
517 //functions that should only be used in the class definitions
518 protected:
519 
524  virtual void computeAllForces();
525 
530  virtual void computeInternalForces(BaseParticle* i);
531 
536  virtual void computeInternalForces(BaseParticle* P1, BaseParticle* P2);
537 
541  virtual void computeExternalForces(BaseParticle* PI);
542 
546  virtual void computeForcesDueToWalls(BaseParticle* PI);
547 
552  virtual void actionsOnRestart();
553 
558  virtual void actionsBeforeTimeLoop();
559 
564  virtual void hGridActionsBeforeTimeLoop();
565 
570  virtual void hGridActionsBeforeTimeStep();
571 
575  virtual bool getHGridUpdateEachTimeStep() const;
576 
581  virtual void actionsBeforeTimeStep();
582 
587  virtual void actionsAfterSolve();
588 
593  virtual void actionsAfterTimeStep();
594 
600  virtual void outputXBallsData(std::ostream& os) const;
601 
606  virtual void outputXBallsDataParticle(const unsigned int i,const unsigned int format, std::ostream& os) const;
607 
611  virtual void writeEneHeader(std::ostream& os) const;
612 
616  virtual void writeFstatHeader(std::ostream& os) const;
617 
623  virtual void writeEneTimestep(std::ostream& os) const;
624 
625  // Functions for statistics
629  virtual void initialiseStatistics();
630 
634  virtual void outputStatistics();
635 
640 
644  virtual void processStatistics(bool usethese UNUSED);
645 
649  virtual void finishStatistics();
650 
656  virtual void integrateBeforeForceComputation();
657 
662  virtual void integrateAfterForceComputation();
663 
669  virtual void checkInteractionWithBoundaries();
670 
674  virtual void hGridActionsBeforeIntegration();
675 
679  virtual void hGridActionsAfterIntegration();
680 
685  virtual void broadPhase(BaseParticle* i);
686 
690  void setFixedParticles(unsigned int n);
691 
696 
700  virtual void printTime() const;
701 
705  virtual bool continueSolve() const;
706 
711  void outputInteractionDetails() const;
712 
716  bool isTimeEqualTo(Mdouble time) const;
717 
722 
729 
730 private:
731 
735  unsigned int systemDimensions_;
736 
740  unsigned int particleDimensions_;
741 
746 
752 
758 
764 
770 
776 
782 
787 
791  unsigned int ntimeSteps_;
792 
797 
802 
809 
815  std::string restartVersion_;
816 
820  bool restarted_;
821 
826  bool append_;
827 
831  bool rotation_;
832 
833  //This is the private data that is only used by the xballs output
834 
840 
845 
850 
855 
856  //This belongs to the hGrid
857 
858  // defines a Macro for creating an instance of class PossibleContactList. See PossbileContactList.h
859  #ifdef CONTACT_LIST_HGRID
860  PossibleContactList possibleContactList;
861  #endif
862 
863 public:
864 
869 
874 
879 
884 
889 
894 
895 };
896 #endif
Container to store all ParticleSpecies.
Mdouble timeMax_
Stores the duration of the simulation.
Definition: DPMBase.h:801
void setTime(Mdouble time)
Access function for the time.
Definition: DPMBase.cc:172
virtual void actionsBeforeTimeLoop()
A virtual function. Allows one to carry out any operations before the start of the time loop...
Definition: DPMBase.cc:598
void setXBallsVectorScale(double newVScale)
Set the scale of vectors in xballs.
Definition: DPMBase.cc:389
virtual void write(std::ostream &os, bool writeAllParticles=true) const
Loads all MD data and plots statistics for all timesteps in the .data file.
Definition: DPMBase.cc:1642
virtual void hGridUpdateParticle(BaseParticle *obj UNUSED)
no implementation but can be overidden in its derived classes.
Definition: DPMBase.cc:633
Container to store pointers to all BaseBoundary objects.
void setXMax(Mdouble newXMax)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMax...
Definition: DPMBase.cc:309
void solve()
The work horse of the code.
Definition: DPMBase.cc:1895
Mdouble yMax_
If the length of the problem domain in y-direction is YMax - XMin, the above variable stores YMax...
Definition: DPMBase.h:769
virtual void hGridInsertParticle(BaseParticle *obj UNUSED)
no implementation but can be overidden in its derived classes.
Definition: DPMBase.cc:626
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
Definition: DPMBase.h:61
virtual void integrateAfterForceComputation()
Integration is done after force computations. We apply the Velocity verlet scheme. See http://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet.
Definition: DPMBase.cc:1524
void checkAndDuplicatePeriodicParticles()
In case of periodic boundaries, the below methods checks and adds particles when necessary into the p...
Definition: DPMBase.cc:2409
int getXBallsColourMode() const
Get the xball colour mode (CMode)
Definition: DPMBase.cc:382
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
Definition: DPMBase.cc:179
bool areInContact(const BaseParticle *pI, const BaseParticle *pJ) const
Checks if two particle are in contact or is there any positive overlap.
Definition: DPMBase.cc:590
void constructor()
A function which initialises the member variables to default values, so that the problem can be solve...
Definition: DPMBase.cc:777
unsigned int getSystemDimensions() const
Returns the dimension of the simulation. Note there is also a particle dimension. ...
Definition: DPMBase.cc:466
bool readArguments(int argc, char *argv[])
Can interpret main function input arguments that are passed by the driver codes.
Definition: DPMBase.cc:2029
unsigned int particleDimensions_
determines if 2D or 3D particle volume is used for mass calculations
Definition: DPMBase.h:740
Mdouble yMin_
If the length of the problem domain in y-direction is YMax - YMin, the above variable stores YMin...
Definition: DPMBase.h:763
void setYMin(Mdouble newYMin)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMin...
Definition: DPMBase.cc:280
virtual void computeInternalForces(BaseParticle *i)
Computes the forces between particles (internal in the sense that the sum over all these forces is ze...
Definition: DPMBase.cc:1633
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax...
Definition: DPMBase.cc:259
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin...
Definition: DPMBase.cc:224
unsigned int getParticleDimensions() const
Returns the particle dimensions.
Definition: DPMBase.cc:492
bool readDataFile(const std::string fileName, unsigned int format=0)
This allows particle data to be reloaded from data files.
Definition: DPMBase.cc:989
virtual void initialiseStatistics()
no implementation but can be overidden in its derived classes.
Definition: DPMBase.cc:676
Mdouble elasticEnergy_
used in force calculations
Definition: DPMBase.h:808
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin...
Definition: DPMBase.cc:238
void setXBallsColourMode(int newCMode)
Set the xball output mode.
Definition: DPMBase.cc:375
virtual void readOld(std::istream &is)
Reads all particle data into a restart file; old version.
Definition: DPMBase.cc:1772
void setParticleDimensions(unsigned int particleDimensions)
Allows the dimension of the particle (f.e. for mass) to be changed. e.g. discs or spheres...
Definition: DPMBase.cc:474
virtual ~DPMBase()
virtual destructor
Definition: DPMBase.cc:142
virtual void actionsAfterTimeStep()
A virtual function which allows to define operations to be executed after time step.
Definition: DPMBase.cc:669
void setZMax(Mdouble newZMax)
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax...
Definition: DPMBase.cc:338
void setDimension(unsigned int newDim)
Sets the system and particle dimension.
Definition: DPMBase.cc:445
void setAppend(bool newAppendFlag)
Allows to set the append option.
Definition: DPMBase.cc:544
virtual void writeOutputFiles()
Writes the simulation data onto all the files i.e. .data, .ene, .fstat ...
Definition: DPMBase.cc:1848
void setSystemDimensions(unsigned int newDim)
Allows for the dimension of the simulation to be changed.
Definition: DPMBase.cc:453
virtual void outputXBallsDataParticle(const unsigned int i, const unsigned int format, std::ostream &os) const
This function writes out the particle locations into an output stream in a format the XBalls program ...
void setGravity(Vec3D newGravity)
Allows to modify the gravity vector.
Definition: DPMBase.cc:431
virtual void outputXBallsData(std::ostream &os) const
This function writes the location of the walls and particles in a format the XBalls program can read...
Definition: DPMBase.cc:947
virtual bool getHGridUpdateEachTimeStep() const
Definition: DPMBase.cc:647
bool rotation_
A flag to turn on/off particle rotation.
Definition: DPMBase.h:831
Mdouble zMax_
If the length of the problem domain in z-direction is ZMax - ZMin, the above variable stores ZMax...
Definition: DPMBase.h:781
bool restarted_
A bool to check if the simulation was restarted or not.
Definition: DPMBase.h:820
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
Definition: DPMBase.cc:231
void setRotation(bool newRotFlag)
Allows to set the flag for enabling or disabling particle rotation in the simulations.
Definition: DPMBase.cc:210
virtual void processStatistics(bool usethese UNUSED)
no implementation but can be overidden in its derived classes.
Definition: DPMBase.cc:703
bool findNextExistingDataFile(Mdouble tMin, bool verbose=true)
Useful when fileType is chosen as Multiple Files or Multiple files with padded.
Definition: DPMBase.cc:1191
void setYMax(Mdouble newYMax)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMax...
Definition: DPMBase.cc:324
unsigned int systemDimensions_
The dimensions of the simulation i.e. 2D or 3D.
Definition: DPMBase.h:735
This is a class that generates random numbers i.e. named the Random Number Generator (RNG)...
Definition: RNG.h:52
Mdouble zMin_
If the length of the problem domain in z-direction is ZMax - ZMin, the above variable stores ZMin...
Definition: DPMBase.h:775
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:552
Mdouble xMax_
If the length of the problem domain in x-direction is XMax - XMin, the above variable stores XMax...
Definition: DPMBase.h:757
unsigned int ntimeSteps_
Stores the number of time steps.
Definition: DPMBase.h:791
virtual void writeEneTimestep(std::ostream &os) const
This function enables one to write the global energy available in the system after each time step...
Definition: DPMBase.cc:912
virtual void hGridActionsBeforeIntegration()
no implementation but can be overidden in its derived classes.
Definition: DPMBase.cc:724
int readRestartFile()
Reads all the particle data corresponding to the current saved time step. Which is what the restart f...
Definition: DPMBase.cc:1375
void initialiseTangentialSprings()
bool getAppend() const
Returns the flag denoting if the append option is on or off.
Definition: DPMBase.cc:536
virtual bool readNextArgument(int &i, int argc, char *argv[])
Definition: DPMBase.cc:2057
virtual bool checkParticleForInteraction(const BaseParticle &P)
Checks if the particle having any interaction with walls or other particles.
Definition: DPMBase.cc:2353
bool getRestarted() const
Returns the flag denoting if the simulation was restarted or not.
Definition: DPMBase.cc:519
int xBallsColourMode_
XBalls is a package to view the particle data. As an alternative MercuryDPM also supports Paraview...
Definition: DPMBase.h:839
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Definition: DPMBase.h:888
Mdouble xBallsScale_
sets the xballs argument scale (see XBalls/xballs.txt)
Definition: DPMBase.h:849
void setXMin(Mdouble newXMin)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMin...
Definition: DPMBase.cc:266
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:878
Container to store Interaction objects.
unsigned int getNtimeSteps() const
Returns the current counter of time steps.
Definition: DPMBase.cc:165
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:563
Mdouble time_
Stores the current simulation time.
Definition: DPMBase.h:786
void setRestartVersion(std::string newRV)
Sets restart_version.
Definition: DPMBase.cc:510
Vec3D getGravity() const
Returns the gravity vector.
Definition: DPMBase.cc:438
void checkSettings()
Checks if the essentials are set properly to go ahead with solving the problem.
Definition: DPMBase.cc:1824
#define UNUSED
Definition: GeneralDefine.h:37
virtual void hGridActionsBeforeTimeLoop()
A virtual function that allows one to carry out hGrid operations before the start of the time loop...
Definition: DPMBase.cc:605
virtual void writeXBallsScript() const
This writes a script which can be used to load the xballs problem to display the data just generated...
bool readParAndIniFiles(const std::string fileName)
Allows the user to read par.ini files (useful to read MDCLR files)
Definition: DPMBase.cc:1018
virtual void computeAllForces()
Computes all the forces acting on the particles by using the setTorque and setForce methods...
Definition: DPMBase.cc:1586
bool readNextDataFile(unsigned int format=0)
Reads the next data file with default format=0. However, one can modify the format based on whether t...
Definition: DPMBase.cc:1224
void setZMin(Mdouble newZMin)
If the length of the problem domain in z-direction is ZMax - ZMin, this method sets ZMin...
Definition: DPMBase.cc:295
virtual void actionsAfterSolve()
A virtual function which allows to define operations to be executed after the solve().
Definition: DPMBase.cc:662
virtual void printTime() const
Displays the current simulation time onto your screen for example.
Definition: DPMBase.cc:758
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
Definition: DPMBase.h:868
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:893
void outputInteractionDetails() const
Displays the interaction details corresponding to the pointer objects in the interaction handler...
Definition: DPMBase.cc:2424
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:403
Container to store all BaseParticle.
void setFixedParticles(unsigned int n)
Definition: DPMBase.cc:749
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
Definition: DPMBase.cc:245
Mdouble xBallsVectorScale_
sets the xballs argument vscale (see XBalls/xballs.txt)
Definition: DPMBase.h:844
Mdouble xMin_
If the length of the problem domain in x-direction is XMax - XMin, the above variable stores XMin...
Definition: DPMBase.h:751
virtual void actionsBeforeTimeStep()
A virtual function which allows to define operations to be executed before the new time step...
Definition: DPMBase.cc:655
Mdouble timeStep_
Stores the simulation time step.
Definition: DPMBase.h:796
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:883
Container to store all BaseWall.
Definition: WallHandler.h:42
RNG random
This is a random generator, often used for setting up the initial conditions etc...
Definition: DPMBase.h:873
virtual void hGridRemoveParticle(BaseParticle *obj UNUSED)
no implementation but can be overidden in its derived classes.
Definition: DPMBase.cc:640
virtual double getInfo(const BaseParticle &P) const
A virtual method that allows the user to overrride and set what is written into the info column in th...
Definition: DPMBase.cc:580
virtual void actionsOnRestart()
A virtual function where the users can add extra code which is executed only when the code is restart...
Definition: DPMBase.cc:612
Manages the linked list of PossibleContact.
virtual void writeEneHeader(std::ostream &os) const
Writes a header with a certain format for ENE file.
Definition: DPMBase.cc:840
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin...
Definition: DPMBase.cc:252
void gatherContactStatistics()
Definition: DPMBase.cc:687
virtual void outputStatistics()
no implementation but can be overidden in its derived classes.
Definition: DPMBase.cc:683
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
Definition: DPMBase.cc:353
void removeDuplicatePeriodicParticles()
Removes periodic duplicate Particles.
Definition: DPMBase.cc:2394
virtual void integrateBeforeForceComputation()
This is were the integration is done, at the moment it is velocity Verlet integration and is done bef...
Definition: DPMBase.cc:1495
virtual void writeRestartFile()
Stores all the particle data for current save time step. Calls the write function.
Definition: DPMBase.cc:1365
std::string xBallsAdditionalArguments_
A string of additional arguments for xballs can be specified (see XBalls/xballs.txt). e.g. "-solidf -v0".
Definition: DPMBase.h:854
double getXBallsVectorScale() const
Returns the scale of vectors used in xballs.
Definition: DPMBase.cc:396
virtual bool continueSolve() const
Definition: DPMBase.cc:769
It is publicly inherited from class Files. It defines an awesome feature that is ideal when doing a p...
virtual void hGridUpdateMove(BaseParticle *, Mdouble)
no implementation but can be overidden in its derived classes.
Definition: DPMBase.cc:717
virtual void computeForcesDueToWalls(BaseParticle *PI)
Computes the forces on the particles due to the walls (normals are outward normals) ...
Definition: DPMBase.cc:1465
std::string restartVersion_
Previous versions of MercuryDPM had a different restart file format, the below member variable allows...
Definition: DPMBase.h:815
friend std::ostream & operator<<(std::ostream &os, const DPMBase &md)
Operator overloading of DPMBase class.
void setRestarted(bool newRestartedFlag)
Allows to set the flag stating if the simulation is to be restarted or not.
Definition: DPMBase.cc:527
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
std::string getXBallsAdditionalArguments() const
Definition: DPMBase.cc:410
void setDoCGAlways(bool newDoCGFlag)
virtual void hGridActionsAfterIntegration()
no implementation but can be overidden in its derived classes.
Definition: DPMBase.cc:731
bool getDoCGAlways() const
Mdouble getTimeStep() const
Allows the time step dt to be accessed.
Definition: DPMBase.cc:368
double getXBallsScale() const
Returns the scale of the view in xballs.
Definition: DPMBase.cc:424
virtual void hGridActionsBeforeTimeStep()
A virtual function that allows one to set or execute hGrid parameters or operations before every simu...
Definition: DPMBase.cc:619
void setXBallsScale(Mdouble newScale)
Sets the scale of the view (either normal, zoom in or zoom out) to display in xballs. The default is fit to screen.
Definition: DPMBase.cc:417
bool getRotation() const
Returns a flag indicating if particle rotation is enabled or disabled.
Definition: DPMBase.cc:217
virtual void finishStatistics()
no implementation but can be overidden in its derived classes.
Definition: DPMBase.cc:710
virtual void broadPhase(BaseParticle *i)
By broad one means to screen and determine an approximate number of particles that a given particle c...
Definition: DPMBase.cc:738
Mdouble getTime() const
Access function for the time.
Definition: DPMBase.cc:158
virtual void checkInteractionWithBoundaries()
There are a range of boundaries one could implement depending on ones' problem. This methods checks f...
Definition: DPMBase.cc:1509
virtual void writeFstatHeader(std::ostream &os) const
Writes a header with a certain format for FStat file.
Definition: DPMBase.cc:861
virtual void read(std::istream &is)
Reads all particle data into a restart file.
Definition: DPMBase.cc:1695
Mdouble getTimeMax() const
Allows the user to access the total simulation time during the simulation. Cannot change it though...
Definition: DPMBase.cc:194
DPMBase()
Constructor that calls the "void constructor()".
Definition: DPMBase.cc:135
Vec3D gravity_
Gravity vector.
Definition: DPMBase.h:745
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: DPMBase.cc:833
bool append_
A flag to determine if the file has to be appended or not. See DPMBase::Solve() for example...
Definition: DPMBase.h:826
virtual void computeExternalForces(BaseParticle *PI)
Computes the external forces acting on particles (e.g. gravitational)
Definition: DPMBase.cc:1451
std::string getRestartVersion() const
This is to take into account for different Mercury versions. Returns the version of the restart file...
Definition: DPMBase.cc:501
bool isTimeEqualTo(Mdouble time) const
Checks if the input variable "time" is the current time in the simulation.
Definition: DPMBase.cc:2446