MercuryDPM  Beta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PossibleContact Class Reference

Class that describes a possible contact between two BaseParticle. More...

#include <PossibleContact.h>

Public Member Functions

 PossibleContact ()
 Default constructor, sets all pointers to nullptr. More...
 
 PossibleContact (BaseParticle *P1, BaseParticle *P2)
 Constructor that takes two BaseParticle and sets them to be the BaseParticle associated with this PossibleContact. More...
 
 PossibleContact (BaseParticle *P1, BaseParticle *P2, PossibleContact *Next)
 Constructor that takes two BaseParticle and the next global PossibleContact in the list and constructs a PossibleContact from that. More...
 
 PossibleContact (BaseParticle *P1, BaseParticle *P2, PossibleContact *Next, PossibleContact *Next1, PossibleContact *Next2)
 Constructor that should be used, takes all required information as parameters and sets it in the data-members. More...
 
BaseParticlegetP1 ()
 Gets a pointer to the first BaseParticle in this PossibleContact. More...
 
BaseParticlegetP2 ()
 Gets a pointer to the second BaseParticle in this PossibleContact. More...
 
BaseParticlegetOtherParticle (BaseParticle *P)
 Given one BaseParticle of the interacting pair, this function gets the other. More...
 
PossibleContactgetNext ()
 Gets the next PossibleContact in the general linked list of PossibleContact. More...
 
PossibleContactgetNext (BaseParticle *P)
 Gets the next PossibleContact in the linked list of PossibleContact of the given particle. More...
 
PossibleContactgetPrevious ()
 Gets the previous PossibleContact in the general linked list of PossibleContact. More...
 
PossibleContactgetPrevious (BaseParticle *P)
 Gets the previous PossibleContact in the linked list of PossibleContact of the given particle. More...
 
PossibleContactgetNext1 ()
 Gets the next PossibleContact in the linked list of PossibleContact of the first particle in this PossibleContact. More...
 
PossibleContactgetPrevious1 ()
 Gets the previous PossibleContact in the linked list of PossibleContact of the first particle in this PossibleContact. More...
 
PossibleContactgetNext2 ()
 Gets the next PossibleContact in the linked list of PossibleContact of the second particle in this PossibleContact. More...
 
PossibleContactgetPrevious2 ()
 Gets the previous PossibleContact in the linked list of PossibleContact of the second particle in this PossibleContact. More...
 
int getIndex ()
 Gets the index of this PossibleContact. More...
 
void setP1 (BaseParticle *P1)
 Sets the first particle in this PossibleContact. More...
 
void setP2 (BaseParticle *P2)
 Sets the second particle in this PossibleContact. More...
 
void setNextPosition (PossibleContact *Next)
 Sets the next PossibleContact in the linked list of PossibleContac. More...
 
void setNextPosition (BaseParticle *P, PossibleContact *Next)
 Sets the next PossibleContact in the linked list of PossibleContact of the given particle. More...
 
void setPreviousPosition (PossibleContact *Prev)
 Sets the previous PossibleContact in the linked list of PossibleContact of the given particle. More...
 
void setPreviousPosition (BaseParticle *P, PossibleContact *Prev)
 Sets the previous PossibleContact in the linked list of PossibleContact of the given particle. More...
 
void setNextPosition1 (PossibleContact *Next1)
 Sets the next PossibleContact in the linked list of PossibleContact of the first particle in this PossibleContact. More...
 
void setPreviousPosition1 (PossibleContact *Prev1)
 Sets the previous PossibleContact in the linked list of PossibleContact of the first particle in this PossibleContact. More...
 
void setNextPosition2 (PossibleContact *Next2)
 Sets the next PossibleContact in the linked list of PossibleContact of the second particle in this PossibleContact. More...
 
void setPreviousPosition2 (PossibleContact *Prev2)
 Sets the previous PossibleContact in the linked list of PossibleContact of the second particle in this PossibleContact. More...
 

Private Attributes

int index_
 The index of this PossibleContact. More...
 
BaseParticleP1_
 A pointer to the first BaseParticle in this PossibleContact. More...
 
BaseParticleP2_
 A pointer to the second BaseParticle in this PossibleContact. More...
 
PossibleContactNext_
 A pointer to the PossibleContact that comes after this one in the linked list. More...
 
PossibleContactPrev_
 A pointer to the PossibleContact that comes before this one in the linked list. More...
 
