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

Public Member Functions

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 create_inflow_particle ()
 
void actionsBeforeTimeStep () override
 A virtual function which allows to define operations to be executed before the new time step. More...
 
 AngleOfRepose ()
 
void set_H (Mdouble new_)
 
Mdouble get_H ()
 
void run (int study_num)
 
void set_study ()
 
void set_study (int study_num)
 
Mdouble getSlidingFrictionCoefficientBottom ()
 
void setSlidingFrictionCoefficientBottom (Mdouble new_)
 
void createBaseSpecies ()
 
int getNCreated () const
 
void increaseNCreated ()
 
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 create_inflow_particle ()
 
void actionsBeforeTimeStep ()
 A virtual function which allows to define operations to be executed before the new time step. More...
 
 AngleOfRepose ()
 
void set_H (Mdouble new_)
 
Mdouble get_H ()
 
void run (int study_num)
 
void set_study ()
 
void set_study (int study_num)
 
Mdouble getSlidingFrictionCoefficientBottom ()
 
void setSlidingFrictionCoefficientBottom (Mdouble new_)
 
void createBaseSpecies ()
 
- Public Member Functions inherited from ChuteWithHopper
 ChuteWithHopper (const Chute &other)
 This is a copy constructor for Chute problems. More...
 
 ChuteWithHopper (const Mercury3D &other)
 Copy constructor, converts an existing Mercury3D object into a ChuteWithHopper object. More...
 
 ChuteWithHopper (const MercuryBase &other)
 Copy constructor, converts an existing MercuryBase object into a ChuteWithHopper object. More...
 
 ChuteWithHopper (const DPMBase &other)
 Copy constructor, converts an existing DPMBase object into a ChuteWithHopper object. More...
 
 ChuteWithHopper ()
 This is the default constructor. More...
 
void setHopperFillingPercentage (Mdouble hopperFillingPercentage)
 Sets the hopper filling percentage. More...
 
void setHopperLowestPoint (Mdouble hopperLowestPoint)
 Sets the vertical distance of the lowest hopper point relative to the start of the chute. More...
 
Mdouble getHopperLowestPoint () const
 Returns the vertical distance of the lowest hopper point relative to the start of the chute. More...
 
Mdouble getChuteLength () const
 Allows chute length to be accessed. More...
 
void setChuteLength (Mdouble chuteLength) override
 sets xMax to chuteLength+hopperlength_, and thus specifies the length off the runoff chute More...
 
void setIsHopperCentred (bool isHopperCentred)
 Sets an extra shift in X-direction of the whole system. More...
 
void setHopperLowerFillingHeight (Mdouble hopperLowerFillingHeight)
 Sets the height above which the hopper is filled with new particles. More...
 
void setHopperShift (Mdouble hopperShift)
 Sets the shift in X-direction of the whole setup after rotation. More...
 
void setHopperLift (Mdouble hopperLift)
 This lifts the hopper above the plane of the chute (after rotation) More...
 
Mdouble getHopperLift () const
 Returns the hopper's lift above the chute bottom plane. More...
 
Mdouble getHopperShift () const
 Returns the shift in X-direction of the whole setup after rotation. More...
 
void setHopperDimension (unsigned int hopperDimension)
 Sets whether the hopper should have vertical (1) or inclined (2) walls in Y-direction. More...
 
void setIsHopperAlignedWithBottom (bool isHopperAlignedWithBottom)
 Sets the alignment of hopper with chute bottom. More...
 
Mdouble getHopperAngle () const
 Returns the angle of the hopper entrance relative to the vertical. More...
 
Mdouble getHopperLength () const
 Returns the width of the hopper entrance. More...
 
Mdouble getHopperExitLength () const
 Returns the width of the hopper exit. More...
 
Mdouble getHopperHeight () const
 Returns the height of the hopper relative to the chute start. More...
 
Mdouble getHopperExitHeight () const
 Returns the height of the lowest hopper point above the chute. More...
 
bool getIsHopperCentred () const
 Returns whether the setup is shifted another 40 units in X-direction. More...
 
Mdouble getHopperFillingPercentage () const
 Returns the vertical percentage of the hopper insertion boundary which is filled. More...
 
