revision: v0.14
FlowRule Class Reference
+ Inheritance diagram for FlowRule:

Public Member Functions

void launch (bool startfast=false)
 
void run (std::vector< Mdouble > study_num, int argc, char *argv[])
 
void setName ()
 
void run (int argc, char *argv[])
 
void create_inflow_particle ()
 
void setPolydispersity (double Polydispersity)
 
void setDensityVariation (double Densityvariation)
 Changes density of (small) species 0. More...
 
double getDensityVariation ()
 
double getPolydispersity ()
 
void launch (bool startfast=false)
 
void run (std::vector< Mdouble > studyNumber, int argc, char *argv[])
 
void launch (bool startfast=false)
 
void run (std::vector< Mdouble > studyNumber, int argc, char *argv[])
 
void writeRestartFile ()
 Stores all the particle data for current save time step to a "restart" file, which is a file simply intended to store all the information necessary to "restart" a simulation from a given time step (see also MercuryDPM.org for more information on restart files). More...
 
void setname ()
 
void run (int argc, char *argv[])
 
void create_inflow_particle ()
 
void set_Polydispersity (Mdouble Polydispersity)
 
void set_Densityvariation (Mdouble Densityvariation)
 Changes density of (small) species 0. More...
 
Mdouble get_Densityvariation ()
 
Mdouble get_Polydispersity ()
 
void launch (bool startfast=false)
 
void run (vector< int > study_num, int argc, char *argv[])
 
void launch (bool startfast=false)
 
void writeRestartFile ()
 Stores all the particle data for current save time step to a "restart" file, which is a file simply intended to store all the information necessary to "restart" a simulation from a given time step (see also MercuryDPM.org for more information on restart files). More...
 
void run (vector< Mdouble > study_num, int argc, char *argv[])
 
void launch (bool startfast=false)
 
void writeRestartFile ()
 Stores all the particle data for current save time step to a "restart" file, which is a file simply intended to store all the information necessary to "restart" a simulation from a given time step (see also MercuryDPM.org for more information on restart files). More...
 
void run (vector< double > study_num, int argc, char *argv[])
 
void launch (bool startfast=false)
 
void writeRestartFile ()
 Stores all the particle data for current save time step to a "restart" file, which is a file simply intended to store all the information necessary to "restart" a simulation from a given time step (see also MercuryDPM.org for more information on restart files). More...
 
void run (vector< double > study_num, int argc, char *argv[])
 
 FlowRule ()
 
void computeInternalForces (int PI, int PJ)
 
void launch (bool startfast=false)
 
void writeRestartFile ()
 Stores all the particle data for current save time step to a "restart" file, which is a file simply intended to store all the information necessary to "restart" a simulation from a given time step (see also MercuryDPM.org for more information on restart files). More...
 
void run (vector< Mdouble > study_num, int argc, char *argv[])
 
void createBottom ()
 Creates the chute bottom, which can be either flat or one of three flavours of rough. More...
 
- Public Member Functions inherited from SilbertPeriodic
 SilbertPeriodic ()
 
virtual void createBaseSpecies ()
 
void set_study (int study_num)
 
void actionsBeforeTimeStep () override
 A virtual function which allows to define operations to be executed before the new time step. More...
 
void setupInitialConditions () override
 This function allows to set the initial conditions for our problem to be solved, by default particle locations are randomly set. Remember particle properties must also be defined here. More...
 
void add_flow_particles ()
 
void create_inflow_particle ()
 
void set_H (Mdouble new_)
 
Mdouble get_H ()
 
void printTime () const override
 Displays the current simulation time and the maximum simulation duration. More...
 
int getNCreated () const
 
void increaseNCreated ()
 
 SilbertPeriodic ()
 
Mdouble getSlidingFrictionCoefficientBottom ()
 
void setSlidingFrictionCoefficientBottom (Mdouble new_)
 
virtual void createBaseSpecies ()
 
void set_study ()
 
void set_study (int study_num)
 
void set_study (std::vector< int > study_num)
 
void actionsBeforeTimeStep ()
 A virtual function which allows to define operations to be executed before the new time step. More...
 
void setupInitialConditions ()
 This function allows to set the initial conditions for our problem to be solved, by default particle locations are randomly set. Remember particle properties must also be defined here. More...
 
void add_flow_particles ()
 
void create_inflow_particle ()
 
void set_H (double new_)
 
double get_H ()
 
void printTime () const
 Displays the current simulation time and the maximum simulation duration. More...
 
bool readNextArgument (int &i, int argc, char *argv[])
 Interprets the i^th command-line argument. More...
 
int getNCreated () const
 
void increaseNCreated ()
 
 SilbertPeriodic ()
 
void fix_hgrid ()
 
double getSlidingFrictionCoefficientBottom ()
 
void setSlidingFrictionCoefficientBottom (double new_)
 
void createBaseSpecies ()
 
void set_study ()
 
void set_study (int study_num)
 
void set_study (vector< int > study_num)
 
void actionsBeforeTimeStep ()
 A virtual function which allows to define operations to be executed before the new time step. More...
 
void setupInitialConditions ()
 This function allows to set the initial conditions for our problem to be solved, by default particle locations are randomly set. Remember particle properties must also be defined here. More...
 
void add_flow_particles ()
 
void create_inflow_particle ()
 
void set_H (double new_)
 
double get_H ()
 
void printTime ()
 
int readNextArgument (unsigned int &i, unsigned int &argc, char *argv[])
 
 SilbertPeriodic ()
 
void fix_hgrid ()
 
Mdouble getSlidingFrictionCoefficientBottom ()
 
void setSlidingFrictionCoefficientBottom (Mdouble new_)
 
virtual void createBaseSpecies ()
 
void set_study ()
 
void set_study (int study_num)
 
void set_study (vector< int > study_num)
 
void actionsBeforeTimeStep ()
 A virtual function which allows to define operations to be executed before the new time step. More...
 
void setupInitialConditions ()
 This function allows to set the initial conditions for our problem to be solved, by default particle locations are randomly set. Remember particle properties must also be defined here. More...
 
void add_flow_particles ()
 
void create_inflow_particle ()
 
void set_H (Mdouble new_)
 
Mdouble get_H ()
 
void printTime ()
 
int readNextArgument (unsigned int &i, unsigned int argc, char *argv[])
 
 SilbertPeriodic ()
 
Mdouble getSlidingFrictionCoefficientBottom ()
 
void setSlidingFrictionCoefficientBottom (Mdouble new_)
 
virtual void createBaseSpecies ()
 
void set_study ()
 
void set_study (int study_num)
 
virtual void actionsBeforeTimeStep ()
 A virtual function which allows to define operations to be executed before the new time step. More...
 
void setupInitialConditions ()
 This function allows to set the initial conditions for our problem to be solved, by default particle locations are randomly set. Remember particle properties must also be defined here. More...
 
void add_flow_particles ()
 
void create_inflow_particle ()
 
void set_H (Mdouble new_)
 
Mdouble get_H ()
 
void printTime () const
 Displays the current simulation time and the maximum simulation duration. More...
 
bool readNextArgument (int &i, int argc, char *argv[])
 Interprets the i^th command-line argument. More...
 
int getNCreated () const
 
void increaseNCreated ()
 
- Public Member Functions inherited from Chute
 Chute ()
 This is the default constructor. All it does is set sensible defaults. More...
 
 Chute (const DPMBase &other)
 Copy constructor, converts an existing DPMBase problem into a Chute problem. More...
 
 Chute (const MercuryBase &other)
 Copy constructor, converts an existing MercuryBase problem into a Chute problem. More...
 
 Chute (const Mercury3D &other)
 Copy constructor, converts an existing Mercury3D problem into a Chute problem. More...
 
 Chute (const Chute &other)
 Default copy constructor. More...
 
void constructor ()
 This is the actual constructor METHOD; it is called by all constructors above (except the default copy constructor). More...
 
bool readNextArgument (int &i, int argc, char *argv[]) override
 This method can be used for reading object properties from a string. More...
 
void setupSideWalls ()
 Creates chute side walls (either solid or periodic) More...
 
void makeChutePeriodic ()
 This makes the chute periodic in Y. More...
 
bool getIsPeriodic () const
 Returns whether the chute is periodic in Y. More...
 
void setupInitialConditions () override
 Creates bottom, side walls and a particle insertion boundary. More...
 
void read (std::istream &is, ReadOptions opt=ReadOptions::ReadAll) override
 Reads all chute properties from an istream. More...
 
void write (std::ostream &os, bool writeAllParticles=true) const override
 This function writes the Chute properties to an ostream, and adds the properties of ALL chute particles as well. More...
 
void setFixedParticleRadius (Mdouble fixedParticleRadius)
 Sets the particle radius of the fixed particles which constitute the (rough) chute bottom. More...
 
Mdouble getFixedParticleRadius () const
 Returns the particle radius of the fixed particles which constitute the (rough) chute bottom. More...
 
void setRoughBottomType (RoughBottomType roughBottomType)
 Sets the type of rough bottom of the chute. More...
 
void setRoughBottomType (std::string roughBottomTypeString)
 Sets the type of rough bottom of the chute, using a string with the EXACT enum type as input. More...
 
RoughBottomType getRoughBottomType () const
 Returns the type of (rough) bottom of the chute. More...
 
void setChuteAngle (Mdouble chuteAngle)
 Sets gravity vector according to chute angle (in degrees) More...
 
void setChuteAngleAndMagnitudeOfGravity (Mdouble chuteAngle, Mdouble gravity)
 Sets gravity vector according to chute angle (in degrees) More...
 
Mdouble getChuteAngle () const
 Returns the chute angle (in radians) More...
 
Mdouble getChuteAngleDegrees () const
 Returns the chute angle (in degrees) More...
 
void setMaxFailed (unsigned int maxFailed)
 Sets the number of times a particle will be tried to be added to the insertion boundary. More...
 
unsigned int getMaxFailed () const
 Returns the number of times a particle will be tried to be added to the insertion boundary. More...
 
void setInflowParticleRadius (Mdouble inflowParticleRadius)
 Sets the radius of the inflow particles to a single one (i.e. ensures a monodisperse inflow). More...
 
void setInflowParticleRadius (Mdouble minInflowParticleRadius, Mdouble maxInflowParticleRadius)
 Sets the minimum and maximum radius of the inflow particles. More...
 
void setMinInflowParticleRadius (Mdouble minInflowParticleRadius)
 sets the minimum radius of inflow particles More...
 
void setMaxInflowParticleRadius (Mdouble maxInflowParticleRadius)
 Sets the maximum radius of inflow particles. More...
 
Mdouble getInflowParticleRadius () const
 Returns the average radius of inflow particles. More...
 