PossibleContactNext1_
 A pointer to the PossibleContact that comes after this one in the linked list associated with the first BaseParticle of this PossibleContact. More...
 
PossibleContactPrev1_
 A pointer to the PossibleContact that comes before this one in the linked list associated with the first BaseParticle of this PossibleContact. More...
 
PossibleContactNext2_
 A pointer to the PossibleContact that comes after this one in the linked list associated with the second BaseParticle of this PossibleContact. More...
 
PossibleContactPrev2_
 A pointer to the PossibleContact that comes before this one in the linked list associated with the second BaseParticle of this PossibleContact. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const PossibleContact &o)
 Writes the index of this PossibleContact and the indices of the BaseParticle of this PossibleContact to the given ostream. More...
 

Detailed Description

Class that describes a possible contact between two BaseParticle.

In this class that describes a possible contact two BaseParticle we save both of these BaseParticle, the index of this PossibleContact and the PossibleContact that comes before and after this one in the linked list, both for the general list and the list for each of the particles.

Todo:
Change the names so that they follow the code guidelines.

Definition at line 41 of file PossibleContact.h.

Constructor & Destructor Documentation

PossibleContact::PossibleContact ( )
inline

Default constructor, sets all pointers to nullptr.

Definition at line 47 of file PossibleContact.h.

References index_, Next1_, Next2_, Next_, P1_, P2_, Prev1_, Prev2_, and Prev_.

48  {
49  P1_ = nullptr;
50  P2_ = nullptr;
51  Next_ = nullptr;
52  Prev_ = nullptr;
53  Next1_ = nullptr;
54  Prev1_ = nullptr;
55  Next2_ = nullptr;
56  Prev2_ = nullptr;
57  index_ = 0;
58  }
PossibleContact * Prev2_
A pointer to the PossibleContact that comes before this one in the linked list associated with the se...
PossibleContact * Next1_
A pointer to the PossibleContact that comes after this one in the linked list associated with the fir...
PossibleContact * Next_
A pointer to the PossibleContact that comes after this one in the linked list.
PossibleContact * Next2_
A pointer to the PossibleContact that comes after this one in the linked list associated with the sec...
int index_
The index of this PossibleContact.
PossibleContact * Prev1_
A pointer to the PossibleContact that comes before this one in the linked list associated with the fi...
BaseParticle * P1_
A pointer to the first BaseParticle in this PossibleContact.
BaseParticle * P2_
A pointer to the second BaseParticle in this PossibleContact.
PossibleContact * Prev_
A pointer to the PossibleContact that comes before this one in the linked list.
PossibleContact::PossibleContact ( BaseParticle P1,
BaseParticle P2 
)
inline

Constructor that takes two BaseParticle and sets them to be the BaseParticle associated with this PossibleContact.

Parameters
[in]P1A pointer to the first BaseParticle in this PossibleContact.
[in]P2A pointer to the second BaseParticle in this PossibleContact.

Definition at line 65 of file PossibleContact.h.

References index_, Next1_, Next2_, Next_, P1_, P2_, Prev1_, Prev2_, and Prev_.

66  {
67  P1_ = P1;
68  P2_ = P2;
69  Next_ = nullptr;
70  Prev_ = nullptr;
71  Next1_ = nullptr;
72  Prev1_ = nullptr;
73  Next2_ = nullptr;
74  Prev2_ = nullptr;
75  index_ = 0;
76  }
PossibleContact * Prev2_
A pointer to the PossibleContact that comes before this one in the linked list associated with the se...
PossibleContact * Next1_
A pointer to the PossibleContact that comes after this one in the linked list associated with the fir...
PossibleContact * Next_
A pointer to the PossibleContact that comes after this one in the linked list.
PossibleContact * Next2_
A pointer to the PossibleContact that comes after this one in the linked list associated with the sec...
int index_
The index of this PossibleContact.
PossibleContact * Prev1_
A pointer to the PossibleContact that comes before this one in the linked list associated with the fi...
BaseParticle * P1_
A pointer to the first BaseParticle in this PossibleContact.
BaseParticle * P2_
A pointer to the second BaseParticle in this PossibleContact.
PossibleContact * Prev_
A pointer to the PossibleContact that comes before this one in the linked list.
PossibleContact::PossibleContact ( BaseParticle P1,
BaseParticle P2,
PossibleContact Next 
)
inline

