MercuryDPM
Alpha
|
Manages the linked list of PossibleContact. More...
#include <PossibleContactList.h>
Public Member Functions | |
PossibleContactList () | |
Constructor, sets the firstPossibleContact_ to a nullptr since there are no possible interactions yet. More... | |
void | add_PossibleContact (BaseParticle *P1, BaseParticle *P2) |
Add the possible contact between two given BaseParticle to the linked list. More... | |
void | remove_ParticlePosibleContacts (BaseParticle *P) |
Remove all PossibleContact with given BaseParticle from the linked list. More... | |
void | write (std::ostream &os) const |
Write all PossibleContact to the given ostream. More... | |
PossibleContact * | getFirstPossibleContact () |
Get the front of the linked list of PossibleContact. More... | |
Private Attributes | |
PossibleContact * | firstPossibleContact_ |
The pointer to the first PossibleContact on the linked list. More... | |
Manages the linked list of PossibleContact.
Please note that the PossibleContact at the front of the list is the one that is added last, so firstPossibleContact_ is the PossibleContact that has been added last.
Look at the memory management of PossibleContactList. Maybe a destructor that takes out all remaining PossibleContact? Or is there a Handler that calls remove_ParticlePosibleContacts for all particles?
Restart-tests are not working with CONTACT_LIST_HGRID turned on, so either finish the ContactList-related code, or get rid of it. If we keep it, clean up the code, in particular the naming-convention.
Definition at line 43 of file PossibleContactList.h.
|
inline |
Constructor, sets the firstPossibleContact_ to a nullptr since there are no possible interactions yet.
Definition at line 50 of file PossibleContactList.h.
References DEBUG, firstPossibleContact_, and logger.
|
inline |
Add the possible contact between two given BaseParticle to the linked list.
[in] | P1 | A pointer to the first BaseParticle we want to make a PossibleContact with. |
[in] | P2 | A pointer to the second BaseParticle we want to make a PossibleContact with. |
If there is a PossibleContact between two BaseParticle, make a new PossibleContact and put it in front of the linked list. Then assign the newly made PossibleContact to the former front of the linked list.
Definition at line 64 of file PossibleContactList.h.
References firstPossibleContact_, BaseObject::getIndex(), PossibleContact::getNext(), PossibleContact::getNext1(), PossibleContact::getNext2(), logger, PossibleContact::setPreviousPosition(), and VERBOSE.
|
inline |
Get the front of the linked list of PossibleContact.
Definition at line 147 of file PossibleContactList.h.
References firstPossibleContact_.
|
inline |
Remove all PossibleContact with given BaseParticle from the linked list.
[in] | P | A pointer to the BaseParticle we want to remove all PossibleContact for. |
To remove all PossibleContact with given BaseParticle from the linked list of all PossibleContact, go through all PossibleContact that are given as a list for the given BaseParticle, and then remove it from the global list by correcting all pointers and then delete the PossibleContact.
Definition at line 87 of file PossibleContactList.h.
References firstPossibleContact_, BaseObject::getIndex(), PossibleContact::getIndex(), PossibleContact::getNext(), PossibleContact::getOtherParticle(), PossibleContact::getP1(), PossibleContact::getP2(), PossibleContact::getPrevious(), logger, O, PossibleContact::setNextPosition(), PossibleContact::setPreviousPosition(), and VERBOSE.
|
inline |
Write all PossibleContact to the given ostream.
[in,out] | os | The output stream the PossibleContactList must be written to. |
Definition at line 132 of file PossibleContactList.h.
References firstPossibleContact_, and PossibleContact::getNext().
|
private |
The pointer to the first PossibleContact on the linked list.
Please note that this is the PossibleContact that has been added last.
Definition at line 158 of file PossibleContactList.h.
Referenced by add_PossibleContact(), getFirstPossibleContact(), PossibleContactList(), remove_ParticlePosibleContacts(), and write().