unsigned int getHopperDimension () const
 Returns whether the hopper has vertical (1) or inclined (2) walls in Y-direction. More...
 
void setupInitialConditions () override
 Sets up the initial conditions for the problem. More...
 
void setHopper (Mdouble exitLength, Mdouble exitHeight, Mdouble angle, Mdouble length, Mdouble height)
 Sets the hopper's geometrical properties. More...
 
Mdouble getMaximumVelocityInducedByGravity () const
 Returns the theoretical maximum particle velocity due to gravity. More...
 
Mdouble getTimeStepRatio () const
 Returns smallest particle radius over maximum gravitational velocity. More...
 
void read (std::istream &is, ReadOptions opt=ReadOptions::ReadAll) override
 Reads setup properties from an istream. More...
 
void write (std::ostream &os, bool writeAllParticles=true) const override
 Writes setup properties to an ostream. More...
 
bool readNextArgument (int &i, int argc, char *argv[]) override
 Reads setup properties from a string. More...
 
- 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...
 
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 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...
 
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
 
virtual 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 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
 

Public Attributes

Mdouble Height
 
Mdouble InflowRadius
 
int nCreated_
 
SphericalParticle inflowParticle_
 
LinearViscoelasticSlidingFrictionSpeciesspecies
 
LinearViscoelasticSlidingFrictionMixedSpeciesbaseSpecies
 
- 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...
 

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...
 
- Protected Member Functions inherited from ChuteWithHopper
void addHopper ()
 This creates the hopper on top of the chute, see diagram in class description for details of the points. 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 createBottom ()
 Creates the chute bottom, which can be either flat or one of three flavours of rough. 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

◆ AngleOfRepose() [1/2]

AngleOfRepose::AngleOfRepose ( )
inline
123  {
124  // Problem parameters
125  setName("silbert");
126 
127  //time stepping
128  setTimeStep(1e-4);
129  setTimeMax(2000);
130 
131  //output parameters
132  setSaveCount(500);
133 
134  //particle radii
136  setFixedParticleRadius(.5);//getInflowParticleRadius());
138 
139  //particle properties
140  baseSpecies = nullptr;
142  species->setDensity(6/constants::pi);
143  species->setStiffness(2e5);
144  species->setSlidingStiffness(2.0/7.0* species->getStiffness());
145  species->setDissipation(25.0);
146  species->setSlidingDissipation(species->getDissipation());
147  species->setSlidingFrictionCoefficient(0.5);
148 
149  //chute properties
151  setChuteLength(20);
152  setChuteWidth(10);
153  set_H(20);
154 
155  }

References baseSpecies, BaseHandler< T >::copyAndAddObject(), MULTILAYER, constants::pi, set_H(), Chute::setChuteAngleAndMagnitudeOfGravity(), ChuteWithHopper::setChuteLength(), Chute::setChuteWidth(), Chute::setFixedParticleRadius(), Chute::setInflowParticleRadius(), DPMBase::setName(), Chute::setRoughBottomType(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), species, and DPMBase::speciesHandler.

◆ AngleOfRepose() [2/2]

AngleOfRepose::AngleOfRepose ( )
inline
118  {
119  // Problem parameters
120  setName("silbert");
121 
122  //time stepping
123  setTimeStep(1e-4);
124  setTimeMax(2000);
125 
126  //output parameters
127  setSaveCount(50e1);
128 
129  //particle radii
131  setFixedParticleRadius(.5);//getInflowParticleRadius());
133 
134  //particle properties
135  setDensity(6/constants::pi);
136  setStiffness(2e5);
137  setSlidingStiffness(2.0/7.0*getStiffness());
138  setDissipation(25.0);
139  setSlidingDissipation(getDissipation());
140  setSlidingFrictionCoefficient(0.5);
141 
142  //chute properties
143  setChuteAngle(24.0, 1.0);
144  setChuteLength(20);
145  setChuteWidth(10);
146  set_H(20);
147 
148  }

References MULTILAYER, and constants::pi.

Member Function Documentation

◆ actionsBeforeTimeStep() [1/2]

void AngleOfRepose::actionsBeforeTimeStep ( )
inlinevirtual

