79 unsigned int failed = 0;
virtual void checkBoundaryBeforeTimeStep(DPMBase *md)
Fills the boundary with particles.
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
InsertionBoundary()
Default constructor: set everything to 0/nullptr.
void write(std::ostream &os) const =0
Adds object's id_ to given ostream NB: purely virtual function.
unsigned int getMaxFailed() const
Gets the number of times that the boundary may fail to insert a particle.
BaseParticle * particleToCopy_
Particle that will be inserted through the insertion boundary.
void setMaxFailed(unsigned int maxFailed)
Sets the number of times that the wall may fail to insert a particle.
unsigned int maxFailed_
Number of times that the wall may fail to insert a particle.
Boundary structure for boundaries used for insertion of particles.
void setParticleToCopy(BaseParticle *particleToCopy)
Sets the particle that will be inserted through the insertion boundary.
virtual bool checkParticleForInteraction(const BaseParticle &P)
Checks if the particle having any interaction with walls or other particles.
U * copyAndAddObject(const U &O)
Creates a copy of a Object and adds it to the BaseHandler.
unsigned int getNumberOfParticlesInserted() const
Gets the number of particles inserted by the boundary.
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
BaseParticle * getParticleToCopy() const
Gets the particle that will be inserted through the insertion boundary.
void set(BaseParticle *particleToCopy, unsigned int maxFailed)
Sets the particle that will be inserted and the maximum number of times for which insertion may fail...
virtual BaseParticle * generateParticle(RNG &random)=0
Purely virtual function that generates one particle.
RNG random
This is a random generator, often used for setting up the initial conditions etc...
virtual ~InsertionBoundary()
Destructor: delete the particle that has to be copied at every insertion.
unsigned int numberOfParticlesInserted_
Number of particles that are already inserted.
void read(std::istream &is)
Reads the boundary's id_ and maxFailed_.
void write(std::ostream &os) const
Writes the boundary's id_ and maxFailed_.
virtual BaseParticle * copy() const
Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism.
void read(std::istream &is)=0
Reads the object's id_ from given istream NB: purely virtual function.