Constructor that takes two BaseParticle and the next global PossibleContact in the list and constructs a PossibleContact from that.

Parameters
[in]P1A pointer to the first BaseParticle in this PossibleContact.
[in]P2A pointer to the second BaseParticle in this PossibleContact.
[in]NextA pointer to the PossibleContact that comes after this one in the linked list.

Definition at line 84 of file PossibleContact.h.

References getIndex(), index_, Next1_, Next2_, Next_, P1_, P2_, Prev1_, Prev2_, and Prev_.

85  {
86  P1_ = P1;
87  P2_ = P2;
88  Next_ = Next;
89  Prev_ = nullptr;
90  if (Next != nullptr)
91  index_ = Next->getIndex() + 1;
92  else
93  index_ = 0;
94 
95  Next1_ = nullptr;
96  Prev1_ = nullptr;
97  Next2_ = nullptr;
98  Prev2_ = nullptr;
99  }
PossibleContact * Prev2_
A pointer to the PossibleContact that comes before this one in the linked list associated with the se...
PossibleContact * Next1_
A pointer to the PossibleContact that comes after this one in the linked list associated with the fir...
PossibleContact * Next_
A pointer to the PossibleContact that comes after this one in the linked list.
PossibleContact * Next2_
A pointer to the PossibleContact that comes after this one in the linked list associated with the sec...
int index_
The index of this PossibleContact.
PossibleContact * Prev1_
A pointer to the PossibleContact that comes before this one in the linked list associated with the fi...
BaseParticle * P1_
A pointer to the first BaseParticle in this PossibleContact.
BaseParticle * P2_
A pointer to the second BaseParticle in this PossibleContact.
int getIndex()
Gets the index of this PossibleContact.
PossibleContact * Prev_
A pointer to the PossibleContact that comes before this one in the linked list.
PossibleContact::PossibleContact ( BaseParticle P1,
BaseParticle P2,
PossibleContact Next,
PossibleContact Next1,
PossibleContact Next2 
)
inline

Constructor that should be used, takes all required information as parameters and sets it in the data-members.

Parameters
[in]P1A pointer to the first BaseParticle in this PossibleContact.
[in]P2A pointer to the second BaseParticle in this PossibleContact.
[in]NextA pointer to the PossibleContact that comes after this one in the linked list.
[in]Next1A pointer to the PossibleContact that comes after this one in the linked list associated with the first BaseParticle of this PossibleContact.
[in]Next2A pointer to the PossibleContact that comes after this one in the linked list associated with the second BaseParticle of this PossibleContact.

Definition at line 109 of file PossibleContact.h.

References getIndex(), index_, Next1_, Next2_, Next_, P1_, P2_, Prev1_, Prev2_, and Prev_.

110  {
111  P1_ = P1;
112  P2_ = P2;
113  Next_ = Next;
114  Next1_ = Next1;
115  Next2_ = Next2;
116  Prev_ = 0;
117  Prev1_ = 0;
118  Prev2_ = 0;
119  if (Next != nullptr)
120  index_ = Next->getIndex() + 1;
121  else
122  index_ = 0;
123  }
PossibleContact * Prev2_
A pointer to the PossibleContact that comes before this one in the linked list associated with the se...
PossibleContact * Next1_
A pointer to the PossibleContact that comes after this one in the linked list associated with the fir...
PossibleContact * Next_
A pointer to the PossibleContact that comes after this one in the linked list.
PossibleContact * Next2_
A pointer to the PossibleContact that comes after this one in the linked list associated with the sec...
int index_
The index of this PossibleContact.
PossibleContact * Prev1_
A pointer to the PossibleContact that comes before this one in the linked list associated with the fi...
BaseParticle * P1_
A pointer to the first BaseParticle in this PossibleContact.
BaseParticle * P2_
A pointer to the second BaseParticle in this PossibleContact.
int getIndex()
Gets the index of this PossibleContact.
PossibleContact * Prev_
A pointer to the PossibleContact that comes before this one in the linked list.

Member Function Documentation

int PossibleContact::getIndex ( )
inline

Gets the index of this PossibleContact.

Returns
The index of this PossibleContact.

Definition at line 255 of file PossibleContact.h.

References index_.

Referenced by PossibleContact(), and PossibleContactList::remove_ParticlePosibleContacts().