A virtual function which allows to define operations to be executed before the new time step.

no implementation but can be overidden in its derived classes.

Reimplemented from DPMBase.

74  {
75  if (getTime()<getTimeMax()*0.7) {
76  //~ InflowRadius = .6*getChuteLength()*std::max(0.0,0.5-t/tmax);
78 
79  int failed = 0;
80 
81  //try max_failed times to find new insertable particle
82  while (failed<=max_failed){
84  //~ cout << P0.getPosition() << endl;
85  if (IsInsertable(P0)) {
86  failed = 0;
87  num_created++;
88  } else failed++;
89  };
90  }
91 
92  //clean up chute
93  static int count = 0;
94  if (count>10)
95  {
96  count = 0;
97  for (unsigned int i=0;i<particleHandler.getNumberOfObjects();)
98  {
100  {
101  #ifdef DEBUG_OUTPUT_FULL
102  cout << "erased:" << i << endl;
103  #endif
105  } //end if particle can be erased
106  else i++;
107  }
108  } else count++;
109 
110 
111  }

References constants::i, and mathsFunc::square().

◆ actionsBeforeTimeStep() [2/2]

void AngleOfRepose::actionsBeforeTimeStep ( )
inlineoverridevirtual

A virtual function which allows to define operations to be executed before the new time step.

no implementation but can be overidden in its derived classes.

Reimplemented from DPMBase.

80  {
81  if (getTime()<getTimeMax()*0.7) {
82  //~ InflowRadius = .6*getChuteLength()*std::max(0.0,0.5-t/tmax);
84 
85  int failed = 0;
86 
87  //try max_failed times to find new insertable particle
88  while (failed<= getMaxFailed()){
90  //~ cout << P0.getPosition() << endl;
92  failed = 0;
94  } else failed++;
95  };
96  }
97 
98  //clean up chute
99  static int count = 0;
100  if (count>10)
101  {
102  count = 0;
103  for (unsigned int i=0;i<particleHandler.getNumberOfObjects();)
104  {
106  {
107  #ifdef DEBUG_OUTPUT_FULL
108  cout << "erased:" << i << endl;
109  #endif
111  } //end if particle can be erased
112  else i++;
113  }
114  } else count++;
115 
116 
117  }

References MercuryBase::checkParticleForInteraction(), create_inflow_particle(), ChuteWithHopper::getChuteLength(), Chute::getInflowParticleRadius(), Chute::getMaxFailed(), ParticleHandler::getNumberOfObjects(), BaseHandler< T >::getObject(), BaseInteractable::getPosition(), DPMBase::getTime(), DPMBase::getTimeMax(), constants::i, increaseNCreated(), inflowParticle_, InflowRadius, DPMBase::particleHandler, ParticleHandler::removeObject(), mathsFunc::square(), Vec3D::X, and Vec3D::Y.

◆ create_inflow_particle() [1/2]

◆ create_inflow_particle() [2/2]

void AngleOfRepose::create_inflow_particle ( )
inline
61  {
62  P0.setRadius(random.getRandomNumber(0.0,1.0)<0.1?MinInflowParticleRadius:MaxInflowParticleRadius);
63  P0.computeMass(Species);
64 
66  P0.setPosition(Vec3D(
67  0.5*getChuteLength() + gamma,
69  FixedParticleRadius + P0.getRadius() + random.getRandomNumber(0.0,1.0)*Height));
70  //~ cout << P0.getPosition() << endl;
71  }

References mathsFunc::gamma(), and mathsFunc::square().

◆ createBaseSpecies() [1/2]

void AngleOfRepose::createBaseSpecies ( )
inline

◆ createBaseSpecies() [2/2]

void AngleOfRepose::createBaseSpecies ( )
inline
241  {
242  //only create once
243  static bool created=false;
244  if (!created) {
246  for (unsigned int i=0; i<particleHandler.getNumberOfObjects(); i++) {
248  }
249  }
250  }

References constants::i.

◆ get_H() [1/2]

Mdouble AngleOfRepose::get_H ( )
inline
161 {return getInflowHeight();}

References Chute::getInflowHeight().

◆ get_H() [2/2]

