MercuryDPM  Trunk
 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_.

111  {
112  P1_ = P1;
113  P2_ = P2;
114  Next_ = Next;
115  Next1_ = Next1;
116  Next2_ = Next2;
117  Prev_ = 0;
118  Prev1_ = 0;
119  Prev2_ = 0;
120  if (Next != nullptr)
121  index_ = Next->getIndex() + 1;
122  else
123  index_ = 0;
124  }
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 259 of file PossibleContact.h.

References index_.

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

260  {
261  return index_;
262  }
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 167 of file PossibleContact.h.

References Next_.

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

168  {
169  return Next_;
170  }
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 177 of file PossibleContact.h.

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

178  {
179  if (P1_ == P)
180  return Next1_;
181  else if (P2_ == P)
182  return Next2_;
183  else
184  {
185  logger(WARN, "PossibleContact* getNext(Particle* P), no match for %. Possibilities are % and %.",
186  P->getIndex(), P1_->getIndex(), P2_->getIndex());
187  return nullptr;
188  }
189  }
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.h:118
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 223 of file PossibleContact.h.

References Next1_.

Referenced by PossibleContactList::add_PossibleContact().

224  {
225  return Next1_;
226  }
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 241 of file PossibleContact.h.

References Next2_.

Referenced by PossibleContactList::add_PossibleContact().

242  {
243  return Next2_;
244  }
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 149 of file PossibleContact.h.

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

Referenced by PossibleContactList::remove_ParticlePosibleContacts().

150  {
151  if (P1_ == P)
152  return P2_;
153  else if (P2_ == P)
154  return P1_;
155  else
156  {
157  logger(WARN, "Particle* getOtherParticle(Particle *P), no match for % posibilities are % and %",
158  P->getIndex(), P1_->getIndex(), P2_->getIndex());
159  return nullptr;
160  }
161  }
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.h:118
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
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 130 of file PossibleContact.h.

References P1_.

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

131  {
132  return P1_;
133  }
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 139 of file PossibleContact.h.

References P2_.

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

140  {
141  return P2_;
142  }
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 195 of file PossibleContact.h.

References Prev_.

Referenced by PossibleContactList::remove_ParticlePosibleContacts().

196  {
197  return Prev_;
198  }
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 205 of file PossibleContact.h.

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

206  {
207  if (P1_ == P)
208  return Prev1_;
209  else if (P2_ == P)
210  return Prev2_;
211  else
212  {
213  logger(WARN, "PossibleContact* getPrevious(Particle* P), no match for %. Possibilities are % and %.",
214  P->getIndex(), P1_->getIndex(), P2_->getIndex());
215  return nullptr;
216  }
217  }
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.h:118
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 232 of file PossibleContact.h.

References Prev1_.

233  {
234  return Prev1_;
235  }
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 250 of file PossibleContact.h.

References Prev2_.

251  {
252  return Prev2_;
253  }
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 286 of file PossibleContact.h.

References Next_.

Referenced by PossibleContactList::remove_ParticlePosibleContacts().

287  {
288  Next_ = Next;
289  }
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 296 of file PossibleContact.h.

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

297  {
298  if (P1_ == P)
299  Next1_ = Next;
300  else if (P2_ == P)
301  Next2_ = Next;
302  else
303  logger(WARN,
304  "void setNextPosition(Particle* P,PossibleContact* Next), no match for %. Possibilities are % and % ",
305  P->getIndex(), P1_->getIndex(), P2_->getIndex());
306  }
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.h:118
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 338 of file PossibleContact.h.

References Next1_.

339  {
340  Next1_ = Next1;
341  }
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 356 of file PossibleContact.h.

References Next2_.

357  {
358  Next2_ = Next2;
359  }
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 268 of file PossibleContact.h.

References P1_.

269  {
270  P1_ = P1;
271  }
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 277 of file PossibleContact.h.

References P2_.

278  {
279  P2_ = P2;
280  }
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 312 of file PossibleContact.h.

References Prev_.

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

313  {
314  Prev_ = Prev;
315  }
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 322 of file PossibleContact.h.

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

323  {
324  if (P1_ == P)
325  Prev1_ = Prev;
326  else if (P2_ == P)
327  Prev2_ = Prev;
328  else
329  logger(WARN,
330  "void setPreviousPosition(Particle* P,PossibleContact* Prev), no match for %. Possibilities are % and % ",
331  P->getIndex(), P1_->getIndex(), P2_->getIndex());
332  }
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.h:118
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 347 of file PossibleContact.h.

References Prev1_.

348  {
349  Prev1_ = Prev1;
350  }
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 365 of file PossibleContact.h.

References Prev2_.

366  {
367  Prev2_ = Prev2;
368  }
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 376 of file PossibleContact.h.

377  {
378  os << o.index_ << " between (" << o.P1_->getIndex() << "," << o.P2_->getIndex() << ")";
379  return os;
380  }
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.h:118
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 386 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 406 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 414 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 398 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 410 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 418 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 402 of file PossibleContact.h.

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


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