256  {
257  return index_;
258  }
int index_
The index of this PossibleContact.
PossibleContact* PossibleContact::getNext ( )
inline

Gets the next PossibleContact in the general linked list of PossibleContact.

Returns
A pointer to the next PossibleContact in the linked list.

Definition at line 165 of file PossibleContact.h.

References Next_.

Referenced by PossibleContactList::add_PossibleContact(), DPMBase::computeAllForces(), PossibleContactList::remove_ParticlePosibleContacts(), and PossibleContactList::write().

166  {
167  return Next_;
168  }
PossibleContact * Next_
A pointer to the PossibleContact that comes after this one in the linked list.
PossibleContact* PossibleContact::getNext ( BaseParticle P)
inline

Gets the next PossibleContact in the linked list of PossibleContact of the given particle.

Parameters
[in]PA pointer to the BaseParticle for which we want to have the next contact of.
Returns
A pointer to the next PossibleContact in the linked list of PossibleContact of the given particle.

Definition at line 175 of file PossibleContact.h.

References BaseObject::getIndex(), logger, Next1_, Next2_, P1_, P2_, and WARN.

176  {
177  if (P1_ == P)
178  return Next1_;
179  else if (P2_ == P)
180  return Next2_;
181  else
182  {
183  logger(WARN, "PossibleContact* getNext(Particle* P), no match for %. Possibilities are % and %.", P->getIndex(), P1_->getIndex(), P2_->getIndex());
184  return nullptr;
185  }
186  }
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.cc:106
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
PossibleContact * Next1_
A pointer to the PossibleContact that comes after this one in the linked list associated with the fir...
PossibleContact * Next2_
A pointer to the PossibleContact that comes after this one in the linked list associated with the sec...
BaseParticle * P1_
A pointer to the first BaseParticle in this PossibleContact.
BaseParticle * P2_
A pointer to the second BaseParticle in this PossibleContact.
PossibleContact* PossibleContact::getNext1 ( )
inline

Gets the next PossibleContact in the linked list of PossibleContact of the first particle in this PossibleContact.

Returns
A pointer to the next PossibleContact in the linked list of PossibleContact of the first particle in this PossibleContact.

Definition at line 219 of file PossibleContact.h.

References Next1_.

Referenced by PossibleContactList::add_PossibleContact().

220  {
221  return Next1_;
222  }
PossibleContact * Next1_
A pointer to the PossibleContact that comes after this one in the linked list associated with the fir...
PossibleContact* PossibleContact::getNext2 ( )
inline

Gets the next PossibleContact in the linked list of PossibleContact of the second particle in this PossibleContact.

Returns
A pointer to the next PossibleContact in the linked list of PossibleContact of the second particle in this PossibleContact.

Definition at line 237 of file PossibleContact.h.

References Next2_.

Referenced by PossibleContactList::add_PossibleContact().

238  {
239  return Next2_;
240  }
PossibleContact * Next2_
A pointer to the PossibleContact that comes after this one in the linked list associated with the sec...
BaseParticle* PossibleContact::getOtherParticle ( BaseParticle P)
inline

Given one BaseParticle of the interacting pair, this function gets the other.

Parameters
[in]PA pointer to one of the BaseParticle of this PossibleContact.
Returns
The other BaseParticle of this PossibleContact.

Definition at line 148 of file PossibleContact.h.

References BaseObject::getIndex(), P1_, and P2_.

Referenced by PossibleContactList::remove_ParticlePosibleContacts().

149  {
150  if (P1_ == P)
151  return P2_;
152  else if (P2_ == P)
153  return P1_;
154  else
155  {
156  std::cout << "Particle* getOtherParticle(Particle *P), no match for " << P->getIndex() << " posibilities are " << P1_->getIndex() << " and " << P2_->getIndex() << std::endl;
157  return nullptr;
158  }
159  }
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.cc:106
BaseParticle * P1_
A pointer to the first BaseParticle in this PossibleContact.
BaseParticle * P2_
A pointer to the second BaseParticle in this PossibleContact.
BaseParticle* PossibleContact::getP1 ( )
inline

Gets a pointer to the first BaseParticle in this PossibleContact.

Returns
A pointer to the first BaseParticle in this PossibleContact.

Definition at line 129 of file PossibleContact.h.

References P1_.

Referenced by DPMBase::computeAllForces(), and PossibleContactList::remove_ParticlePosibleContacts().