Mdouble getMinInflowParticleRadius () const
 returns the minimum radius of inflow particles More...
 
Mdouble getMaxInflowParticleRadius () const
 Returns the maximum radius of inflow particles. More...
 
void setInflowHeight (Mdouble inflowHeight)
 Sets maximum inflow height (Z-direction) More...
 
Mdouble getInflowHeight () const
 Returns the maximum inflow height (Z-direction) More...
 
void setInflowVelocity (Mdouble inflowVelocity)
 Sets the average inflow velocity. More...
 
Mdouble getInflowVelocity () const
 Returns the average inflow velocity. More...
 
void setInflowVelocityVariance (Mdouble inflowVelocityVariance)
 Sets the inflow velocity variance. More...
 
Mdouble getInflowVelocityVariance () const
 Returns the inflow velocity variance. More...
 
void setChuteWidth (Mdouble chuteWidth)
 Sets the chute width (Y-direction) More...
 
Mdouble getChuteWidth () const
 Returns the chute width (Y-direction) More...
 
virtual void setChuteLength (Mdouble chuteLength)
 Sets the chute length (X-direction) More...
 
Mdouble getChuteLength () const
 Returns the chute length (X-direction) More...
 
void setInsertionBoundary (InsertionBoundary *insertionBoundary)
 Sets the chute insertion boundary. More...
 
- Public Member Functions inherited from Mercury3D
 Mercury3D ()
 This is the default constructor. All it does is set sensible defaults. More...
 
 Mercury3D (const DPMBase &other)
 Copy-constructor for creates an Mercury3D problem from an existing MD problem. More...
 
 Mercury3D (const Mercury3D &other)
 Copy-constructor. More...
 
void constructor ()
 Function that sets the SystemDimension and ParticleDimension to 3. More...
 
std::vector< BaseParticle * > hGridFindParticleContacts (const BaseParticle *obj) override
 Returns all particles that have a contact with a given particle. More...
 
- Public Member Functions inherited from MercuryBase
 MercuryBase ()
 This is the default constructor. It sets sensible defaults. More...
 
 ~MercuryBase () override
 This is the default destructor. More...
 
 MercuryBase (const MercuryBase &mercuryBase)
 Copy-constructor. More...
 
void constructor ()
 This is the actual constructor, it is called do both constructors above. More...
 
void hGridActionsBeforeTimeLoop () override
 This sets up the broad phase information, has to be done at this stage because it requires the particle size. More...
 
void hGridActionsBeforeTimeStep () override
 Performs all necessary actions before a time-step, like updating the particles and resetting all the bucket information, etc. More...
 
void read (std::istream &is, ReadOptions opt=ReadOptions::ReadAll) override
 Reads the MercuryBase from an input stream, for example a restart file. More...
 
void write (std::ostream &os, bool writeAllParticles=true) const override
 Writes all data into a restart file. More...
 
Mdouble getHGridCurrentMaxRelativeDisplacement () const
 Returns hGridCurrentMaxRelativeDisplacement_. More...
 
Mdouble getHGridTotalCurrentMaxRelativeDisplacement () const
 Returns hGridTotalCurrentMaxRelativeDisplacement_. More...
 
void setHGridUpdateEachTimeStep (bool updateEachTimeStep)
 Sets whether or not the HGrid must be updated every time step. More...
 
bool getHGridUpdateEachTimeStep () const final
 Gets whether or not the HGrid is updated every time step. More...
 
void setHGridMaxLevels (unsigned int HGridMaxLevels)
 Sets the maximum number of levels of the HGrid in this MercuryBase. More...
 
unsigned int getHGridMaxLevels () const
 Gets the maximum number of levels of the HGrid in this MercuryBase. More...
 
HGridMethod getHGridMethod () const
 Gets whether the HGrid in this MercuryBase is BOTTOMUP or TOPDOWN. More...
 
void setHGridMethod (HGridMethod hGridMethod)
 Sets the HGridMethod to either BOTTOMUP or TOPDOWN. More...
 
HGridDistribution getHGridDistribution () const
 Gets how the sizes of the cells of different levels are distributed. More...
 
void setHGridDistribution (HGridDistribution hGridDistribution)
 Sets how the sizes of the cells of different levels are distributed. More...
 
Mdouble getHGridCellOverSizeRatio () const
 Gets the ratio of the smallest cell over the smallest particle. More...
 
void setHGridCellOverSizeRatio (Mdouble cellOverSizeRatio)
 Sets the ratio of the smallest cell over the smallest particle. More...
 
bool hGridNeedsRebuilding ()
 Gets if the HGrid needs rebuilding before anything else happens. More...
 
virtual unsigned int getHGridTargetNumberOfBuckets () const
 Gets the desired number of buckets, which is the maximum of the number of particles and 10. More...
 
virtual Mdouble getHGridTargetMinInteractionRadius () const
 Gets the desired size of the smallest cells of the HGrid. More...
 
virtual Mdouble getHGridTargetMaxInteractionRadius () const
 Gets the desired size of the largest cells of the HGrid. More...
 
bool checkParticleForInteraction (const BaseParticle &P) final
 Checks if given BaseParticle has an interaction with a BaseWall or other BaseParticle. More...
 
bool checkParticleForInteractionLocal (const BaseParticle &P) final
 Checks if the given BaseParticle has an interaction with a BaseWall or other BaseParticles in a local domain. More...
 
virtual Mdouble userHGridCellSize (unsigned int level)
 Virtual function that enables inheriting classes to implement a function to let the user set the cell size of the HGrid. More...
 
void hGridInfo (std::ostream &os=std::cout) const
 Writes the info of the HGrid to the screen in a nice format. More...
 
- Public Member Functions inherited from DPMBase
void constructor ()
 A function which initialises the member variables to default values, so that the problem can be solved off the shelf; sets up a basic two dimensional problem which can be solved off the shelf. It is called in the constructor DPMBase(). More...
 
 DPMBase ()
 Constructor that calls the "void constructor()". More...
 
 DPMBase (const DPMBase &other)
 Copy constructor type-2. More...
 
virtual ~DPMBase ()
 virtual destructor More...
 
void autoNumber ()
 The autoNumber() function calls three functions: setRunNumber(), readRunNumberFromFile() and incrementRunNumberInFile(). More...
 
std::vector< intget1DParametersFromRunNumber (int size_x) const
 This turns a counter into 1 index, which is a useful feature for performing 1D parameter study. The index run from 1:size_x, while the study number starts at 0 (initially the counter=1 in COUNTER_DONOTDEL) More...
 
std::vector< intget2DParametersFromRunNumber (int size_x, int size_y) const
 This turns a counter into 2 indices which is a very useful feature for performing a 2D study. The indices run from 1:size_x and 1:size_y, while the study number starts at 0 ( initially the counter=1 in COUNTER_DONOTDEL) More...
 
std::vector< intget3DParametersFromRunNumber (int size_x, int size_y, int size_z) const
 This turns a counter into 3 indices, which is a useful feature for performing a 3D parameter study. The indices run from 1:size_x, 1:size_y and 1:size_z, while the study number starts at 0 ( initially the counter=1 in COUNTER_DONOTDEL) More...
 
int launchNewRun (const char *name, bool quick=false)
 This launches a code from within this code. Please pass the name of the code to run. More...
 
void setRunNumber (int runNumber)
 This sets the counter/Run number, overriding the defaults. More...
 
int getRunNumber () const
 This returns the current value of the counter (runNumber_) More...
 
virtual void decompose ()
 Sends particles from processorId to the root processor. More...
 
void solve ()
 The work horse of the code. More...
 
virtual void computeOneTimeStep ()
 Performs everything needed for one time step, used in the time-loop of solve(). More...
 
void checkSettings ()
 Checks if the essentials are set properly to go ahead with solving the problem. More...
 
void forceWriteOutputFiles ()
 Writes output files immediately, even if the current time step was not meant to be written. Also resets the last saved time step. More...
 
virtual void writeOutputFiles ()
 Writes simulation data to all the main Mercury files: .data, .ene, .fstat, .xballs and .restart (see the Mercury website for more details regarding these files). More...
 
void solve (int argc, char *argv[])
 The work horse of the code. Can handle flags from the command line. More...
 
virtual void writeXBallsScript () const
 This writes a script which can be used to load the xballs problem to display the data just generated. More...
 
virtual Mdouble getInfo (const BaseParticle &P) const
 A virtual function that returns some user-specified information about a particle. More...
 
ParticleVtkWritergetVtkWriter () const
 
void writeDataFile ()
 
void writeEneFile ()
 
void writeFStatFile ()
 
void fillDomainWithParticles (unsigned N=50)
 
bool readRestartFile (ReadOptions opt=ReadOptions::ReadAll)
 Reads all the particle data corresponding to a given, existing . restart file (for more details regarding restart files, refer to the training materials on the MercuryDPM website).Returns true if it is successful, false otherwise. More...
 
int readRestartFile (std::string fileName, ReadOptions opt=ReadOptions::ReadAll)
 The same as readRestartFile(bool), but also reads all the particle data corresponding to the current saved time step. More...
 
virtual BaseWallreadUserDefinedWall (const std::string &type) const
 Allows you to read in a wall defined in a Driver directory; see USER/Luca/ScrewFiller. More...
 
virtual void readOld (std::istream &is)
 Reads all data from a restart file, e.g. domain data and particle data; old version. More...
 
bool readDataFile (std::string fileName="", unsigned int format=0)
 This allows particle data to be reloaded from data files. More...
 
bool readParAndIniFiles (std::string fileName)
 Allows the user to read par.ini files (useful to read files produced by the MDCLR simulation code - external to MercuryDPM) More...
 
bool readNextDataFile (unsigned int format=0)
 Reads the next data file with default format=0. However, one can modify the format based on whether the particle data corresponds to 3D or 2D data- see Visualising data in xballs. More...
 
void readNextFStatFile ()
 Reads the next fstat file. More...
 
bool findNextExistingDataFile (Mdouble tMin, bool verbose=true)
 Finds and opens the next data file, if such a file exists. More...
 
bool readArguments (int argc, char *argv[])
 Can interpret main function input arguments that are passed by the driver codes. More...
 
bool checkParticleForInteractionLocalPeriodic (const BaseParticle &P)
 
void readSpeciesFromDataFile (bool read=true)
 
void importParticlesAs (ParticleHandler &particleHandler, InteractionHandler &interactionHandler, const ParticleSpecies *species)
 Copies particles, interactions assigning species from a local simulation to a global one. Useful for the creation of a cluster. More...
 
MERCURY_DEPRECATED FilegetDataFile ()
 The non const version. Allows one to edit the File::dataFile. More...
 
