41 logger(
DEBUG,
"InteractionHandler::InteractionHandler() finished");
54 logger(
DEBUG,
"InteractionHandler::InteractionHandler(const "
55 "InteractionHandler &IH) finished, please note that no interactions"
56 " have been copied.");
68 logger(
DEBUG,
"InteractionHandler::operator =(const InteractionHandler& rhs) finished.");
74 logger(
DEBUG,
"InteractionHandler::~InteractionHandler() finished");
98 if ((*it)->getI() == I)
234 return "InteractionHandler";
245 os << (*i) << std::endl;
253 std::string type, dummy, idType;
254 unsigned int id0, id1;
257 std::stringstream line(std::stringstream::in | std::stringstream::out);
259 line >> type >> idType >> id0 >> id1 >> dummy >> timeStamp;
262 if (idType.compare(
"particleIds") == 0)
unsigned int getIndex() const
Returns the index of the object in the handler.
BaseSpecies is the class from which all other species are derived.
void write(std::ostream &os) const
Writes the InteractionHandler to an output stream, for example a restart file.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
virtual BaseInteraction * getNewInteraction(BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp)=0
returns new Interaction object.
T * getObjectById(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
void setI(BaseInteractable *I)
Sets the second object involved in the interaction (often particle or wall).
BaseInteraction * getInteraction(BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp)
Returns the Interaction between the BaseInteractable's P and I.
InteractionHandler()
Default constructor, it creates an empty InteractionHandler.
~InteractionHandler()
Destructor, it destructs the InteractionHandler and all BaseInteraction it contains.
Mdouble getTimeStamp() const
Returns an Mdouble which is the time stamp of the interaction.
void setSpecies(BaseSpecies *species)
Set the Species of the interaction; note this can either be a Species or MixedSpecies.
Stores information about interactions between two interactable objects; often particles but could be ...
void eraseOldInteractions(Mdouble lastTimeStep)
erases interactions which have an old timestamp.
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
void setTimeStamp(Mdouble timeStamp)
Updates the time step of the interacting. Note, timesteps used to find completed interactions.
BaseInteraction * getExistingInteraction(BaseInteractable *P, BaseInteractable *I)
Returns the Interaction between the BaseInteractable's P and I if it exists, otherwise returns a null...
void removeObjectKeepingPeriodics(unsigned const int id)
Removes interactions of periodic particles when the periodic particles get deleted (see DPMBase::remo...
InteractionHandler operator=(const InteractionHandler &rhs)
Assignment operator.
void getLineFromStringStream(std::istream &in, std::stringstream &out)
Reads a line from one stringstream into another, and prepares the latter for reading in...
virtual void removeObject(unsigned const int id)
Removes an Object from the BaseHandler.
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Container to store Interaction objects.
BaseInteraction * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
void setHandler(InteractionHandler *handler)
Sets the pointer to the interaction hander which is storing this interaction.
std::string getName() const
Returns the name of the object.
virtual void addObject(T *O)
Adds a new Object to the BaseHandler.
Container to store the pointers to all objects that one creates in a simulation.
unsigned int getNumberOfObjects() const
Gets the number of Object in this BaseHandler.
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
U::MixedSpeciesType * getMixedObject(const U *S, const U *T)
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
BaseInteractable * getI()
Defines the basic properties that a interactable object can have.
void readObject(std::istream &is)
Reads an Interaction into the InteractionHandler from restart data.
const std::list< BaseInteraction * > & getInteractions() const
Returns a reference to the list of interactions in this BaseInteractable.
unsigned int getIndSpecies() const
Returns the index of the Species of this BaseInteractable.
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
void addObject(BaseInteraction *I)
Adds an Interaction to the InteractionHandler.
void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0...