130  {
131  return P1_;
132  }
BaseParticle * P1_
A pointer to the first BaseParticle in this PossibleContact.
BaseParticle* PossibleContact::getP2 ( )
inline

Gets a pointer to the second BaseParticle in this PossibleContact.

Returns
A pointer to the second BaseParticle in this PossibleContact.

Definition at line 138 of file PossibleContact.h.

References P2_.

Referenced by DPMBase::computeAllForces(), and PossibleContactList::remove_ParticlePosibleContacts().

139  {
140  return P2_;
141  }
BaseParticle * P2_
A pointer to the second BaseParticle in this PossibleContact.
PossibleContact* PossibleContact::getPrevious ( )
inline

Gets the previous PossibleContact in the general linked list of PossibleContact.

Returns
A pointer to the previous PossibleContact in the general linked list of PossibleContact.

Definition at line 192 of file PossibleContact.h.

References Prev_.

Referenced by PossibleContactList::remove_ParticlePosibleContacts().

193  {
194  return Prev_;
195  }
PossibleContact * Prev_
A pointer to the PossibleContact that comes before this one in the linked list.
PossibleContact* PossibleContact::getPrevious ( BaseParticle P)
inline

Gets the previous PossibleContact in the linked list of PossibleContact of the given particle.

Parameters
[in]PA pointer to the BaseParticle we want to know the previous PossibleContact for.
Returns
A pointer to the previous PossibleContact in the linked list of PossibleContact of the given particle.

Definition at line 202 of file PossibleContact.h.

References BaseObject::getIndex(), logger, P1_, P2_, Prev1_, Prev2_, and WARN.

203  {
204  if (P1_ == P)
205  return Prev1_;
206  else if (P2_ == P)
207  return Prev2_;
208  else
209  {
210  logger(WARN, "PossibleContact* getPrevious(Particle* P), no match for %. Possibilities are % and %.", P->getIndex(), P1_->getIndex(), P2_->getIndex());
211  return nullptr;
212  }
213  }
PossibleContact * Prev2_
A pointer to the PossibleContact that comes before this one in the linked list associated with the se...
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.cc:106
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
PossibleContact * Prev1_
A pointer to the PossibleContact that comes before this one in the linked list associated with the fi...
BaseParticle * P1_
A pointer to the first BaseParticle in this PossibleContact.
BaseParticle * P2_
A pointer to the second BaseParticle in this PossibleContact.
PossibleContact* PossibleContact::getPrevious1 ( )
inline

Gets the previous PossibleContact in the linked list of PossibleContact of the first particle in this PossibleContact.

Returns
A pointer to the previous PossibleContact in the linked list of PossibleContact of the first particle in this PossibleContact.

Definition at line 228 of file PossibleContact.h.

References Prev1_.

229  {
230  return Prev1_;
231  }
PossibleContact * Prev1_
A pointer to the PossibleContact that comes before this one in the linked list associated with the fi...
PossibleContact* PossibleContact::getPrevious2 ( )
inline

Gets the previous PossibleContact in the linked list of PossibleContact of the second particle in this PossibleContact.

Returns
A pointer to the previous PossibleContact in the linked list of PossibleContact of the second particle in this PossibleContact.

Definition at line 246 of file PossibleContact.h.

References Prev2_.

247  {
248  return Prev2_;
249  }
PossibleContact * Prev2_
A pointer to the PossibleContact that comes before this one in the linked list associated with the se...
void PossibleContact::setNextPosition ( PossibleContact Next)
inline

Sets the next PossibleContact in the linked list of PossibleContac.

Parameters
[in]NextA pointer to the PossibleContact which is the next PossibleContact in the linked list of PossibleContact

Definition at line 282 of file PossibleContact.h.

References Next_.

Referenced by PossibleContactList::remove_ParticlePosibleContacts().

283  {
284  Next_ = Next;
285  }
PossibleContact * Next_
A pointer to the PossibleContact that comes after this one in the linked list.
void PossibleContact::setNextPosition ( BaseParticle P,
PossibleContact Next 
)
inline

Sets the next PossibleContact in the linked list of PossibleContact of the given particle.

Parameters
[in]PA pointer to the BaseParticle for which the next PossibleContact in the linked list must be set for.
[in]NextA pointer to the PossibleContact which is the next PossibleContact for the given BaseParticle.