Mdouble AngleOfRepose::get_H ( )
inline
151 {return InflowHeight;}

◆ getNCreated()

int AngleOfRepose::getNCreated ( ) const
inline
273  {
274  return nCreated_;
275  }

References nCreated_.

◆ getSlidingFrictionCoefficientBottom() [1/2]

Mdouble AngleOfRepose::getSlidingFrictionCoefficientBottom ( )
inline
250  {
251  if (baseSpecies!= nullptr)
252  return baseSpecies->getSlidingFrictionCoefficient();
253  else return species->getSlidingFrictionCoefficient();
254  }

References baseSpecies, and species.

Referenced by run(), and set_study().

◆ getSlidingFrictionCoefficientBottom() [2/2]

Mdouble AngleOfRepose::getSlidingFrictionCoefficientBottom ( )
inline
236  {
237  if (speciesHandler.getNumberOfObjects()>1) return speciesHandler.getMixedObject(1,0)->getSlidingFrictionCoefficient();
238  else return getSlidingFrictionCoefficient();
239  }

◆ increaseNCreated()

void AngleOfRepose::increaseNCreated ( )
inline
278  {
279  nCreated_++;
280  }

References nCreated_.

Referenced by actionsBeforeTimeStep().

◆ run() [1/2]

void AngleOfRepose::run ( int  study_num)
inline

todo{Change this line to have some meaningfull behaviour}

todo{Change this line to have some meaningfull behaviour}

164  {
165  //Set up a parameter study
166  set_study(study_num);
167 
168  std::stringstream name;
169  name << "AngleOfRepose"
170  << "L" << round(100. * getFixedParticleRadius() * 2.) / 100.
171  << "M" << species->getSlidingFrictionCoefficient()
173  setName(name.str().c_str());
174 
175  //Save the info to disk
177 
178  //Check if the run has been done before
180  {
181  //If it has move on to the next run immediately
182  logger(INFO, "Run % has already been done\n", Flusher::NO_FLUSH, getName());
183  }
184  else
185  {
186  //launch this code
187  std::stringstream com("");
188  com << "echo started \tstudy_num \t"
189  << study_num << " \tname \t"
190  << getName() << " &>>Report_AngleOfRepose";
192  if (system(com.str().c_str()))
193  {}
194  logger(INFO, "started study_num %, name %", study_num, getName());
195 
196  restartFile.setFileType(FileType::ONE_FILE);
197  dataFile.setFileType(FileType::ONE_FILE);
198  fStatFile.setFileType(FileType::ONE_FILE);
199  eneFile.setFileType(FileType::ONE_FILE);
200  setSaveCount(10000);
201  solve();
202 
203  com.str("");
204  com << "echo finished \tstudy_num \t"
205  << study_num << " \tname \t"
206  << getName() << " &>>Report_AngleOfRepose";
208  if(system(com.str().c_str())){}
209  }
210  }

References DPMBase::dataFile, DPMBase::eneFile, helpers::fileExists(), FLUSH, DPMBase::fStatFile, Chute::getFixedParticleRadius(), DPMBase::getName(), File::getName(), getSlidingFrictionCoefficientBottom(), INFO, logger, units::name, DPMBase::restartFile, helpers::round(), set_study(), File::setFileType(), DPMBase::setName(), DPMBase::setSaveCount(), DPMBase::solve(), species, and DPMBase::writeRestartFile().

Referenced by main().

◆ run() [2/2]

void AngleOfRepose::run ( int  study_num)
inline
154  {
155  //Set up a parameter study
156  set_study(study_num);
157 
158  stringstream name;
159  name << "AngleOfRepose"
160  << "L" << round(100.*getFixedParticleRadius()*2.)/100.
161  << "M" << getSlidingFrictionCoefficient()
163  setName(name.str().c_str());
164 
165  //Save the info to disk
167 
168  //Check if the run has been done before
169  if (FileExists(data_filename.str())) {
170  //If it has move on to teh next run immedently
171  cout << "Run " << getName() << " has already been done " << endl;
172  } else {
173  //launch this code
174  stringstream com("");
175  com << "echo started \tstudy_num \t"
176  << study_num << " \tname \t"
177  << getName() << " &>>Report_AngleOfRepose";
178  int sysret;
179  sysret = system(com.str().c_str());
180  cout << "started study_num "
181  << study_num << ", name "
182  << getName() << endl;
183 
184  restartFile.setFileType(FileType::ONE_FILE);
185  dataFile.setFileType(FileType::ONE_FILE);
186  fStatFile.setFileType(FileType::NO_FILE);
187  eneFile.setFileType(FileType::ONE_FILE);
188  setSaveCount(1e4);
189  solve();
190 
191  com.str("");
192  com << "echo finished \tstudy_num \t"
193  << study_num << " \tname \t"
194  << getName() << " &>>Report_AngleOfRepose";
195  sysret = system(com.str().c_str());
196  }
197  }

References getName(), units::name, and helpers::round().

◆ set_H() [1/2]

void AngleOfRepose::set_H ( Mdouble  new_)
inline
157  {
158  setInflowHeight(new_); setZMax(new_);
159  }

References Chute::setInflowHeight(), and DPMBase::setZMax().

Referenced by AngleOfRepose().

◆ set_H() [2/2]

void AngleOfRepose::set_H ( Mdouble  new_)
inline
150 {InflowHeight=new_; setZMax(InflowHeight);}

◆ set_study() [1/4]

void AngleOfRepose::set_study ( )
inline
212  {
213  std::stringstream name;
214  name << "H" << getInflowHeight()
215  << "A" << getChuteAngleDegrees()
216  << "L" << round(100.*getFixedParticleRadius()*2.)/100.
217  << "M" << species->getSlidingFrictionCoefficient()
219  dataFile.setName(name.str());
220  //set_data_filename();
221  }

References DPMBase::dataFile, Chute::getChuteAngleDegrees(), Chute::getFixedParticleRadius(), Chute::getInflowHeight(), getSlidingFrictionCoefficientBottom(), units::name, helpers::round(), File::setName(), and species.

Referenced by run(), and set_study().

◆ set_study() [2/4]

void AngleOfRepose::set_study ( )
inline
199  {
200  stringstream name;
201  name << "H" << getInflowHeight()
202  << "A" << getChuteAngleDegrees()
203  << "L" << round(100.*getFixedParticleRadius()*2.)/100.
204  << "M" << getSlidingFrictionCoefficient()
206  setName(name.str().c_str());
207  set_data_filename();
208  }

References units::name, and helpers::round().

◆ set_study() [3/4]

void AngleOfRepose::set_study ( int  study_num)
inline
223  {
224  if (study_num < 6) {
225  // set mu_all = 0.5, vary lambda
226  Mdouble Lambdas[] = {0, 3./6., 4./6., 5./6., 1, 2};
227  setFixedParticleRadius(Lambdas[study_num]/2.);
228  species->setSlidingFrictionCoefficient(0.5);
229  } else if (study_num < 9) {
230  // set lambda = 1, vary mu_all
231  Mdouble MuAll[] = {0, 1., 1e20};
232  species->setSlidingFrictionCoefficient(MuAll[study_num-6]);
234  } else if (study_num < 12) {
235  // set lambda = 1, mu_all = 0.5, vary mu_bottom
236  Mdouble MuBottom[] = {0, 1., 1e20};
237  species->setSlidingFrictionCoefficient(0.5);
238  setSlidingFrictionCoefficientBottom(MuBottom[study_num-9]);
240  } else
241  {
242  //If study_num is complete quit
243  logger(INFO, "Study is complete");
244  exit(0);
245  }
246  //Note make sure h and a is defined
247  set_study();
248  }

References INFO, logger, set_study(), Chute::setFixedParticleRadius(), setSlidingFrictionCoefficientBottom(), and species.

◆ set_study() [4/4]

void AngleOfRepose::set_study ( int  study_num)
inline
210  {
211  if (study_num < 6) {
212  // set mu_all = 0.5, vary lambda
213  Mdouble Lambdas[] = {0, 3./6., 4./6., 5./6., 1, 2};
214  setFixedParticleRadius(Lambdas[study_num]/2.);
215  setSlidingFrictionCoefficient(0.5);
216  } else if (study_num < 9) {
217  // set lambda = 1, vary mu_all
218  Mdouble MuAll[] = {0, 1., 1e20};
219  setSlidingFrictionCoefficient(MuAll[study_num-6]);
221  } else if (study_num < 12) {
222  // set lambda = 1, mu_all = 0.5, vary mu_bottom
223  Mdouble MuBottom[] = {0, 1., 1e20};
224  setSlidingFrictionCoefficient(0.5);
225  setSlidingFrictionCoefficientBottom(MuBottom[study_num-9]);
227  } else {
228  //If study_num is complete quit
229  cout << "Study is complete " << endl;
230  exit(0);
231  }
232  //Note make sure h and a is defined
233  set_study();
234  }

◆ setSlidingFrictionCoefficientBottom() [1/2]

void AngleOfRepose::setSlidingFrictionCoefficientBottom ( Mdouble  new_)
inline
255  {
257  baseSpecies->setSlidingFrictionCoefficient(new_);
258  }

References baseSpecies, and createBaseSpecies().

Referenced by set_study().

◆ setSlidingFrictionCoefficientBottom() [2/2]

void AngleOfRepose::setSlidingFrictionCoefficientBottom ( Mdouble  new_)
inline
240 { createBaseSpecies(); speciesHandler.getMixedObject(1, 0)->setSlidingFrictionCoefficient(new_); }

◆ setupInitialConditions() [1/2]

void AngleOfRepose::setupInitialConditions ( )
inlinevirtual

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.

A virtual function with no implementation but can be overriden.

Todo:
I (Anthony) wants to change this to be an external function. This has a lot of advantages especially when using copy-constructors. This is a major change and will break other codes, so therefore has to be done carefully.

This sets up the particles initial conditions it is as you expect the user to override this. By default the particles are randomly distributed

Reimplemented from DPMBase.

39  {
40  createBottom();
41 
42  set_NWallPeriodic(0);
43  set_NWall(1);
44  wallHandler.getObject(0)->set(Vec3D(0.0, 0.0, -1.0), -(getZMin()-getFixedParticleRadius()));
45 
46  //clean up chute
47  for (unsigned int i=0;i<particleHandler.getNumberOfObjects();)
48  {
51  else i++;
52  }
53 
54 
55  particleHandler.set_StorageCapacity((int)min(getXMax()*getYMax()*getZMax()/mathsFunc::cubic(2.0*getInflowParticleRadius()),1e6));
56  set_HGRID_num_buckets_to_power(particleHandler.getStorageCapacity());
57  write(std::cout,false);
58  }

References mathsFunc::cubic(), constants::i, and mathsFunc::square().

◆ setupInitialConditions() [2/2]

void AngleOfRepose::setupInitialConditions ( )
inlineoverridevirtual

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.

A virtual function with no implementation but can be overriden.

Todo:
I (Anthony) wants to change this to be an external function. This has a lot of advantages especially when using copy-constructors. This is a major change and will break other codes, so therefore has to be done carefully.

This sets up the particles initial conditions it is as you expect the user to override this. By default the particles are randomly distributed

todo{I(Dinant) had to clear the WallHandler to prevent it from inserting the same wall twice, why?}

Reimplemented from DPMBase.

37  {
38  createBottom();
39 
40  //set_NWallPeriodic(0);
41  //set_NWall(1);
44  InfiniteWall w0;
45  w0.set(Vec3D(0.0, 0.0, -1.0), Vec3D(0,0,getZMin()-getFixedParticleRadius()));
47 
48  //clean up chute
49  for (unsigned int i = 0; i < particleHandler.getNumberOfObjects();)
50  {
55  else i++;
56  }
57 
58 
59  particleHandler.setStorageCapacity(static_cast<unsigned>(std::min(
60  getXMax() * getYMax() * getZMax() / mathsFunc::cubic(2.0 * getInflowParticleRadius()), 1e6)));
61  //setHGridNumberOfBucketsToPower(particleHandler.getStorageCapacity());
62  write(std::cout, false);
63  nCreated_ = 0;
64  }

References BaseHandler< T >::clear(), BaseHandler< T >::copyAndAddObject(), Chute::createBottom(), mathsFunc::cubic(), ChuteWithHopper::getChuteLength(), Chute::getFixedParticleRadius(), Chute::getInflowParticleRadius(), ParticleHandler::getNumberOfObjects(), BaseHandler< T >::getObject(), BaseInteractable::getPosition(), DPMBase::getXMax(), DPMBase::getYMax(), DPMBase::getZMax(), DPMBase::getZMin(), constants::i, nCreated_, DPMBase::particleHandler, ParticleHandler::removeObject(), InfiniteWall::set(), BaseHandler< T >::setStorageCapacity(), mathsFunc::square(), DPMBase::wallHandler, ChuteWithHopper::write(), Vec3D::X, and Vec3D::Y.

Member Data Documentation

◆ baseSpecies

◆ Height

Mdouble AngleOfRepose::Height

Referenced by create_inflow_particle(), and main().

◆ inflowParticle_

SphericalParticle AngleOfRepose::inflowParticle_

◆ InflowRadius

Mdouble AngleOfRepose::InflowRadius

◆ nCreated_

int AngleOfRepose::nCreated_

◆ species


The documentation for this class was generated from the following file:
AngleOfRepose::setSlidingFrictionCoefficientBottom
void setSlidingFrictionCoefficientBottom(Mdouble new_)
Definition: AngleOfRepose.cpp:255
BaseHandler::getStorageCapacity
unsigned int getStorageCapacity() const
Gets the storage capacity of this BaseHandler.
Definition: BaseHandler.h:662
mathsFunc::square
T square(const T val)
squares a number
Definition: ExtendedMath.h:106
DPMBase::setName
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:420
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
DPMBase::setTimeStep
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
AngleOfRepose::baseSpecies
LinearViscoelasticSlidingFrictionMixedSpecies * baseSpecies
Definition: AngleOfRepose.cpp:285
LinearViscoelasticSlidingFrictionSpecies
Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies > LinearViscoelasticSlidingFrictionSpecies
Definition: LinearViscoelasticSlidingFrictionSpecies.h:34
constants::pi
const Mdouble pi
Definition: ExtendedMath.h:45
Chute::getChuteAngleDegrees
Mdouble getChuteAngleDegrees() const
Returns the chute angle (in degrees)
Definition: Chute.cc:743
Flusher::FLUSH
@ FLUSH
Chute::setChuteAngleAndMagnitudeOfGravity
void setChuteAngleAndMagnitudeOfGravity(Mdouble chuteAngle, Mdouble gravity)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:716
Chute::getMaxInflowParticleRadius
Mdouble getMaxInflowParticleRadius() const
Returns the maximum radius of inflow particles.
Definition: Chute.cc:874
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
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.
DPMBase::random
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1390
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
MercuryBase::checkParticleForInteraction
bool checkParticleForInteraction(const BaseParticle &P) final
Checks if given BaseParticle has an interaction with a BaseWall or other BaseParticle.
Definition: MercuryBase.cc:594
AngleOfRepose::set_study
void set_study()
Definition: AngleOfRepose.cpp:212
SpeciesHandler::getMixedObject
std::enable_if<!std::is_pointer< typename U::MixedSpeciesType >::value, typename U::MixedSpeciesType * >::type getMixedObject(const U *S, const U *T)
Definition: SpeciesHandler.h:74
AngleOfRepose::InflowRadius
Mdouble InflowRadius
Definition: AngleOfRepose.cpp:120
Chute::setChuteWidth
void setChuteWidth(Mdouble chuteWidth)
Sets the chute width (Y-direction)
Definition: Chute.cc:966
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
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
BaseHandler::setStorageCapacity
void setStorageCapacity(const unsigned int N)
Sets the storage capacity of this BaseHandler.
Definition: BaseHandler.h:669
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
MULTILAYER
@ MULTILAYER
Definition: Chute.h:53
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::setZMax
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1208
Mdouble
double Mdouble
Definition: GeneralDefine.h:34
AngleOfRepose::increaseNCreated
void increaseNCreated()
Definition: AngleOfRepose.cpp:277
Chute::setRoughBottomType
void setRoughBottomType(RoughBottomType roughBottomType)
Sets the type of rough bottom of the chute.
Definition: Chute.cc:641
BaseParticle::getRadius
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
ChuteWithHopper::getChuteLength
Mdouble getChuteLength() const
Allows chute length to be accessed.
Definition: ChuteWithHopper.cc:531
AngleOfRepose::inflowParticle_
SphericalParticle inflowParticle_
Definition: AngleOfRepose.cpp:283
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
BaseParticle::setSpecies
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:804
ChuteWithHopper::setChuteLength
void setChuteLength(Mdouble chuteLength) override
sets xMax to chuteLength+hopperlength_, and thus specifies the length off the runoff chute
Definition: ChuteWithHopper.cc:541
File::setName
void setName(const std::string &name)
Sets the file name, e.g. "Name.data".
Definition: File.cc:198
DPMBase::getTime
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:805
Species
Contains material and contact force properties.
Definition: Species.h:35
DPMBase::speciesHandler
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1385
helpers::round
Mdouble round(const Mdouble value, unsigned precision)
Definition: Helpers.cc:598
AngleOfRepose::createBaseSpecies
void createBaseSpecies()
Definition: AngleOfRepose.cpp:259
DPMBase::wallHandler
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1405
BaseHandler::getNumberOfObjects
virtual unsigned int getNumberOfObjects() const
Gets the number of real Object in this BaseHandler. (i.e. no mpi or periodic particles)
Definition: BaseHandler.h:648
DPMBase::setTimeMax
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:870
Vec3D::Y
Mdouble Y
Definition: Vector.h:65
InfiniteWall
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:48
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
AngleOfRepose::species
LinearViscoelasticSlidingFrictionSpecies * species
Definition: AngleOfRepose.cpp:284
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
BaseHandler::copyAndAddObject
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:379
ChuteWithHopper::write
void write(std::ostream &os, bool writeAllParticles=true) const override
Writes setup properties to an ostream.
Definition: ChuteWithHopper.cc:615
RNG::getRandomNumber
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:142
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
BaseHandler::clear
virtual void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: BaseHandler.h:528
DPMBase::getZMax
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:631
BaseParticle::isFixed
bool isFixed() const override
Is fixed Particle function. It returns whether a Particle is fixed or not, by checking its inverse Ma...
Definition: BaseParticle.h:93
ParticleHandler::removeObject
void removeObject(unsigned int index) override
Removes a BaseParticle from the ParticleHandler.
Definition: ParticleHandler.cc:390
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
DPMBase::setSaveCount
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:406
Chute::createBottom
virtual void createBottom()
Creates the chute bottom, which can be either flat or one of three flavours of rough.
Definition: Chute.cc:323
AngleOfRepose::create_inflow_particle
void create_inflow_particle()
Definition: AngleOfRepose.cpp:66
AngleOfRepose::set_H
void set_H(Mdouble new_)
Definition: AngleOfRepose.cpp:157
InfiniteWall::set
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
Definition: InfiniteWall.cc:118
Chute::getMaxFailed
unsigned int getMaxFailed() const
Returns the number of times a particle will be tried to be added to the insertion boundary.
Definition: Chute.cc:764
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
AngleOfRepose::Height
Mdouble Height
Definition: AngleOfRepose.cpp:119
AngleOfRepose::nCreated_
int nCreated_
Definition: AngleOfRepose.cpp:282
units::name
std::string name
Definition: MercuryProb.h:48
Chute::getChuteWidth
Mdouble getChuteWidth() const
Returns the chute width (Y-direction)
Definition: Chute.cc:976
mathsFunc::gamma
Mdouble gamma(Mdouble gamma_in)
This is the gamma function returns the true value for the half integer value.
Definition: ExtendedMath.cc:137
Chute::getInflowParticleRadius
Mdouble getInflowParticleRadius() const
Returns the average radius of inflow particles.
Definition: Chute.cc:856
AngleOfRepose::getSlidingFrictionCoefficientBottom
Mdouble getSlidingFrictionCoefficientBottom()
Definition: AngleOfRepose.cpp:250
BaseInteractable::getPosition
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
DPMBase::getTimeMax
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:885