MERCURY_DEPRECATED FilegetEneFile ()
 The non const version. Allows to edit the File::eneFile. More...
 
MERCURY_DEPRECATED FilegetFStatFile ()
 The non const version. Allows to edit the File::fStatFile. More...
 
MERCURY_DEPRECATED FilegetRestartFile ()
 The non const version. Allows to edit the File::restartFile. More...
 
MERCURY_DEPRECATED FilegetStatFile ()
 The non const version. Allows to edit the File::statFile. More...
 
FilegetInteractionFile ()
 Return a reference to the file InteractionsFile. More...
 
MERCURY_DEPRECATED const FilegetDataFile () const
 The const version. Does not allow for any editing of the File::dataFile. More...
 
MERCURY_DEPRECATED const FilegetEneFile () const
 The const version. Does not allow for any editing of the File::eneFile. More...
 
MERCURY_DEPRECATED const FilegetFStatFile () const
 The const version. Does not allow for any editing of the File::fStatFile. More...
 
MERCURY_DEPRECATED const FilegetRestartFile () const
 The const version. Does not allow for any editing of the File::restartFile. More...
 
MERCURY_DEPRECATED const FilegetStatFile () const
 The const version. Does not allow for any editing of the File::statFile. More...
 
const FilegetInteractionFile () const
 
const std::string & getName () const
 Returns the name of the file. Does not allow to change it though. More...
 
void setName (const std::string &name)
 Allows to set the name of all the files (ene, data, fstat, restart, stat) More...
 
void setName (const char *name)
 Calls setName(std::string) More...
 
void setSaveCount (unsigned int saveCount)
 Sets File::saveCount_ for all files (ene, data, fstat, restart, stat) More...
 
void setFileType (FileType fileType)
 Sets File::fileType_ for all files (ene, data, fstat, restart, stat) More...
 
void setOpenMode (std::fstream::openmode openMode)
 Sets File::openMode_ for all files (ene, data, fstat, restart, stat) More...
 
void resetFileCounter ()
 Resets the file counter for each file i.e. for ene, data, fstat, restart, stat) More...
 
void closeFiles ()
 Closes all files (ene, data, fstat, restart, stat) that were opened to read or write. More...
 
void setLastSavedTimeStep (unsigned int nextSavedTimeStep)
 Sets the next time step for all the files (ene, data, fstat, restart, stat) at which the data is to be written or saved. More...
 
Mdouble getTime () const
 Returns the current simulation time. More...
 
Mdouble getNextTime () const
 Returns the current simulation time. More...
 
unsigned int getNumberOfTimeSteps () const
 Returns the current counter of time-steps, i.e. the number of time-steps that the simulation has undergone so far. More...
 
void setTime (Mdouble time)
 Sets a new value for the current simulation time. More...
 
void setTimeMax (Mdouble newTMax)
 Sets a new value for the maximum simulation duration. More...
 
Mdouble getTimeMax () const
 Returns the maximum simulation duration. More...
 
void setLogarithmicSaveCount (Mdouble logarithmicSaveCountBase)
 Sets File::logarithmicSaveCount_ for all files (ene, data, fstat, restart, stat) More...
 
void setNToWrite (int nToWrite)
 set the number of elements to write to the screen More...
 
int getNToWrite () const
 get the number of elements to write to the More...
 
void setRotation (bool rotation)
 Sets whether particle rotation is enabled or disabled. More...
 
bool getRotation () const
 Indicates whether particle rotation is enabled or disabled. More...
 
void setWallsWriteVTK (FileType writeWallsVTK)
 Sets whether walls are written into a VTK file. More...
 
void setWallsWriteVTK (bool)
 Sets whether walls are written into a VTK file. More...
 
void setInteractionsWriteVTK (bool)
 Sets whether interactions are written into a VTK file. More...
 
void setParticlesWriteVTK (bool writeParticlesVTK)
 Sets whether particles are written in a VTK file. More...
 
void setSuperquadricParticlesWriteVTK (bool writeSuperquadricParticlesVTK)
 
FileType getWallsWriteVTK () const
 Returns whether walls are written in a VTK file. More...
 
bool getParticlesWriteVTK () const
 Returns whether particles are written in a VTK file. More...
 
bool getSuperquadricParticlesWriteVTK () const
 
Mdouble getXMin () const
 If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin. More...
 
Mdouble getXMax () const
 If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax. More...
 
Mdouble getYMin () const
 If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin. More...
 
Mdouble getYMax () const
 If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax. More...
 
Mdouble getZMin () const
 If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin. More...
 
Mdouble getZMax () const
 If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax. More...
 
Vec3D getMin () const
 
Vec3D getMax () const
 
void setXMin (Mdouble newXMin)
 Sets the value of XMin, the lower bound of the problem domain in the x-direction. More...
 
void setYMin (Mdouble newYMin)
 Sets the value of YMin, the lower bound of the problem domain in the y-direction. More...
 
void setZMin (Mdouble newZMin)
 Sets the value of ZMin, the lower bound of the problem domain in the z-direction. More...
 
void setXMax (Mdouble newXMax)
 Sets the value of XMax, the upper bound of the problem domain in the x-direction. More...
 
void setYMax (Mdouble newYMax)
 Sets the value of YMax, the upper bound of the problem domain in the y-direction. More...
 
void setZMax (Mdouble newZMax)
 Sets the value of ZMax, the upper bound of the problem domain in the z-direction. More...
 
void setMax (const Vec3D &max)
 Sets the maximum coordinates of the problem domain. More...
 
void setMax (Mdouble, Mdouble, Mdouble)
 Sets the maximum coordinates of the problem domain. More...
 
void setDomain (const Vec3D &min, const Vec3D &max)
 Sets the minimum coordinates of the problem domain. More...
 
void setMin (const Vec3D &min)
 Sets the minimum coordinates of the problem domain. More...
 
void setMin (Mdouble, Mdouble, Mdouble)
 Sets the minimum coordinates of the problem domain. More...
 
void setTimeStep (Mdouble newDt)
 Sets a new value for the simulation time step. More...
 
Mdouble getTimeStep () const
 Returns the simulation time step. More...
 
void setNumberOfOMPThreads (int numberOfOMPThreads)
 
int getNumberOfOMPThreads () const
 
void setXBallsColourMode (int newCMode)
 Set the xballs output mode. More...
 
int getXBallsColourMode () const
 Get the xballs colour mode (CMode). More...
 
void setXBallsVectorScale (double newVScale)
 Set the scale of vectors in xballs. More...
 
double getXBallsVectorScale () const
 Returns the scale of vectors used in xballs. More...
 
void setXBallsAdditionalArguments (std::string newXBArgs)
 Set the additional arguments for xballs. More...
 
std::string getXBallsAdditionalArguments () const
 Returns the additional arguments for xballs. More...
 
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. More...
 
double getXBallsScale () const
 Returns the scale of the view in xballs. More...
 
void setGravity (Vec3D newGravity)
 Sets a new value for the gravitational acceleration. More...
 
Vec3D getGravity () const
 Returns the gravitational acceleration. More...
 
void setDimension (unsigned int newDim)
 Sets both the system dimensions and the particle dimensionality. More...
 
void setSystemDimensions (unsigned int newDim)
 Sets the system dimensionality. More...
 
unsigned int getSystemDimensions () const
 Returns the system dimensionality. More...
 
void setParticleDimensions (unsigned int particleDimensions)
 Sets the particle dimensionality. More...
 
unsigned int getParticleDimensions () const
 Returns the particle dimensionality. More...
 
std::string getRestartVersion () const
 This is to take into account for different Mercury versions. Returns the version of the restart file. More...
 
void setRestartVersion (std::string newRV)
 Sets restart_version. More...
 
bool getRestarted () const
 Returns the flag denoting if the simulation was restarted or not. More...
 
void setRestarted (bool newRestartedFlag)
 Allows to set the flag stating if the simulation is to be restarted or not. More...
 
bool getAppend () const
 Returns whether the "append" option is on or off. More...
 
void setAppend (bool newAppendFlag)
 Sets whether the "append" option is on or off. More...
 
Mdouble getElasticEnergy () const
 Returns the global elastic energy within the system. More...
 
Mdouble getKineticEnergy () const
 Returns the global kinetic energy stored in the system. More...
 
Mdouble getGravitationalEnergy () const
 Returns the global gravitational potential energy stored in the system. More...
 
Mdouble getRotationalEnergy () const
 JMFT Returns the global rotational energy stored in the system. More...
 
Mdouble getTotalEnergy () const
 
Mdouble getTotalMass () const
 JMFT: Return the total mass of the system, excluding fixed particles. More...
 
Vec3D getCentreOfMass () const
 JMFT: Return the centre of mass of the system, excluding fixed particles. More...
 
Vec3D getTotalMomentum () const
 JMFT: Return the total momentum of the system, excluding fixed particles. More...
 
double getCPUTime ()
 
double getWallTime ()
 
virtual void hGridInsertParticle (BaseParticle *obj UNUSED)
 
virtual void hGridUpdateParticle (BaseParticle *obj UNUSED)
 
virtual void hGridRemoveParticle (BaseParticle *obj UNUSED)
 
bool mpiIsInCommunicationZone (BaseParticle *particle)
 Checks if the position of the particle is in an mpi communication zone or not. More...
 
bool mpiInsertParticleCheck (BaseParticle *P)
 Function that checks if the mpi particle should really be inserted by the current domain. More...
 
void insertGhostParticle (BaseParticle *P)
 This function inserts a particle in the mpi communication boundaries. More...
 
void updateGhostGrid (BaseParticle *P)
 Checks if the Domain/periodic interaction distance needs to be updated and updates it accordingly. More...
 
virtual void gatherContactStatistics (unsigned int index1, int index2, Vec3D Contact, Mdouble delta, Mdouble ctheta, Mdouble fdotn, Mdouble fdott, Vec3D P1_P2_normal_, Vec3D P1_P2_tangential)
 //Not unsigned index because of possible wall collisions. More...
 
void setNumberOfDomains (std::vector< unsigned > direction)
 Sets the number of domains in x-,y- and z-direction. Required for parallel computations. More...
 
void splitDomain (DomainSplit domainSplit)
 
std::vector< unsignedgetNumberOfDomains ()
 returns the number of domains More...
 
DomaingetCurrentDomain ()
 Function that returns a pointer to the domain corresponding to the processor. More...
 
void removeOldFiles () const
 
void setMeanVelocity (Vec3D V_mean_goal)
 This function will help you set a fixed kinetic energy and mean velocity in your system. More...
 
void setMeanVelocityAndKineticEnergy (Vec3D V_mean_goal, Mdouble Ek_goal)
 This function will help you set a fixed kinetic energy and mean velocity in your system. More...
 
Mdouble getTotalVolume () const
 Get the total volume of the cuboid system. More...
 
Matrix3D getKineticStress () const
 Calculate the kinetic stress tensor in the system averaged over the whole volume. More...
 
Matrix3D getStaticStress () const
 Calculate the static stress tensor in the system averaged over the whole volume. More...
 
Matrix3D getTotalStress () const
 Calculate the total stress tensor in the system averaged over the whole volume. More...
 
virtual void handleParticleRemoval (unsigned int id)
 Handles the removal of particles from the particleHandler. More...
 
virtual void handleParticleAddition (unsigned int id, BaseParticle *p)
 
void writePythonFileForVTKVisualisation () const
 

Private Member Functions

bool readNextArgument (int &i, int argc, char *argv[]) override
 allows input from the command line
More...
 
int readNextArgument (unsigned int &i, unsigned int argc, char *argv[])
 allows input from the command line More...
 

Private Attributes

double NumberFraction
 number ratio of (large) species 1 More...
 
Mdouble NumberFraction
 number ratio of (large) species 1 More...
 

Additional Inherited Members

- Public Types inherited from DPMBase
enum  ReadOptions : int { ReadOptions::ReadAll, ReadOptions::ReadNoInteractions, ReadOptions::ReadNoParticlesAndInteractions }
 
enum  DomainSplit {
  DomainSplit::X, DomainSplit::Y, DomainSplit::Z, DomainSplit::XY,
  DomainSplit::XZ, DomainSplit::YZ, DomainSplit::XYZ
}
 
- Static Public Member Functions inherited from DPMBase
static void incrementRunNumberInFile ()
 Increment the run Number (counter value) stored in the file_counter (COUNTER_DONOTDEL) by 1 and store the new value in the counter file. More...
 
static int readRunNumberFromFile ()
 Read the run number or the counter from the counter file (COUNTER_DONOTDEL) More...
 
static bool areInContact (const BaseParticle *pI, const BaseParticle *pJ)
 Checks if two particle are in contact or is there any positive overlap. More...
 
- Public Attributes inherited from SilbertPeriodic
int nCreated_
 
bool randomiseSpecies
 
SphericalParticle inflowParticle_
 
LinearViscoelasticSpeciesspecies
 
LinearViscoelasticMixedSpeciesbaseSpecies
 
LinearViscoelasticFrictionSpeciesspecies
 
LinearViscoelasticFrictionMixedSpeciesbaseSpecies
 
- Public Attributes inherited from DPMBase
SpeciesHandler speciesHandler
 A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc. More...
 
RNG random
 This is a random generator, often used for setting up the initial conditions etc... More...
 
ParticleHandler particleHandler
 An object of the class ParticleHandler, contains the pointers to all the particles created. More...
 
ParticleHandler paoloParticleHandler
 Fake particleHandler created by Paolo needed temporary by just Paolo. More...
 
WallHandler wallHandler
 An object of the class WallHandler. Contains pointers to all the walls created. More...
 
BoundaryHandler boundaryHandler
 An object of the class BoundaryHandler which concerns insertion and deletion of particles into or from regions. More...
 
PeriodicBoundaryHandler periodicBoundaryHandler
 Internal handler that deals with periodic boundaries, especially in a parallel build. More...
 
DomainHandler domainHandler
 An object of the class DomainHandler which deals with parallel code. More...
 
InteractionHandler interactionHandler
 An object of the class InteractionHandler. More...
 
CGHandler cgHandler
 Object of the class cgHandler. More...
 
File dataFile
 An instance of class File to handle in- and output into a .data file. More...
 
File fStatFile
 An instance of class File to handle in- and output into a .fstat file. More...
 
File eneFile
 An instance of class File to handle in- and output into a .ene file. More...
 
File restartFile
 An instance of class File to handle in- and output into a .restart file. More...
 
File statFile
 An instance of class File to handle in- and output into a .stat file. More...
 
File interactionFile
 File class to handle in- and output into .interactions file. This file hold information about interactions. More...
 
Time clock_
 record when the simulation started More...
 
- Protected Member Functions inherited from Chute
void actionsBeforeTimeStep () override
 Calls Chute::cleanChute(). More...
 
void cleanChute ()
 Deletes all outflow particles once every 100 time steps. More...
 
virtual void addFlowParticlesCompactly ()
 Add initial flow particles in a dense packing. More...
 
virtual SphericalParticle createFlowParticle ()
 
void printTime () const override
 prints time, max time and number of particles More...
 
- Protected Member Functions inherited from Mercury3D
void hGridFindContactsWithinTargetCell (int x, int y, int z, unsigned int l)
 Finds contacts between particles in the target cell. More...
 
void hGridFindContactsWithTargetCell (int x, int y, int z, unsigned int l, BaseParticle *obj)
 Finds contacts between the BaseParticle and the target cell. More...
 
void computeWallForces (BaseWall *w) override
 Compute contacts with a wall. More...
 
void hGridFindParticlesWithTargetCell (int x, int y, int z, unsigned int l, BaseParticle *obj, std::vector< BaseParticle * > &list)
 Finds particles within target cell and stores them in a list. More...
 
void hGridGetInteractingParticleList (BaseParticle *obj, std::vector< BaseParticle * > &list) override
 Obtains all neighbour particles of a given object, obtained from the hgrid. More...
 
void computeInternalForces (BaseParticle *obj) override
 Finds contacts with the BaseParticle; avoids multiple checks. More...
 
bool hGridHasContactsInTargetCell (int x, int y, int z, unsigned int l, const BaseParticle *obj) const
 Tests if the BaseParticle has contacts with other Particles in the target cell. More...
 
bool hGridHasParticleContacts (const BaseParticle *obj) override
 Tests if a BaseParticle has any contacts in the HGrid. More...
 
void hGridRemoveParticle (BaseParticle *obj) override
 Removes a BaseParticle from the HGrid. More...
 
void hGridUpdateParticle (BaseParticle *obj) override
 Updates the cell (not the level) of a BaseParticle. More...
 
- Protected Member Functions inherited from MercuryBase
void hGridRebuild ()
 This sets up the parameters required for the contact model. More...
 
void hGridInsertParticle (BaseParticle *obj) final
 Inserts a single Particle to current grid. More...
 
void hGridUpdateMove (BaseParticle *iP, Mdouble move) final
 Computes the relative displacement of the given BaseParticle and updates the currentMaxRelativeDisplacement_ accordingly. More...
 
void hGridActionsBeforeIntegration () override
 Resets the currentMaxRelativeDisplacement_ to 0. More...
 
void hGridActionsAfterIntegration () override
 This function has to be called before integrateBeforeForceComputation. More...
 
HGridgetHGrid ()
 Gets the HGrid used by this problem. More...
 
const HGridgetHGrid () const
 Gets the HGrid used by this problem, const version. More...
 
bool readNextArgument (int &i, int argc, char *argv[]) override
 Reads the next command line argument. More...
 
- Protected Member Functions inherited from DPMBase
virtual void computeAllForces ()
 Computes all the forces acting on the particles using the BaseInteractable::setForce() and BaseInteractable::setTorque() More...
 
virtual void computeInternalForce (BaseParticle *, BaseParticle *)
 Computes the forces between two particles (internal in the sense that the sum over all these forces is zero i.e. fully modelled forces) More...
 
virtual void computeExternalForces (BaseParticle *)
 Computes the external forces, such as gravity, acting on particles. More...
 
void computeForcesDueToWalls (BaseParticle *, BaseWall *)
 Computes the forces on the particles due to the walls (normals are outward normals) More...
 
virtual void actionsOnRestart ()
 A virtual function where the users can add extra code which is executed only when the code is restarted. More...
 
virtual void actionsBeforeTimeLoop ()
 A virtual function. Allows one to carry out any operations before the start of the time loop. More...
 
virtual void computeAdditionalForces ()
 A virtual function which allows to define operations to be executed prior to the OMP force collect. More...
 
virtual void actionsAfterSolve ()
 A virtual function which allows to define operations to be executed after the solve(). More...
 
virtual void actionsAfterTimeStep ()
 A virtual function which allows to define operations to be executed after time step. More...
 
void writeVTKFiles () const
 
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. For more information on the XBalls program, see Visualising data in xballs. More...
 
virtual void outputXBallsDataParticle (unsigned int i, unsigned int format, std::ostream &os) const
 This function writes out the particle locations into an output stream in a format the XBalls program can read. For more information on the XBalls program, see Visualising data in xballs. More...
 
virtual void writeEneHeader (std::ostream &os) const
 Writes a header with a certain format for ENE file. More...
 
virtual void writeFstatHeader (std::ostream &os) const
 Writes a header with a certain format for FStat file. More...
 
virtual void writeEneTimeStep (std::ostream &os) const
 Write the global kinetic, potential energy, etc. in the system. More...
 
virtual void initialiseStatistics ()
 
virtual void outputStatistics ()
 
void gatherContactStatistics ()
 
virtual void processStatistics (bool)
 
virtual void finishStatistics ()
 
virtual void integrateBeforeForceComputation ()
 Update particles' and walls' positions and velocities before force computation. More...
 
virtual void integrateAfterForceComputation ()
 Update particles' and walls' positions and velocities after force computation. More...
 
virtual void checkInteractionWithBoundaries ()
 There are a range of boundaries one could implement depending on ones' problem. This methods checks for interactions between particles and such range of boundaries. See BaseBoundary.h and all the boundaries in the Boundaries folder. More...
 
void setFixedParticles (unsigned int n)
 Sets a number, n, of particles in the particleHandler as "fixed particles". More...
 
virtual bool continueSolve () const
 A virtual function for deciding whether to continue the simulation, based on a user-specified criterion. More...
 
void outputInteractionDetails () const
 Displays the interaction details corresponding to the pointer objects in the interaction handler. More...
 
bool isTimeEqualTo (Mdouble time) const
 Checks whether the input variable "time" is the current time in the simulation. More...
 
void removeDuplicatePeriodicParticles ()
 Removes periodic duplicate Particles. More...
 
void checkAndDuplicatePeriodicParticles ()
 For simulations using periodic boundaries, checks and adds particles when necessary into the particle handler. See DPMBase.cc and PeriodicBoundary.cc for more details. More...
 
void performGhostParticleUpdate ()
 When the Verlet scheme updates the positions and velocities of particles, ghost particles will need an update as wel. Their status will also be updated accordingly. More...
 
void deleteGhostParticles (std::set< BaseParticle * > &particlesToBeDeleted)
 
void synchroniseParticle (BaseParticle *, unsigned fromProcessor=0)
 
void performGhostVelocityUpdate ()
 updates the final time-step velocity of the ghost particles More...
 
void setSoftStop ()
 function for setting sigaction constructor. More...
 
- Static Protected Member Functions inherited from DPMBase
static void signalHandler (int signal)
 signal handler function. More...
 

Constructor & Destructor Documentation

◆ FlowRule()

FlowRule::FlowRule ( )
inline
32  {
33  //setStiffness(getStiffness()/5.);
34  //setPlasticParameters(getStiffness(), 5.*getStiffness(), getStiffness(), 0.001);
35  setPlasticParameters(getStiffness(), 5.*getStiffness(), getStiffness(), 0.02);
36  setTimeStep(computePlasticTimeStep(1.0));
37  }

Member Function Documentation

◆ computeInternalForces()

void FlowRule::computeInternalForces ( int  PI,
int  PJ 
)
inline
39  {
40  computePlasticInternalForces(PI, PJ);
41  }

◆ create_inflow_particle() [1/2]

void FlowRule::create_inflow_particle ( )
inline

Sets variable values for particles that are created at the inflow Chooses between small species 0 and large species 1 according to the number fraction

96  {
99  else
103  else
105  //P0.indSpecies_+ = random(0,1)<NumberFraction;
106  //P0.getRadius() = P0.indSpecies_+ ? getMaxInflowParticleRadius() : getMinInflowParticleRadius();
107  //inflowParticle_.computeMass();
108 
109  Vec3D position;
113 
114  inflowParticle_.setPosition(position);
115  inflowParticle_.setVelocity(Vec3D(0.0,0.0,0.0));
116  }

References BaseInteractable::getIndSpecies(), Chute::getInflowHeight(), Chute::getMaxInflowParticleRadius(), Chute::getMinInflowParticleRadius(), BaseHandler< T >::getObject(), BaseParticle::getRadius(), RNG::getRandomNumber(), DPMBase::getXMax(), DPMBase::getXMin(), DPMBase::getYMax(), DPMBase::getYMin(), DPMBase::getZMin(), SilbertPeriodic::inflowParticle_, NumberFraction, DPMBase::random, BaseInteractable::setPosition(), BaseParticle::setRadius(), BaseParticle::setSpecies(), BaseInteractable::setVelocity(), DPMBase::speciesHandler, Vec3D::X, Vec3D::Y, and Vec3D::Z.

◆ create_inflow_particle() [2/2]

void FlowRule::create_inflow_particle ( )
inline

Sets variable values for particles that are created at the inflow Chooses between small species 0 and large species 1 according to the number fraction

88  {
89  P0.indSpecies_+ = random.get_RN(0,1)<NumberFraction;
90  P0.Radius = P0.indSpecies_+ ? getMaxInflowParticleRadius() : getMinInflowParticleRadius();
91  P0.computeMass(Species);
92 
93  P0.Position.X = random.get_RN(getXMin()+2.0*P0.Radius,getXMax());
94  P0.Position.Y = random.get_RN(getYMin()+2.0*P0.Radius,getYMax());
95  P0.Position.Z = random.get_RN(getZMin()+2.0*P0.Radius,getInflowHeight());
96  P0.Velocity = Vec3D(0.0,0.0,0.0);
97  }

◆ createBottom()

void FlowRule::createBottom ( )
inlinevirtual

Creates the chute bottom, which can be either flat or one of three flavours of rough.

Creates the bottom of the chute; either:

  • smooth: fixedParticleRadius_ smaller than 1e-12 or roughBottomType_ == FLAT, monolayered:
  • grid-like: roughBottomType_ == MONOLAYER_ORDERED,
  • random: roughBottomType_ == MONOLAYER_DISORDERED, or
  • multilayer: 'else' (roughBottomType_ == MULTILAYER), with by default contains all particles with a center within a depth band of 2.4 (= ChuteBottom::thickness_) * maxInflowParticleRadius_.
Todo:
Does the bottom we always has to be this particle? Maybe add a BaseParticle* argument, and add a default value with particle radius < 1e-12.

Reimplemented from Chute.

34  {
35  //create random bottom
36  ChuteBottom bottom(*this);
37  bottom.setThickness(1.0);
38  bottom.set_periodicbottom(false);
39  bottom.setInflowParticleRadius(getFixedParticleRadius());
40  bottom.make_rough_bottom(Particles);
41 
42  //add particles
45  //HGridActionsBeforeTimeStep();
46  int failed = 0, max_failed = 1000000;
47  //try max_failed times to find new insertable particle
48  while (failed<=max_failed){
49  P0.Radius = FixedParticleRadius;
50  P0.computeMass(Species);
51  P0.Position.X = random.getRandomNumber(P0.Radius, xmax-P0.Radius);
52  P0.Position.Y = random.getRandomNumber(P0.Radius, getYMax()-P0.Radius);
53  P0.Position.Z = random.getRandomNumber(-bottom.getThickness()*getFixedParticleRadius(), -0.0);
54  P0.Velocity.set_zero();
55  if (IsInsertable(P0))
56  {
57  cout << "Particle added" << endl;
58  failed = 0;
59  num_created++;
60  }
61  else failed++;
62  }
63 
64  //finally, fix particles to the floor
65  for (vector<CParticle>::iterator it= this->Particles.begin(); it!=this->Particles.end(); ++it)
66  it->fixParticle();
67 
68  //now run it quickly
69  setStiffness(2e5);
70  setSlidingStiffness(2.0/7.0*getStiffness());
71  setDissipation(25.0);
72  setSlidingDissipation(getDissipation());
73 
74  Mdouble dist2=1e20;
75  for (unsigned int i=0; i<particleHandler.getNumberOfObjects(); i++)
76  {
77  for (int j=i+1; j<particleHandler.getNumberOfObjects(); j++)
78  {
79  dist2 = min(dist2, GetDistance2(particleHandler.getObject(i)->getPosition(), Particles[j].Position));
80  }
81  }
82  cout << "Dist" << setprecision(10) << dist2 << endl;
83  };

References ChuteBottom::getThickness(), constants::i, Chute::setInflowParticleRadius(), and ChuteBottom::setThickness().

◆ get_Densityvariation()

Mdouble FlowRule::get_Densityvariation ( )
inline
126 {return getDensity(0)/getDensity(1);}

◆ get_Polydispersity()

Mdouble FlowRule::get_Polydispersity ( )
inline

◆ getDensityVariation()

double FlowRule::getDensityVariation ( )
inline

◆ getPolydispersity()

double FlowRule::getPolydispersity ( )
inline

◆ launch() [1/8]

void FlowRule::launch ( bool  startfast = false)
inline
33  {
34  launchNewRun("flowRule",startfast);
35  }

◆ launch() [2/8]

void FlowRule::launch ( bool  startfast = false)
inline
33  {
34  launchNewRun("flowRule",startfast);
35  }

References DPMBase::launchNewRun().

◆ launch() [3/8]

void FlowRule::launch ( bool  startfast = false)
inline
272  {
273  launchNewRun("flowRule",startfast);
274  }

References DPMBase::launchNewRun().

◆ launch() [4/8]

void FlowRule::launch ( bool  startfast = false)
inline
32  {
33  launchNewRun("flowRule",startfast);
34  }

◆ launch() [5/8]

void FlowRule::launch ( bool  startfast = false)
inline
32  {
33  launchNewRun("flowRule",startfast);
34  }

◆ launch() [6/8]

void FlowRule::launch ( bool  startfast = false)
inline
32  {
33  launchNewRun("flowRule",startfast);
34  }

◆ launch() [7/8]

void FlowRule::launch ( bool  startfast = false)
inline
32  {
33  launchNewRun("flowRule",startfast);
34  }

◆ launch() [8/8]

void FlowRule::launch ( bool  startfast = false)
inline
43  {
44  launchNewRun("flowRule",startfast);
45  }

◆ readNextArgument() [1/2]

bool FlowRule::readNextArgument ( int i,
int  argc,
char argv[] 
)
inlineoverrideprivatevirtual

allows input from the command line

Reimplemented from DPMBase.

160  {
161  if (!strcmp(argv[i],"-polydispersity")) {
162  setPolydispersity(atof(argv[i+1]));
163  } else if (!strcmp(argv[i],"-densityvariation")) {
164  setDensityVariation(atof(argv[i+1]));
165  } else return SilbertPeriodic::readNextArgument(i, argc, argv);
166  return true; //returns true if argv[i] is found here
167  }

References constants::i, SilbertPeriodic::readNextArgument(), setDensityVariation(), and setPolydispersity().

◆ readNextArgument() [2/2]

int FlowRule::readNextArgument ( unsigned int i,
unsigned int  argc,
char argv[] 
)
inlineprivate

allows input from the command line

133  {
134  if (!strcmp(argv[i],"-polydispersity")) {
135  set_Polydispersity(atof(argv[i+1]));
136  } else if (!strcmp(argv[i],"-densityvariation")) {
137  set_Densityvariation(atof(argv[i+1]));
138  } else return SilbertPeriodic::readNextArgument(i, argc, argv);
139  return true; //returns true if argv[i] is found here
140  }

References constants::i, and SilbertPeriodic::readNextArgument().

◆ run() [1/10]

void FlowRule::run ( int  argc,
char argv[] 
)
inline
55  {
56  //Set up a parameter study
57  setSaveCount(10000);
58  setTimeMax(2000);
59  restartFile.setFileType(FileType::MULTIPLE_FILES);
60  dataFile.setFileType(FileType::NO_FILE);
61  fStatFile.setFileType(FileType::NO_FILE);
62  eneFile.setFileType(FileType::ONE_FILE);
63  //restartFile.setFileType(FileType::MULTIPLE_FILES_PADDED);
64  //dataFile.setFileType(FileType::NO_FILE);
65  //fStatFile.setFileType(FileType::NO_FILE);
66  //eneFile.setFileType(FileType::ONE_FILE);
67 
68  //1 is the base species
69  NumberFraction = 0.5;
73 
74  readArguments(argc, argv);
75  setName();
76 
77  //Save the info to disk
79 
80  //Check if the run has been done before
82  {
83  //If it has move on to the next run immedently
84  logger(INFO, "Run % has already been done", getName());
85  }
86  else
87  {
88  //launch this code
89  solve();
90  }
91  }

References SilbertPeriodic::createBaseSpecies(), DPMBase::dataFile, DPMBase::eneFile, helpers::fileExists(), DPMBase::fStatFile, DPMBase::getName(), File::getName(), INFO, logger, NumberFraction, DPMBase::readArguments(), DPMBase::restartFile, setDensityVariation(), File::setFileType(), setName(), setPolydispersity(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::solve(), and writeRestartFile().

◆ run() [2/10]

void FlowRule::run ( int  argc,
char argv[] 
)
inline
54  {
55  //Set up a parameter study
56  setSaveCount(1e4);
57  setTimeMax(2000);
59  dataFile.setFileType(FileType::NO_FILE);
60  fStatFile.setFileType(FileType::NO_FILE);
61  eneFile.setFileType(FileType::ONE_FILE);
62 
63  //1 is the base species
64  NumberFraction = 0.5;
68 
69  readArguments(argc, argv);
70  setname();
71 
72  //Save the info to disk
74 
75  //Check if the run has been done before
76  if (FileExists(data_filename.str())) {
77  //If it has move on to the next run immedently
78  cout << "Run " << getName() << " has already been done " << endl;
79  } else {
80  //launch this code
81  solve();
82  }
83  }

References getName(), and NO_FILE.

◆ run() [3/10]

void FlowRule::run ( std::vector< Mdouble study_num,
int  argc,
char argv[] 
)
inline
49  {
50  //Set up a parameter study
51  setInflowHeight(study_num[1]);
52  setChuteAngle(study_num[2]);
53  set_study(study_num[0]);
54  //
55  restartFile.setFileType(FileType::ONE_FILE);//restartFile.setFileType(FileType::ONE_FILE);
56  dataFile.setFileType(FileType::ONE_FILE);
57  fStatFile.setFileType(FileType::ONE_FILE);
58  eneFile.setFileType(FileType::ONE_FILE);
59  readArguments(argc, argv);
60  //set_study();
61 
62  //Save the info to disk
64 
65  //Check if the run has been done before
66  // if (FileExists(data_filename.str())) {
67 // //If it has move on to teh next run immedently
68 // cout << "Run " << getName() << " has already been done " << endl;
69 // } else
70  {
71  //launch this code
72  std::stringstream com("");
73  com << "echo started \tstudy_num \t"
74  << study_num[0] << " "
75  << study_num[1] << " "
76  << study_num[2] << " \tname \t"
77  << getName() << " &>>ReportFlowRule";
78  std::cout << system(com.str().c_str()) << std::endl;
79  std::cout << "started study_num "
80  << study_num[0] << " "
81  << study_num[1] << " "
82  << study_num[2] << ", name "
83  << getName() << std::endl;
84  //new commands to make it 2D
85  setChuteWidth(2);
86  setChuteLength(5);
87  setInflowParticleRadius(0.47,0.53);
88  setSaveCount(2e3);
89  setTimeMax(30);
90  //set_NWallPeriodic(1);
91  //setRoughBottomType(MONOLAYER_ORDERED);
92  solve();
93 
94  com.str("");
95  com << "echo finished \tstudy_num \t"
96  << study_num[0] << " "
97  << study_num[1] << " "
98  << study_num[2] << " \tname \t"
99  << getName() << " &>>ReportFlowRule";
100  std::cout << system(com.str().c_str()) << std::endl;
101  }
102 
103 
104  }

References getName().

Referenced by main().

◆ run() [4/10]

void FlowRule::run ( std::vector< Mdouble studyNumber,
int  argc,
char argv[] 
)
inline
38  {
39  //Set up a parameter study
40  setInflowHeight(studyNumber[1]);
41  setChuteAngle(studyNumber[2]);
42  set_study(studyNumber[0]);
43  readArguments(argc, argv);
44  //set_study();
45 
46  //Save the info to disk
48 
49  //Check if the run has been done before
50  //if (helpers::fileExists(dataFile.getName())) {
51  // //If it has move on to teh next run immedently
52  // std::cout << "Run " << getName() << " has already been done " << std::endl;
53  //} else
54  {
55  //launch this code
56  std::stringstream com("");
57  com << "echo started \tstudyNumber \t"
58  << studyNumber[0] << " "
59  << studyNumber[1] << " "
60  << studyNumber[2] << " \tname \t"
61  << getName() << " &>>ReportFlowRule";
62  //std::cout << system(com.str().c_str()) << std::endl;
63  logger(INFO, "started studyNumber % % %, name %", studyNumber[0], studyNumber[1], studyNumber[2],
64  getName());
65 
66  solve();
67 
68  com.str("");
69  com << "echo finished \tstudyNumber \t"
70  << studyNumber[0] << " "
71  << studyNumber[1] << " "
72  << studyNumber[2] << " \tname \t"
73  << getName() << " &>>ReportFlowRule";
74  //std::cout << system(com.str().c_str()) << std::endl;
75  }
76 
77  //~ //launch next code
78  //~ stringstream com("");
79  //~ com.str("");
80  //~ com << "./flowRule.exe "
81  //~ << studyNumber[0] << " "
82  //~ << studyNumber[1]+1 << " "
83  //~ << studyNumber[2] << " &";
84  //~ cout << studyNumber[1] << com.str() << endl;
85  //~ if (studyNumber[1]<4) system(com.str().c_str());
86  }

References DPMBase::getName(), INFO, logger, DPMBase::readArguments(), SilbertPeriodic::set_study(), Chute::setChuteAngle(), Chute::setInflowHeight(), DPMBase::solve(), and writeRestartFile().

◆ run() [5/10]

void FlowRule::run ( std::vector< Mdouble studyNumber,
int  argc,
char argv[] 
)
inline
277  {
278  //Set up a parameter study
279  setInflowHeight(studyNumber[1]);
280  setChuteAngle(studyNumber[2]);
281  set_study(studyNumber[0]);
282  readArguments(argc, argv);
283  //set_study();
284 
285  //Save the info to disk
287 
288  //Check if the run has been done before
289  //if (helpers::fileExists(dataFile.getName())) {
290  // //If it has move on to teh next run immedently
291  // std::cout << "Run " << getName() << " has already been done " << std::endl;
292  //} else
293  {
294  //launch this code
295  std::stringstream com("");
296  com << "echo started \tstudyNumber \t"
297  << studyNumber[0] << " "
298  << studyNumber[1] << " "
299  << studyNumber[2] << " \tname \t"
300  << getName() << " &>>ReportFlowRule";
301  //std::cout << system(com.str().c_str()) << std::endl;
302  logger(INFO, "started studyNumber % % %, name %",
303  studyNumber[0], studyNumber[1], studyNumber[2], getName());
304 
305  solve();
306 
307  com.str("");
308  com << "echo finished \tstudyNumber \t"
309  << studyNumber[0] << " "
310  << studyNumber[1] << " "
311  << studyNumber[2] << " \tname \t"
312  << getName() << " &>>ReportFlowRule";
313  //std::cout << system(com.str().c_str()) << std::endl;
314  }
315  }

References DPMBase::getName(), INFO, logger, DPMBase::readArguments(), SilbertPeriodic::set_study(), Chute::setChuteAngle(), Chute::setInflowHeight(), DPMBase::solve(), and writeRestartFile().

◆ run() [6/10]

void FlowRule::run ( vector< double study_num,
int  argc,
char argv[] 
)
inline
48  {
49  //Set up a parameter study
50  set_study(study_num[0]);
51  setInflowHeight(study_num[1]);
52  setChuteAngle(study_num[2]);
53  readArguments(argc, argv);
54  set_study();
55 
56  //Save the info to disk
58 
59  //Check if the run has been done before
60  if (FileExists(data_filename.str())) {
61  //If it has move on to teh next run immedently
62  cout << "Run " << getName() << " has already been done " << endl;
63  } else {
64  //launch this code
65  stringstream com("");
66  com << "echo started \tstudy_num \t"
67  << study_num[0] << " "
68  << study_num[1] << " "
69  << study_num[2] << " \tname \t"
70  << getName() << " &>>ReportFlowRule";
71  cout << system(com.str().c_str()) << endl;
72  cout << "started study_num "
73  << study_num[0] << " "
74  << study_num[1] << " "
75  << study_num[2] << ", name "
76  << getName() << endl;
77 
79  dataFile.setFileType(FileType::NO_FILE);
80  fStatFile.setFileType(FileType::NO_FILE);
81  eneFile.setFileType(FileType::ONE_FILE);
82  solve();
83 
84  com.str("");
85  com << "echo finished \tstudy_num \t"
86  << study_num[0] << " "
87  << study_num[1] << " "
88  << study_num[2] << " \tname \t"
89  << getName() << " &>>ReportFlowRule";
90  cout << system(com.str().c_str()) << endl;
91  }
92 
93  //~ //launch next code
94  //~ stringstream com("");
95  //~ com.str("");
96  //~ com << "./flowRule.exe "
97  //~ << study_num[0] << " "
98  //~ << study_num[1]+1 << " "
99  //~ << study_num[2] << " &";
100  //~ cout << study_num[1] << com.str() << endl;
101  //~ if (study_num[1]<4) system(com.str().c_str());
102  }

References getName(), and NO_FILE.

◆ run() [7/10]

void FlowRule::run ( vector< double study_num,
int  argc,
char argv[] 
)
inline
48  {
49  //Set up a parameter study
50  set_study(study_num[0]);
51  setInflowHeight(study_num[1]);
52  setChuteAngle(study_num[2]);
53  readArguments(argc, argv);
54  set_study();
55 
56  //Save the info to disk
58 
59  //Check if the run has been done before
60  if (FileExists(data_filename.str())) {
61  //If it has move on to teh next run immedently
62  cout << "Run " << getName() << " has already been done " << endl;
63  } else {
64  //launch this code
65  stringstream com("");
66  com << "echo started \tstudy_num \t"
67  << study_num[0] << " "
68  << study_num[1] << " "
69  << study_num[2] << " \tname \t"
70  << getName() << " &>>ReportFlowRule";
71  cout << system(com.str().c_str()) << endl;
72  cout << "started study_num "
73  << study_num[0] << " "
74  << study_num[1] << " "
75  << study_num[2] << ", name "
76  << getName() << endl;
77 
79  dataFile.setFileType(FileType::NO_FILE);
80  fStatFile.setFileType(FileType::NO_FILE);
81  eneFile.setFileType(FileType::ONE_FILE);
82  set_Hertzian(true);
83  solve();
84 
85  com.str("");
86  com << "echo finished \tstudy_num \t"
87  << study_num[0] << " "
88  << study_num[1] << " "
89  << study_num[2] << " \tname \t"
90  << getName() << " &>>ReportFlowRule";
91  cout << system(com.str().c_str()) << endl;
92  }
93 
94  //~ //launch next code
95  //~ stringstream com("");
96  //~ com.str("");
97  //~ com << "./flowRule.exe "
98  //~ << study_num[0] << " "
99  //~ << study_num[1]+1 << " "
100  //~ << study_num[2] << " &";
101  //~ cout << study_num[1] << com.str() << endl;
102  //~ if (study_num[1]<4) system(com.str().c_str());
103  }

References getName(), and NO_FILE.

◆ run() [8/10]

void FlowRule::run ( vector< int study_num,
int  argc,
char argv[] 
)
inline
37  {
38  //if counter == -1 we do a parameter study
39  bool dostudy=false;
40  if (study_num.size()!=3) {
41  dostudy=true;
42  autoNumber();
43  //Set up a 2 parameter study
44  study_num=get2DParametersFromRunNumber(4/*#Heights*/,9/*#Angles*/);
45  }
46 
47  set_study(study_num);
48  readArguments(argc, argv);
49 
50  //If the study is not complete save the data to disk and move on
52 
53  //This can be used to exclude certain numbers from running
54  bool launchthiscode = true;
55 
56  //start next code
57  if (dostudy) {
58  if (launchthiscode) {
59  launch();
60  } else {
61  cout << "Code " << get_counter() << " was NOT launched" << endl;
62  launch(true);
63  }
64  }
65 
66  //Check if the run has been done before
67  if (FileExists(data_filename.str()))
68  {
69  //If it has move on to teh next run immedently
70  cout << "Run " << getName() << " has already been done " << endl;
71  exit(0);
72  }
73 
74  //launch this code
75  stringstream com("");
76  com << "echo started \tstudy_num \t"
77  << study_num[0] << " "
78  << study_num[1] << " "
79  << study_num[2] << " \tname \t"
80  << getName() << " &>>ReportFlowRule";
81  int sysret;
82  sysret = system(com.str().c_str());
83  cout << "started study_num "
84  << study_num[0] << " "
85  << study_num[1] << " "
86  << study_num[2] << ", name "
87  << getName() << endl;
88 
89  if (launchthiscode) solve();
90 
91  com.str("");
92  com << "echo finished \tstudy_num \t"
93  << study_num[0] << " "
94  << study_num[1] << " "
95  << study_num[2] << " \tname \t"
96  << getName() << " &>>ReportFlowRule";
97  sysret = system(com.str().c_str());
98  }

References getName().

◆ run() [9/10]

void FlowRule::run ( vector< Mdouble study_num,
int  argc,
char argv[] 
)
inline
48  {
49  //Set up a parameter study
50  set_study(study_num[0]);
51  setInflowHeight(study_num[1]);
52  setChuteAngle(study_num[2]);
53  readArguments(argc, argv);
54  set_study();
55 
56  //Save the info to disk
58 
59  //Check if the run has been done before
60  if (FileExists(data_filename.str())) {
61  //If it has move on to teh next run immedently
62  cout << "Run " << getName() << " has already been done " << endl;
63  } else {
64  //launch this code
65  stringstream com("");
66  com << "echo started \tstudy_num \t"
67  << study_num[0] << " "
68  << study_num[1] << " "
69  << study_num[2] << " \tname \t"
70  << getName() << " &>>ReportFlowRule";
71  cout << system(com.str().c_str()) << endl;
72  cout << "started study_num "
73  << study_num[0] << " "
74  << study_num[1] << " "
75  << study_num[2] << ", name "
76  << getName() << endl;
77 
79  dataFile.setFileType(FileType::NO_FILE);
80  fStatFile.setFileType(FileType::NO_FILE);
81  eneFile.setFileType(FileType::ONE_FILE);
82  solve();
83 
84  com.str("");
85  com << "echo finished \tstudy_num \t"
86  << study_num[0] << " "
87  << study_num[1] << " "
88  << study_num[2] << " \tname \t"
89  << getName() << " &>>ReportFlowRule";
90  cout << system(com.str().c_str()) << endl;
91  }
92 
93  //~ //launch next code
94  //~ stringstream com("");
95  //~ com.str("");
96  //~ com << "./flowRule.exe "
97  //~ << study_num[0] << " "
98  //~ << study_num[1]+1 << " "
99  //~ << study_num[2] << " &";
100  //~ cout << study_num[1] << com.str() << endl;
101  //~ if (study_num[1]<4) system(com.str().c_str());
102  }

References getName(), and NO_FILE.

◆ run() [10/10]

void FlowRule::run ( vector< Mdouble study_num,
int  argc,
char argv[] 
)
inline
59  {
60  //Set up a parameter study
61  set_study(study_num[0]);
62  setInflowHeight(study_num[1]);
63  setChuteAngle(study_num[2]);
65  dataFile.setFileType(FileType::NO_FILE);
66  fStatFile.setFileType(FileType::NO_FILE);
67  eneFile.setFileType(FileType::ONE_FILE);
68  readArguments(argc, argv);
69  set_study();
70 
71  //Save the info to disk
73 
74  //Check if the run has been done before
75  if (FileExists(data_filename.str())) {
76  //If it has move on to teh next run immedently
77  cout << "Run " << getName() << " has already been done " << endl;
78  } else {
79  //launch this code
80  stringstream com("");
81  com << "echo started \tstudy_num \t"
82  << study_num[0] << " "
83  << study_num[1] << " "
84  << study_num[2] << " \tname \t"
85  << getName() << " &>>ReportFlowRule";
86  cout << system(com.str().c_str()) << endl;
87  cout << "started study_num "
88  << study_num[0] << " "
89  << study_num[1] << " "
90  << study_num[2] << ", name "
91  << getName() << endl;
92 
93  solve();
94 
95  com.str("");
96  com << "echo finished \tstudy_num \t"
97  << study_num[0] << " "
98  << study_num[1] << " "
99  << study_num[2] << " \tname \t"
100  << getName() << " &>>ReportFlowRule";
101  cout << system(com.str().c_str()) << endl;
102  }
103 
104  //~ //launch next code
105  //~ stringstream com("");
106  //~ com.str("");
107  //~ com << "./flowRule.exe "
108  //~ << study_num[0] << " "
109  //~ << study_num[1]+1 << " "
110  //~ << study_num[2] << " &";
111  //~ cout << study_num[1] << com.str() << endl;
112  //~ if (study_num[1]<4) system(com.str().c_str());
113  }

References getName(), and NO_FILE.

◆ set_Densityvariation()

void FlowRule::set_Densityvariation ( Mdouble  Densityvariation)
inline

Changes density of (small) species 0.

117  {
118  if (Densityvariation>0) setDensity(getDensity(1)*Densityvariation,0);
119  else {cerr<<"Error: densityvariation needs to be positive"<<endl; exit(-1);}
120  cout
121  << "rho0=" << getDensity(0)
122  << "rho1=" << getDensity(1)
123  << endl;
124  }

◆ set_Polydispersity()

void FlowRule::set_Polydispersity ( Mdouble  Polydispersity)
inline

Sets radii such that the total volume remains constant, and rmax/rmin = Polydispersity Also sets FixedParticleRadius to MinInflowParticleRadius to avoid Particles falling through

101  {
102  if (Polydispersity>=1.) {
106  cout
107  << "r0=" << getMinInflowParticleRadius()
108  << "r1=" << getMaxInflowParticleRadius()
109  << "Numberfraction=" << NumberFraction
110  << endl;
111  } else {
112  cerr<<"Error: polydispersity " << Polydispersity << " needs to be >=1"<<endl; exit(1);
113  }
114  }

References mathsFunc::cubic().

◆ setDensityVariation()

void FlowRule::setDensityVariation ( double  Densityvariation)
inline

Changes density of (small) species 0.

139  {
140  if (Densityvariation > 0)
141  {
143  * Densityvariation);
144  }
145  else
146  {
147  logger(ERROR, "Densityvariation needs to be positive");
148  }
149  logger(INFO, "rho0=% rho1=%", speciesHandler.getObject(0)->getDensity(),
151  }

References ERROR, ParticleSpecies::getDensity(), BaseHandler< T >::getObject(), INFO, logger, ParticleSpecies::setDensity(), and DPMBase::speciesHandler.

Referenced by readNextArgument(), and run().

◆ setName()

void FlowRule::setName ( )
inline
44  {
45  std::stringstream name;
46  name << "H" << getInflowHeight()
47  << "A" << getChuteAngleDegrees()
48  << "P" << getPolydispersity()
49  << "D" << getDensityVariation()
50  << "N" << NumberFraction;
51  dataFile.setName(name.str());
52  }

References DPMBase::dataFile, Chute::getChuteAngleDegrees(), getDensityVariation(), Chute::getInflowHeight(), getPolydispersity(), units::name, NumberFraction, and File::setName().

Referenced by main(), and run().

◆ setname()

void FlowRule::setname ( )
inline
42  {
43  stringstream name;
44  name << "H" << getInflowHeight()
45  << "A" << getChuteAngleDegrees()
46  << "P" << get_Polydispersity()
47  << "D" << get_Densityvariation()
48  << "N" << NumberFraction;
49  setName(name.str().c_str());
50  set_data_filename();
51  }

References units::name.

◆ setPolydispersity()

void FlowRule::setPolydispersity ( double  Polydispersity)
inline

Sets radii such that the total volume remains constant, and rmax/rmin = Polydispersity Also sets FixedParticleRadius to MinInflowParticleRadius to avoid Particles falling through

121  {
122  if (Polydispersity >= 1.)
123  {
125  (NumberFraction + mathsFunc::cubic(Polydispersity) * (1 - NumberFraction)), -1. / 3.));
128  logger(INFO, "r0=% r1=% Numberfraction=%", getMinInflowParticleRadius(), getMaxInflowParticleRadius(),
130  }
131  else
132  {
133  logger(ERROR, "Polydispersity % needs to be >=1", Polydispersity);
134  }
135  }

References mathsFunc::cubic(), ERROR, Chute::getFixedParticleRadius(), Chute::getMaxInflowParticleRadius(), Chute::getMinInflowParticleRadius(), INFO, logger, NumberFraction, Chute::setFixedParticleRadius(), Chute::setMaxInflowParticleRadius(), and Chute::setMinInflowParticleRadius().

Referenced by readNextArgument(), and run().

◆ writeRestartFile() [1/5]

void FlowRule::writeRestartFile ( )
inlinevirtual

Stores all the particle data for current save time step to a "restart" file, which is a file simply intended to store all the information necessary to "restart" a simulation from a given time step (see also MercuryDPM.org for more information on restart files).

Calls the write() function in order to output all relevant data (particle positions and velocities, system dimensions, positions of walls and boundaries...) to a restart file.

See also readRestartFile

Reimplemented from DPMBase.

33  {
34  static int counter=0;
35  if (!(counter%100)) {
36  //writeRestartFile_counter--;
38  }
39  counter++;
40  }

References DPMBase::writeRestartFile().

Referenced by main(), and run().

◆ writeRestartFile() [2/5]

void FlowRule::writeRestartFile ( )
inlinevirtual

Stores all the particle data for current save time step to a "restart" file, which is a file simply intended to store all the information necessary to "restart" a simulation from a given time step (see also MercuryDPM.org for more information on restart files).

Calls the write() function in order to output all relevant data (particle positions and velocities, system dimensions, positions of walls and boundaries...) to a restart file.

See also readRestartFile

Reimplemented from DPMBase.

37  {
38  static int counter=0;
39  if (!(counter%100)) {
40  //cout << endl << counter << endl;
41  //writeRestartFile_counter--;
43  }
44  counter++;
45  }

References DPMBase::writeRestartFile().

◆ writeRestartFile() [3/5]

void FlowRule::writeRestartFile ( )
inlinevirtual

Stores all the particle data for current save time step to a "restart" file, which is a file simply intended to store all the information necessary to "restart" a simulation from a given time step (see also MercuryDPM.org for more information on restart files).

Calls the write() function in order to output all relevant data (particle positions and velocities, system dimensions, positions of walls and boundaries...) to a restart file.

See also readRestartFile

Reimplemented from DPMBase.

37  {
38  static int counter=0;
39  if (!(counter%100)) {
40  //cout << endl << counter << endl;
41  //writeRestartFile_counter--;
43  }
44  counter++;
45  }

References DPMBase::writeRestartFile().

◆ writeRestartFile() [4/5]

void FlowRule::writeRestartFile ( )
inlinevirtual

Stores all the particle data for current save time step to a "restart" file, which is a file simply intended to store all the information necessary to "restart" a simulation from a given time step (see also MercuryDPM.org for more information on restart files).

Calls the write() function in order to output all relevant data (particle positions and velocities, system dimensions, positions of walls and boundaries...) to a restart file.

See also readRestartFile

Reimplemented from DPMBase.

37  {
38  static int counter=0;
39  if (!(counter%100)) {
40  //cout << endl << counter << endl;
41  //writeRestartFile_counter--;
43  }
44  counter++;
45  }

References DPMBase::writeRestartFile().

◆ writeRestartFile() [5/5]

void FlowRule::writeRestartFile ( )
inlinevirtual

Stores all the particle data for current save time step to a "restart" file, which is a file simply intended to store all the information necessary to "restart" a simulation from a given time step (see also MercuryDPM.org for more information on restart files).

Calls the write() function in order to output all relevant data (particle positions and velocities, system dimensions, positions of walls and boundaries...) to a restart file.

See also readRestartFile

Reimplemented from DPMBase.

48  {
49  static int counter=0;
50  if (!(counter%100)) {
51  //cout << endl << counter << endl;
52  //writeRestartFile_counter--;
54  }
55  counter++;
56  }

References DPMBase::writeRestartFile().

Member Data Documentation

◆ NumberFraction [1/2]

double FlowRule::NumberFraction
private

number ratio of (large) species 1

Referenced by create_inflow_particle(), run(), setName(), and setPolydispersity().

◆ NumberFraction [2/2]

Mdouble FlowRule::NumberFraction
private

number ratio of (large) species 1


The documentation for this class was generated from the following files:
SilbertPeriodic::inflowParticle_
SphericalParticle inflowParticle_
Definition: flowRuleDiego_HeightAngle.cpp:263
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
Chute::getMinInflowParticleRadius
Mdouble getMinInflowParticleRadius() const
returns the minimum radius of inflow particles
Definition: Chute.cc:865
MercuryBase::hGridActionsBeforeTimeStep
void hGridActionsBeforeTimeStep() override
Performs all necessary actions before a time-step, like updating the particles and resetting all the ...
Definition: MercuryBase.cc:323
DPMBase::setTimeStep
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
Chute::getChuteAngleDegrees
Mdouble getChuteAngleDegrees() const
Returns the chute angle (in degrees)
Definition: Chute.cc:743
Chute::getMaxInflowParticleRadius
Mdouble getMaxInflowParticleRadius() const
Returns the maximum radius of inflow particles.
Definition: Chute.cc:874
FlowRule::get_Densityvariation
Mdouble get_Densityvariation()
Definition: obsolete_codes/bidisperse.cpp:126
FlowRule::writeRestartFile
void writeRestartFile()
Stores all the particle data for current save time step to a "restart" file, which is a file simply i...
Definition: obsolete_codes/bidisperse.cpp:33
SilbertPeriodic::readNextArgument
bool readNextArgument(int &i, int argc, char *argv[])
Interprets the i^th command-line argument.
Definition: GlasPeriodic.h:249
DPMBase::launchNewRun
int launchNewRun(const char *name, bool quick=false)
This launches a code from within this code. Please pass the name of the code to run.
Definition: DPMBase.cc:772
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
FlowRule::setDensityVariation
void setDensityVariation(double Densityvariation)
Changes density of (small) species 0.
Definition: bidisperse.cpp:138
Chute::setInflowHeight
void setInflowHeight(Mdouble inflowHeight)
Sets maximum inflow height (Z-direction)
Definition: Chute.cc:884
logger
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
ChuteBottom
Used by Chute::createBottom to create an unordered particle layer.
Definition: ChuteBottom.h:40
DPMBase::random
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1390
FlowRule::getDensityVariation
double getDensityVariation()
Definition: bidisperse.cpp:153
ParticleHandler::getNumberOfObjects
unsigned int getNumberOfObjects() const override
Returns the number of objects in the container. In parallel code this practice is forbidden to avoid ...
Definition: ParticleHandler.cc:1315
Vec3D::X
Mdouble X
the vector components
Definition: Vector.h:65
FlowRule::set_Densityvariation
void set_Densityvariation(Mdouble Densityvariation)
Changes density of (small) species 0.
Definition: obsolete_codes/bidisperse.cpp:117
SilbertPeriodic::createBaseSpecies
virtual void createBaseSpecies()
Definition: flowRuleDiego_HeightAngle.cpp:89
Chute::setChuteWidth
void setChuteWidth(Mdouble chuteWidth)
Sets the chute width (Y-direction)
Definition: Chute.cc:966
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
DPMBase::writeRestartFile
virtual void writeRestartFile()
Stores all the particle data for current save time step to a "restart" file, which is a file simply i...
Definition: DPMBase.cc:2854
BaseInteractable::getIndSpecies
unsigned int getIndSpecies() const
Returns the index of the species associated with the interactable object.
Definition: BaseInteractable.h:88
INFO
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Chute::setChuteAngle
void setChuteAngle(Mdouble chuteAngle)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:695
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
ParticleSpecies::getDensity
Mdouble getDensity() const
Allows density_ to be accessed.
Definition: ParticleSpecies.cc:117
DPMBase::solve
void solve()
The work horse of the code.
Definition: DPMBase.cc:4003
DPMBase::fStatFile
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1441
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
DPMBase::autoNumber
void autoNumber()
The autoNumber() function calls three functions: setRunNumber(), readRunNumberFromFile() and incremen...
Definition: DPMBase.cc:536
Chute::setMaxInflowParticleRadius
void setMaxInflowParticleRadius(Mdouble maxInflowParticleRadius)
Sets the maximum radius of inflow particles.
Definition: Chute.cc:839
BaseParticle::getRadius
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
BaseInteractable::setVelocity
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
Chute::setInflowParticleRadius
void setInflowParticleRadius(Mdouble inflowParticleRadius)
Sets the radius of the inflow particles to a single one (i.e. ensures a monodisperse inflow).
Definition: Chute.cc:775
ERROR
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
FlowRule::get_Polydispersity
Mdouble get_Polydispersity()
Definition: obsolete_codes/bidisperse.cpp:128
BaseParticle::setSpecies
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:804
FlowRule::NumberFraction
double NumberFraction
number ratio of (large) species 1
Definition: bidisperse.cpp:170
SilbertPeriodic::set_study
void set_study()
Definition: GlasPeriodic.h:102
File::setName
void setName(const std::string &name)
Sets the file name, e.g. "Name.data".
Definition: File.cc:198
Species
Contains material and contact force properties.
Definition: Species.h:35
DPMBase::speciesHandler
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1385
DPMBase::setTimeMax
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:870
Chute::setChuteLength
virtual void setChuteLength(Mdouble chuteLength)
Sets the chute length (X-direction)
Definition: Chute.cc:986
Vec3D::Y
Mdouble Y
Definition: Vector.h:65
Chute::setFixedParticleRadius
void setFixedParticleRadius(Mdouble fixedParticleRadius)
Sets the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:608
DPMBase::getName
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:397
Chute::getFixedParticleRadius
Mdouble getFixedParticleRadius() const
Returns the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:626
constants::i
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
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
helpers::fileExists
bool fileExists(std::string strFilename)
Function to check if a file exists, is used to check if a run has already need done.
Definition: Helpers.cc:502
FlowRule::setname
void setname()
Definition: obsolete_codes/bidisperse.cpp:42
FlowRule::setName
void setName()
Definition: bidisperse.cpp:44
FlowRule::set_Polydispersity
void set_Polydispersity(Mdouble Polydispersity)
Definition: obsolete_codes/bidisperse.cpp:101
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
Mdouble
DPMBase::eneFile
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1446
FlowRule::getPolydispersity
double getPolydispersity()
Definition: bidisperse.cpp:155
RNG::getRandomNumber
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:142
DPMBase::get2DParametersFromRunNumber
std::vector< int > get2DParametersFromRunNumber(int size_x, int size_y) const
This turns a counter into 2 indices which is a very useful feature for performing a 2D study....
Definition: DPMBase.cc:695
MercuryBase::hGridActionsBeforeTimeLoop
void hGridActionsBeforeTimeLoop() override
This sets up the broad phase information, has to be done at this stage because it requires the partic...
Definition: MercuryBase.cc:94
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
FlowRule::launch
void launch(bool startfast=false)
Definition: PeriodicInflow2D_Initiation.cpp:33
Chute::getInflowHeight
Mdouble getInflowHeight() const
Returns the maximum inflow height (Z-direction)
Definition: Chute.cc:901
DPMBase::particleHandler
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1395
Vec3D::Z
Mdouble Z
Definition: Vector.h:65
DPMBase::setSaveCount
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:406
Chute::setMinInflowParticleRadius
void setMinInflowParticleRadius(Mdouble minInflowParticleRadius)
sets the minimum radius of inflow particles
Definition: Chute.cc:822
ParticleSpecies::setDensity
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:107
mathsFunc::cubic
T cubic(const T val)
calculates the cube of a number
Definition: ExtendedMath.h:115
DPMBase::dataFile
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1436
units::name
std::string name
Definition: MercuryProb.h:48
FlowRule::setPolydispersity
void setPolydispersity(double Polydispersity)
Definition: bidisperse.cpp:120
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
BaseInteractable::getPosition
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
DPMBase::readArguments
bool readArguments(int argc, char *argv[])
Can interpret main function input arguments that are passed by the driver codes.
Definition: DPMBase.cc:4225