Definition at line 292 of file PossibleContact.h.

References BaseObject::getIndex(), logger, Next1_, Next2_, P1_, P2_, and WARN.

293  {
294  if (P1_ == P)
295  Next1_ = Next;
296  else if (P2_ == P)
297  Next2_ = Next;
298  else
299  logger(WARN, "void setNextPosition(Particle* P,PossibleContact* Next), no match for %. Possibilities are % and % ", P->getIndex(), P1_->getIndex(), P2_->getIndex());
300  }
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.cc:106
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
PossibleContact * Next1_
A pointer to the PossibleContact that comes after this one in the linked list associated with the fir...
PossibleContact * Next2_
A pointer to the PossibleContact that comes after this one in the linked list associated with the sec...
BaseParticle * P1_
A pointer to the first BaseParticle in this PossibleContact.
BaseParticle * P2_
A pointer to the second BaseParticle in this PossibleContact.
void PossibleContact::setNextPosition1 ( PossibleContact Next1)
inline

Sets the next PossibleContact in the linked list of PossibleContact of the first particle in this PossibleContact.

Parameters
[in]Next1A pointer to the PossibleContact which is the next PossibleContact for the first BaseParticle.

Definition at line 330 of file PossibleContact.h.

References Next1_.

331  {
332  Next1_ = Next1;
333  }
PossibleContact * Next1_
A pointer to the PossibleContact that comes after this one in the linked list associated with the fir...
void PossibleContact::setNextPosition2 ( PossibleContact Next2)
inline

Sets the next PossibleContact in the linked list of PossibleContact of the second particle in this PossibleContact.

Parameters
[in]Next2A pointer to the PossibleContact which is the next PossibleContact for the second BaseParticle.

Definition at line 348 of file PossibleContact.h.

References Next2_.

349  {
350  Next2_ = Next2;
351  }
PossibleContact * Next2_
A pointer to the PossibleContact that comes after this one in the linked list associated with the sec...
void PossibleContact::setP1 ( BaseParticle P1)
inline

Sets the first particle in this PossibleContact.

Parameters
[in]P1A pointer to the BaseParticle that must be set as the first BaseParticle.

Definition at line 264 of file PossibleContact.h.

References P1_.

265  {
266  P1_ = P1;
267  }
BaseParticle * P1_
A pointer to the first BaseParticle in this PossibleContact.
void PossibleContact::setP2 ( BaseParticle P2)
inline

Sets the second particle in this PossibleContact.

Parameters
[in]P2A pointer to the BaseParticle that must be set as the second BaseParticle.

Definition at line 273 of file PossibleContact.h.

References P2_.

274  {
275  P2_ = P2;
276  }
BaseParticle * P2_
A pointer to the second BaseParticle in this PossibleContact.
void PossibleContact::setPreviousPosition ( PossibleContact Prev)
inline

Sets the previous PossibleContact in the linked list of PossibleContact of the given particle.

Parameters
[in]PrevA pointer to the PossibleContact which is the previous PossibleContact in the linked list of PossibleContact

Definition at line 306 of file PossibleContact.h.

References Prev_.

Referenced by PossibleContactList::add_PossibleContact(), and PossibleContactList::remove_ParticlePosibleContacts().

307  {
308  Prev_ = Prev;
309  }
PossibleContact * Prev_
A pointer to the PossibleContact that comes before this one in the linked list.
void PossibleContact::setPreviousPosition ( BaseParticle P,
PossibleContact Prev 
)
inline

Sets the previous PossibleContact in the linked list of PossibleContact of the given particle.

Parameters
[in]PA pointer to the BaseParticle for which the previous PossibleContact in the linked list must be set for.
[in]PrevA pointer to the PossibleContact which is the previous PossibleContact for the given BaseParticle.

Definition at line 316 of file PossibleContact.h.

References BaseObject::getIndex(), logger, P1_, P2_, Prev1_, Prev2_, and WARN.

