112 void read(std::istream& is)
override;
117 void write(std::ostream& os,
bool writeAllParticles =
true)
const override;
virtual void hGridFindOneSidedContacts(BaseParticle *obj)=0
This is a purely virtual function that checks if an object is in the grid, this code is dimension dep...
bool checkParticleForInteraction(const BaseParticle &P) override
Checks if given BaseParticle has an interaction with a BaseWall or other BaseParticle.
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
bool hGridNeedsRebuilding()
Gets if the HGrid needs rebuilding before anything else happens.
Mdouble totalCurrentMaxRelativeDisplacement_
After each time step, this Mdouble is increased by 2*currentMaxRelativeDisplacement_.
Mdouble getHGridCellOverSizeRatio() const
Gets the ratio of the smallest cell over the smallest particle.
HGrid * grid
A pointer to the HGrid associated with this MercuryBase.
Mdouble getHGridCurrentMaxRelativeDisplacement() const
Returns hGridCurrentMaxRelativeDisplacement_.
virtual unsigned int getHGridTargetNumberOfBuckets() const
Gets the desired number of buckets, which is the maximum of the number of particles and 10...
void setHGridUpdateEachTimeStep(bool updateEachTimeStep)
Sets whether or not the HGrid must be updated every time step.
virtual Mdouble getHGridTargetMinInteractionRadius() const
Gets the desired size of the smallest cells of the HGrid.
HGridDistribution hGridDistribution_
Indicator for the distribution of the sizes of the cells of different levels of the HGrid...
unsigned int hGridMaxLevels_
Unsigned integer that indicates the maximum number of levels of the HGrid.
HGridMethod getHGridMethod() const
Gets whether the HGrid in this MercuryBase is BOTTOMUP or TOPDOWN.
void hGridUpdateMove(BaseParticle *iP, Mdouble move) override
Computes the relative displacement of the given BaseParticle and updates the currentMaxRelativeDispla...
Mdouble hGridCellOverSizeRatio_
The maximum ratio between the size of the cells and the BaseParticle they contain.
unsigned int getHGridMaxLevels() const
Gets the maximum number of levels of the HGrid in this MercuryBase.
void hGridActionsBeforeTimeStep() override
Performs all necessary actions before a time-step, like updating the particles and resetting all the ...
void hGridInfo() const
Writes the info of the HGrid to the screen in a nice format.
virtual Mdouble getHGridTargetMaxInteractionRadius() const
Gets the desired size of the largest cells of the HGrid.
HGridMethod
Enum class that indicates how particles in different levels (cross level checking) of the HGrid are c...
void setHGridMethod(HGridMethod hGridMethod)
Sets the HGridMethod to either BOTTOMUP or TOPDOWN.
HGridMethod hGridMethod_
Indicator of which way the interactions between different levels are tested.
This is the base class for both Mercury2D and Mercury3D. Note the actually abstract grid is defined i...
Mdouble getHGridTotalCurrentMaxRelativeDisplacement() const
Returns hGridTotalCurrentMaxRelativeDisplacement_.
void hGridActionsAfterIntegration() override
Sets the totalCurrentMaxRelativeDisplacement_ as 2*currentMaxRelativeDisplacement_.
void write(std::ostream &os, bool writeAllParticles=true) const override
Writes the MercuryBase to an output stream, for example a restart file.
In the HGrid class, here all information about the HGrid is stored.
bool readNextArgument(int &i, int argc, char *argv[]) override
Reads the next command line argument.
void hGridInsertParticle(BaseParticle *obj) override
Inserts a single Particle to current grid.
~MercuryBase()
This is the default destructor.
void setHGridCellOverSizeRatio(Mdouble cellOverSizeRatio)
Sets the ratio of the smallest cell over the smallest particle.
HGridDistribution
Enum that indicates what the ratio of the size of the cells in different levels is.
bool updateEachTimeStep_
Boolean which indicates whether or not the cell in which a particle is must be updated every timestep...
void setHGridMaxLevels(unsigned int HGridMaxLevels)
Sets the maximum number of levels of the HGrid in this MercuryBase.
void hGridActionsBeforeTimeLoop() override
This sets up the broad phase information, has to be done at this stage because it requires the partic...
MercuryBase()
This is the default constructor. It sets sensible defaults.
void hGridRebuild()
This sets up the parameters required for the contact model.
virtual bool hGridHasParticleContacts(const BaseParticle *obj)=0
Purely virtual function that checks if the given particle has a possible contact with any other BaseP...
HGridDistribution getHGridDistribution() const
Gets how the sizes of the cells of different levels are distributed.
void constructor()
This is the actual constructor, it is called do both constructors above.
bool gridNeedsUpdate_
Boolean that indicates whether or not the grid needs to be updated.
void read(std::istream &is) override
Reads the MercuryBase from an input stream, for example a restart file.
bool getHGridUpdateEachTimeStep() const override
Gets whether or not the HGrid is updated every time step.
void broadPhase(BaseParticle *i) override
This checks particles in the HGRID to see if for closer enough for possible contact.
virtual Mdouble userHGridCellSize(unsigned int level)
Virtual function that enables inheriting classes to implement a function to let the user set the cell...
void setHGridDistribution(HGridDistribution hGridDistribution)
Sets how the sizes of the cells of different levels are distributed.
HGrid * getHGrid()
Gets the HGrid used by this problem.
Mdouble currentMaxRelativeDisplacement_
Mdouble that denotes the maximum of the displacement of a particle divided by the cell size of the le...
void hGridActionsBeforeIntegration() override
Resets the currentMaxRelativeDisplacement_ to 0.