317  {
318  if (P1_ == P)
319  Prev1_ = Prev;
320  else if (P2_ == P)
321  Prev2_ = Prev;
322  else
323  logger(WARN, "void setPreviousPosition(Particle* P,PossibleContact* Prev), no match for %. Possibilities are % and % ", P->getIndex(), P1_->getIndex(), P2_->getIndex());
324  }
PossibleContact * Prev2_
A pointer to the PossibleContact that comes before this one in the linked list associated with the se...
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.cc:106
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
PossibleContact * Prev1_
A pointer to the PossibleContact that comes before this one in the linked list associated with the fi...
BaseParticle * P1_
A pointer to the first BaseParticle in this PossibleContact.
BaseParticle * P2_
A pointer to the second BaseParticle in this PossibleContact.
void PossibleContact::setPreviousPosition1 ( PossibleContact Prev1)
inline

Sets the previous PossibleContact in the linked list of PossibleContact of the first particle in this PossibleContact.

Parameters
[in]Prev1A pointer to the PossibleContact which is the previous PossibleContact for the first BaseParticle.

Definition at line 339 of file PossibleContact.h.

References Prev1_.

340  {
341  Prev1_ = Prev1;
342  }
PossibleContact * Prev1_
A pointer to the PossibleContact that comes before this one in the linked list associated with the fi...
void PossibleContact::setPreviousPosition2 ( PossibleContact Prev2)
inline

Sets the previous PossibleContact in the linked list of PossibleContact of the second particle in this PossibleContact.

Parameters
[in]Prev2A pointer to the PossibleContact which is the previous PossibleContact for the second BaseParticle.

Definition at line 357 of file PossibleContact.h.

References Prev2_.

358  {
359  Prev2_ = Prev2;
360  }
PossibleContact * Prev2_
A pointer to the PossibleContact that comes before this one in the linked list associated with the se...

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const PossibleContact o 
)
friend

Writes the index of this PossibleContact and the indices of the BaseParticle of this PossibleContact to the given ostream.

Parameters
[in,out]osThe output stream to which this PossibleContact must be written.
[in]oThe PossibleContact that must be written.
Returns
The output stream to which this PossibleContact has been written.

Definition at line 368 of file PossibleContact.h.

369  {
370  os<<o.index_<<" between ("<<o.P1_->getIndex()<<","<<o.P2_->getIndex()<<")";
371  return os;
372  }
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.cc:106
int index_
The index of this PossibleContact.
BaseParticle * P1_
A pointer to the first BaseParticle in this PossibleContact.
BaseParticle * P2_
A pointer to the second BaseParticle in this PossibleContact.

Member Data Documentation

int PossibleContact::index_
private

The index of this PossibleContact.

Definition at line 378 of file PossibleContact.h.

Referenced by getIndex(), and PossibleContact().

PossibleContact* PossibleContact::Next1_
private

A pointer to the PossibleContact that comes after this one in the linked list associated with the first BaseParticle of this PossibleContact.

Definition at line 398 of file PossibleContact.h.

Referenced by getNext(), getNext1(), PossibleContact(), setNextPosition(), and setNextPosition1().

PossibleContact* PossibleContact::Next2_
private

A pointer to the PossibleContact that comes after this one in the linked list associated with the second BaseParticle of this PossibleContact.

Definition at line 406 of file PossibleContact.h.

Referenced by getNext(), getNext2(), PossibleContact(), setNextPosition(), and setNextPosition2().

PossibleContact* PossibleContact::Next_
private

A pointer to the PossibleContact that comes after this one in the linked list.

Definition at line 390 of file PossibleContact.h.

Referenced by getNext(), PossibleContact(), and setNextPosition().

BaseParticle* PossibleContact::P1_
private
BaseParticle* PossibleContact::P2_
private
PossibleContact* PossibleContact::Prev1_
private

A pointer to the PossibleContact that comes before this one in the linked list associated with the first BaseParticle of this PossibleContact.

Definition at line 402 of file PossibleContact.h.

Referenced by getPrevious(), getPrevious1(), PossibleContact(), setPreviousPosition(), and setPreviousPosition1().

PossibleContact* PossibleContact::Prev2_
private

A pointer to the PossibleContact that comes before this one in the linked list associated with the second BaseParticle of this PossibleContact.

Definition at line 410 of file PossibleContact.h.

Referenced by getPrevious(), getPrevious2(), PossibleContact(), setPreviousPosition(), and setPreviousPosition2().

PossibleContact* PossibleContact::Prev_
private

A pointer to the PossibleContact that comes before this one in the linked list.

Definition at line 394 of file PossibleContact.h.

Referenced by getPrevious(), PossibleContact(), and setPreviousPosition().


The documentation for this class was generated from the following file: