MercuryDPM  0.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ParticleHandler Class Reference

Container to store all BaseParticle. More...

#include <ParticleHandler.h>

+ Inheritance diagram for ParticleHandler:

Public Member Functions

 ParticleHandler ()
 Default constructor, it simply creates an empty ParticleHandler. More...
 
 ParticleHandler (const ParticleHandler &PH)
 Copy constructor, it copies the ParticleHandler and all BaseParticle it contains. More...
 
ParticleHandler operator= (const ParticleHandler &rhs)
 Assignment operator. More...
 
 ~ParticleHandler ()
 Destructor, it simply destructs the ParticleHandler and all BaseParticle it contains. More...
 
virtual void addObject (BaseParticle *P)
 Adds a BaseParticle to the ParticleHandler. More...
 
BaseParticlegetSmallestParticle () const
 Gets a pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler. More...
 
BaseParticlegetLargestParticle () const
 Gets a pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler. More...
 
BaseParticlegetFastestParticle () const
 Gets a pointer to the fastests BaseParticle in this ParticleHandler. More...
 
BaseParticlegetLowestPositionComponentParticle (const int i) const
 
BaseParticlegetHighestPositionComponentParticle (const int i) const
 
BaseParticlegetLowestVelocityComponentParticle (const int i) const
 
BaseParticlegetHighestVelocityComponentParticle (const int i) const
 
BaseParticlegetLightestParticle () const
 Gets a pointer to the lightest BaseParticle (by mass) in this ParticleHandler. More...
 
void clear ()
 Empties the whole ParticleHandler by removing all BaseParticle. More...
 
void readObject (std::istream &is)
 Reads BaseParticle into the ParticleHandler from restart data. More...
 
void checkExtrema (BaseParticle *P)
 Checks if the extrema of this ParticleHandler needs updating. More...
 
void checkExtremaOnDelete (BaseParticle *P)
 Checks if the extrema of this ParticleHandler needs updating when a particle is deleted. More...
 
CSpeciesgetSpecies (const int i)
 
void setSpecies (std::vector< CSpecies > *)
 
- Public Member Functions inherited from BaseHandler< BaseParticle >
 BaseHandler ()
 Default BaseHandler constructor, it simply creates an empty BaseHandler. More...
 
 BaseHandler (const BaseHandler< BaseParticle > &BH)
 Copy constructor, it copies the BaseHandler and all Object it contains. More...
 
virtual ~BaseHandler ()
 Assignment operator. More...
 
void copyAndAddObject (const BaseParticle &O)
 Creates a copy of a Object and adds it to the BaseHandler. More...
 
void copyAndAddObject (const BaseParticle *O)
 Creates a copy of a Object and adds it to the BaseHandler. More...
 
virtual void removeObject (unsigned const int id)
 Removes a Object from the BaseHandler. More...
 
void removeLastObject ()
 Removes the last Object from the BaseHandler. More...
 
void clear ()
 Empties the whole BaseHandler by removing all Object. More...
 
BaseParticlegetObject (const unsigned int id) const
 Gets a pointer to the Object at the specified index in the BaseHandler. More...
 
BaseParticlegetLastObject () const
 Gets a pointer to the last Object in this BaseHandler. More...
 
unsigned int getNumberOfObjects () const
 Gets the number of Object in this BaseHandler. More...
 
unsigned int getStorageCapacity () const
 Gets the storage capacity of this BaseHandler. More...
 
void setStorageCapacity (const unsigned int N)
 Sets the storage capacity of this BaseHandler. More...
 
const std::vector
< BaseParticle * >
::const_iterator 
begin () const
 Gets the begin of the const_iterator over all Object in this BaseHandler. More...
 
const std::vector
< BaseParticle * >::iterator 
begin ()
 Gets the begin of the iterator over all BaseBoundary in this BaseHandler. More...
 
const std::vector
< BaseParticle * >
::const_iterator 
end () const
 Gets the end of the const_iterator over all BaseBoundary in this BaseHandler. More...
 
const std::vector
< BaseParticle * >::iterator 
end ()
 Gets the end of the iterator over all BaseBoundary in this BaseHandler. More...
 

Private Attributes

BaseParticlelargestParticle_
 A pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler. More...
 
BaseParticlesmallestParticle_
 A pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler. More...
 
std::vector< CSpecies > * species_
 

Detailed Description

Container to store all BaseParticle.

The ParticleHandler is a container to store all BaseParticle. It is implemented by a vector of pointers to BaseParticle.

Definition at line 38 of file ParticleHandler.h.

Constructor & Destructor Documentation

ParticleHandler::ParticleHandler ( )

Default constructor, it simply creates an empty ParticleHandler.

Constructor of the ParticleHandler class. It creates and empty ParticleHandler.

Definition at line 34 of file ParticleHandler.cc.

References largestParticle_, smallestParticle_, and species_.

35 {
36  species_=0;
39  #ifdef CONSTUCTOR_OUTPUT
40  std::cerr << "ParticleHandler() finished" << std::endl;
41  #endif
42 }
std::vector< CSpecies > * species_
BaseParticle * smallestParticle_
A pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler.
BaseParticle * largestParticle_
A pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler.
ParticleHandler::ParticleHandler ( const ParticleHandler PH)

Copy constructor, it copies the ParticleHandler and all BaseParticle it contains.

Parameters
[in]PHThe ParticleHandler that has te be copied.

Definition at line 45 of file ParticleHandler.cc.

References addObject(), BaseHandler< T >::begin(), clear(), BaseHandler< T >::end(), and species_.

46 {
47  species_=PH.species_;
48  clear();
49  for (std::vector<BaseParticle*>::const_iterator it=PH.begin();it!=PH.end();it++)
50  {
51  addObject((*it)->copy());
52  }
53  #ifdef CONSTUCTOR_OUTPUT
54  std::cerr << "ParticleHandler(const ParticleHandler &PH) finished" << std::endl;
55  #endif
56 }
std::vector< CSpecies > * species_
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:220
void clear()
Empties the whole ParticleHandler by removing all BaseParticle.
virtual void addObject(BaseParticle *P)
Adds a BaseParticle to the ParticleHandler.
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition: BaseHandler.h:233
ParticleHandler::~ParticleHandler ( )

Destructor, it simply destructs the ParticleHandler and all BaseParticle it contains.

Definition at line 75 of file ParticleHandler.cc.

76 {
77  #ifdef DESTRUCTOR_OUTPUT
78  std::cout << "WallHandler::~WallHandler() finished" << std::endl;
79  #endif
80 }

Member Function Documentation

void ParticleHandler::addObject ( BaseParticle P)
virtual

Adds a BaseParticle to the ParticleHandler.

Parameters
[in]PA pointer to the BaseParticle (or derived class) that has to be added.
Todo:
Also insert the particle in the HGRID

Reimplemented from BaseHandler< BaseParticle >.

Definition at line 84 of file ParticleHandler.cc.

References BaseHandler< T >::addObject(), checkExtrema(), BaseHandler< BaseParticle >::getLastObject(), and BaseParticle::setHandler().

Referenced by CircularPeriodicBoundary::checkBoundaryAfterParticleMoved(), CircularPeriodicBoundary::createPeriodicParticles(), PeriodicBoundary::createPeriodicParticles(), AngledPeriodicBoundary::createPeriodicParticles(), operator=(), and ParticleHandler().

85 {
86  //Puts the particle in the Particle list
88  //Check if this particle has new extrema
90  //set the particleHandler pointer
91  getLastObject()->setHandler(this);
92 }
virtual void addObject(T *O)
Adds a new Object to the BaseHandler.
Definition: BaseHandler.h:106
void checkExtrema(BaseParticle *P)
Checks if the extrema of this ParticleHandler needs updating.
BaseParticle * getLastObject() const
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:192
void setHandler(ParticleHandler *handler)
void ParticleHandler::checkExtrema ( BaseParticle P)

Checks if the extrema of this ParticleHandler needs updating.

Parameters
[in]PA pointer to the particle, which properties have to be checked against the ParticleHandlers extrema.

Definition at line 266 of file ParticleHandler.cc.

References BaseParticle::get_InteractionRadius(), largestParticle_, and smallestParticle_.

Referenced by addObject(), and BaseParticle::set_Radius().

267 {
269  {
271  }
273  {
275  }
276 }
Mdouble get_InteractionRadius() const
BaseParticle * smallestParticle_
A pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler.
BaseParticle * largestParticle_
A pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler.
void ParticleHandler::checkExtremaOnDelete ( BaseParticle P)

Checks if the extrema of this ParticleHandler needs updating when a particle is deleted.

Parameters
[in]PA pointer to the particle, which is going to get deleted.

Definition at line 279 of file ParticleHandler.cc.

References BaseHandler< BaseParticle >::begin(), BaseHandler< BaseParticle >::end(), largestParticle_, and smallestParticle_.

Referenced by BaseParticle::~BaseParticle().

280 {
281  if(P==largestParticle_)
282  {
284  Mdouble maxRadius = -std::numeric_limits<Mdouble>::max();
285  for (std::vector<BaseParticle*>::const_iterator it=begin();it!=end();it++)
286  {
287  if ((*it)->get_InteractionRadius()>maxRadius&&P!=(*it))
288  {
289  maxRadius = (*it)->get_InteractionRadius();
290  largestParticle_ = (*it);
291  }
292  }
293  }
294  if(P==smallestParticle_)
295  {
297  Mdouble minRadius = std::numeric_limits<Mdouble>::max();
298  for (std::vector<BaseParticle*>::const_iterator it=begin();it!=end();it++)
299  {
300  if ((*it)->get_InteractionRadius()<minRadius&&P!=(*it))
301  {
302  minRadius = (*it)->get_InteractionRadius();
303  smallestParticle_ = (*it);
304  }
305  }
306  }
307 }
const std::vector< BaseParticle * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:220
BaseParticle * smallestParticle_
A pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler.
double Mdouble
Definition: ExtendedMath.h:33
const std::vector< BaseParticle * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition: BaseHandler.h:233
BaseParticle * largestParticle_
A pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler.
void ParticleHandler::clear ( )

Empties the whole ParticleHandler by removing all BaseParticle.

Definition at line 222 of file ParticleHandler.cc.

References BaseHandler< T >::clear(), largestParticle_, and smallestParticle_.

Referenced by operator=(), ParticleHandler(), MD::read(), and MD::read_v2().

223 {
227 }
BaseParticle * smallestParticle_
A pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler.
BaseParticle * largestParticle_
A pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler.
void clear()
Empties the whole BaseHandler by removing all Object.
Definition: BaseHandler.h:162
BaseParticle * ParticleHandler::getFastestParticle ( ) const

Gets a pointer to the fastests BaseParticle in this ParticleHandler.

Returns
A pointer to the to the fastest BaseParticle in this ParticleHandler.

Definition at line 104 of file ParticleHandler.cc.

References BaseHandler< BaseParticle >::begin(), BaseHandler< BaseParticle >::end(), and BaseHandler< BaseParticle >::getNumberOfObjects().

105 {
106  if (!getNumberOfObjects())
107  {
108  std::cerr << "Warning: No particles to set get_FastestParticle()" << std::endl;
109  }
110  BaseParticle* p = 0;
111  Mdouble maxSpeed = -std::numeric_limits<Mdouble>::max();
112  for (std::vector<BaseParticle*>::const_iterator it=begin();it!=end();it++)
113  {
114  if ((*it)->get_Velocity().GetLength()>maxSpeed)
115  {
116  maxSpeed=(*it)->get_Velocity().GetLength();
117  p = (*it);
118  }
119  }
120  return p;
121 }
const std::vector< BaseParticle * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:220
double Mdouble
Definition: ExtendedMath.h:33
const std::vector< BaseParticle * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition: BaseHandler.h:233
unsigned int getNumberOfObjects() const
Gets the number of Object in this BaseHandler.
Definition: BaseHandler.h:199
BaseParticle * ParticleHandler::getHighestPositionComponentParticle ( const int  i) const

Definition at line 140 of file ParticleHandler.cc.

References BaseHandler< BaseParticle >::begin(), BaseHandler< BaseParticle >::end(), and BaseHandler< BaseParticle >::getNumberOfObjects().

141 {
142  if (!getNumberOfObjects())
143  {
144  std::cerr << "Warning: No getHighestPositionComponentParticle(cons int i)" << std::endl;
145  }
146  BaseParticle* p = 0;
147  Mdouble max = -std::numeric_limits<Mdouble>::max();
148  for (std::vector<BaseParticle*>::const_iterator it=begin();it!=end();it++)
149  {
150  if ((*it)->get_Position().getComponent(i)>max) {
151  max=(*it)->get_Position().getComponent(i);
152  p = (*it);
153  }
154  }
155  return p;
156 }
const std::vector< BaseParticle * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:220
double Mdouble
Definition: ExtendedMath.h:33
const std::vector< BaseParticle * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition: BaseHandler.h:233
unsigned int getNumberOfObjects() const
Gets the number of Object in this BaseHandler.
Definition: BaseHandler.h:199
BaseParticle * ParticleHandler::getHighestVelocityComponentParticle ( const int  i) const

Definition at line 174 of file ParticleHandler.cc.

References BaseHandler< BaseParticle >::begin(), BaseHandler< BaseParticle >::end(), and BaseHandler< BaseParticle >::getNumberOfObjects().

175 {
176  if (!getNumberOfObjects())
177  {
178  std::cerr << "Warning: No getHighestVelocityComponentParticle(cons int i)" << std::endl;
179  }
180  BaseParticle* p = 0;
181  Mdouble max = -std::numeric_limits<Mdouble>::max();
182  for (std::vector<BaseParticle*>::const_iterator it=begin();it!=end();it++)
183  {
184  if ((*it)->get_Velocity().getComponent(i)>max) {
185  max=(*it)->get_Velocity().getComponent(i);
186  p = (*it);
187  }
188  }
189  return p;
190 }
const std::vector< BaseParticle * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:220
double Mdouble
Definition: ExtendedMath.h:33
const std::vector< BaseParticle * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition: BaseHandler.h:233
unsigned int getNumberOfObjects() const
Gets the number of Object in this BaseHandler.
Definition: BaseHandler.h:199
BaseParticle * ParticleHandler::getLargestParticle ( ) const

Gets a pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler.

Returns
A pointer to the to the largest BaseParticle (by interactionRadius) in this ParticleHandler.

Definition at line 213 of file ParticleHandler.cc.

References largestParticle_.

Referenced by CircularPeriodicBoundary::createPeriodicParticles(), PeriodicBoundary::createPeriodicParticles(), AngledPeriodicBoundary::createPeriodicParticles(), MD::getLargestParticle(), and HGridOptimiser::Initialise().

213  {
214  if (!largestParticle_)
215  {
216  std::cerr << "Warning: No particles to set get_LargestParticle()" << std::endl;
217  throw;
218  }
219  return largestParticle_;
220 }
BaseParticle * largestParticle_
A pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler.
BaseParticle * ParticleHandler::getLightestParticle ( ) const

Gets a pointer to the lightest BaseParticle (by mass) in this ParticleHandler.

Returns
A pointer to the to the lightest BaseParticle (by mass) in this ParticleHandler.

Definition at line 193 of file ParticleHandler.cc.

References BaseHandler< BaseParticle >::begin(), BaseHandler< BaseParticle >::end(), and BaseHandler< BaseParticle >::getNumberOfObjects().

Referenced by Chute::get_LightestParticleMass().

193  {
194  if (!getNumberOfObjects())
195  {
196  std::cerr << "Warning: No particles to set getLightestParticle()" << std::endl;
197  throw;
198  }
199  BaseParticle* p = 0;
200  Mdouble minMass = std::numeric_limits<Mdouble>::max();
201  for (std::vector<BaseParticle*>::const_iterator it=begin();it!=end();it++)
202  {
203  if ((*it)->get_Mass()<minMass)
204  {
205  minMass=(*it)->get_Mass();
206  p = (*it);
207  }
208  }
209  return p;
210 }
const std::vector< BaseParticle * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:220
double Mdouble
Definition: ExtendedMath.h:33
const std::vector< BaseParticle * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition: BaseHandler.h:233
unsigned int getNumberOfObjects() const
Gets the number of Object in this BaseHandler.
Definition: BaseHandler.h:199
BaseParticle * ParticleHandler::getLowestPositionComponentParticle ( const int  i) const

Definition at line 123 of file ParticleHandler.cc.

References BaseHandler< BaseParticle >::begin(), BaseHandler< BaseParticle >::end(), and BaseHandler< BaseParticle >::getNumberOfObjects().

124 {
125  if (!getNumberOfObjects())
126  {
127  std::cerr << "Warning: No getLowestPositionComponentParticle(cons int i)" << std::endl;
128  }
129  BaseParticle* p = 0;
130  Mdouble min = std::numeric_limits<Mdouble>::max();
131  for (std::vector<BaseParticle*>::const_iterator it=begin();it!=end();it++)
132  {
133  if ((*it)->get_Position().getComponent(i)<min) {
134  min=(*it)->get_Position().getComponent(i);
135  p = (*it);
136  }
137  }
138  return p;
139 }
const std::vector< BaseParticle * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:220
double Mdouble
Definition: ExtendedMath.h:33
const std::vector< BaseParticle * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition: BaseHandler.h:233
unsigned int getNumberOfObjects() const
Gets the number of Object in this BaseHandler.
Definition: BaseHandler.h:199
BaseParticle * ParticleHandler::getLowestVelocityComponentParticle ( const int  i) const

Definition at line 157 of file ParticleHandler.cc.

References BaseHandler< BaseParticle >::begin(), BaseHandler< BaseParticle >::end(), and BaseHandler< BaseParticle >::getNumberOfObjects().

158 {
159  if (!getNumberOfObjects())
160  {
161  std::cerr << "Warning: No getLowestVelocityComponentParticle(cons int i)" << std::endl;
162  }
163  BaseParticle* p = 0;
164  Mdouble min = std::numeric_limits<Mdouble>::max();
165  for (std::vector<BaseParticle*>::const_iterator it=begin();it!=end();it++)
166  {
167  if ((*it)->get_Velocity().getComponent(i)<min) {
168  min=(*it)->get_Velocity().getComponent(i);
169  p = (*it);
170  }
171  }
172  return p;
173 }
const std::vector< BaseParticle * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:220
double Mdouble
Definition: ExtendedMath.h:33
const std::vector< BaseParticle * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition: BaseHandler.h:233
unsigned int getNumberOfObjects() const
Gets the number of Object in this BaseHandler.
Definition: BaseHandler.h:199
BaseParticle * ParticleHandler::getSmallestParticle ( ) const

Gets a pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler.

Returns
A pointer to the to the smallest BaseParticle (by interactionRadius) in this ParticleHandler.

Definition at line 95 of file ParticleHandler.cc.

References smallestParticle_.

Referenced by MD::getSmallestParticle(), and HGridOptimiser::Initialise().

95  {
96  if (!smallestParticle_)
97  {
98  std::cerr << "Warning: No particles to set get_SmallestParticle()" << std::endl;
99  }
100  return smallestParticle_;
101 }
BaseParticle * smallestParticle_
A pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler.
CSpecies & ParticleHandler::getSpecies ( const int  i)

Definition at line 309 of file ParticleHandler.cc.

References species_.

Referenced by BaseParticle::get_InteractionRadius(), and BaseParticle::get_WallInteractionRadius().

309  {
310  if (!species_) std::cerr << "B" << species_ << std::endl;
311  return (*species_)[i]; }
std::vector< CSpecies > * species_
ParticleHandler ParticleHandler::operator= ( const ParticleHandler rhs)

Assignment operator.

Parameters
[in]rhsThe ParticleHandler on the right hand side of the assignment.

Definition at line 59 of file ParticleHandler.cc.

References addObject(), BaseHandler< T >::begin(), clear(), and BaseHandler< T >::end().

60 {
61  if (this != &rhs)
62  {
63  clear();
64  for (std::vector<BaseParticle*>::const_iterator it=rhs.begin();it!=rhs.end();it++)
65  {
66  addObject((*it)->copy());
67  }
68  }
69  #ifdef CONSTUCTOR_OUTPUT
70  std::cerr << "ParticleHandler operator = (const ParticleHandler& rhs) finished" << std::endl;
71  #endif
72  return *this;
73 }
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:220
void clear()
Empties the whole ParticleHandler by removing all BaseParticle.
virtual void addObject(BaseParticle *P)
Adds a BaseParticle to the ParticleHandler.
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition: BaseHandler.h:233
void ParticleHandler::readObject ( std::istream &  is)
virtual

Reads BaseParticle into the ParticleHandler from restart data.

Parameters
[in]isThe input stream from which the information is read.

Implements BaseHandler< BaseParticle >.

Definition at line 230 of file ParticleHandler.cc.

References BaseHandler< BaseParticle >::copyAndAddObject(), and TangentialSpringParticle::oldRead().

Referenced by MD::read(), MD::read_v1(), and MD::read_v2().

231 {
232  std::string type;
233  is >> type;
234  if(type.compare("BP")==0)
235  {
236  BaseParticle baseParticle;
237  is>>baseParticle;
238  copyAndAddObject(baseParticle);
239  }
240  else if(type.compare("TSP")==0)
241  {
242  TangentialSpringParticle tangentialSpringParticle;
243  is>>tangentialSpringParticle;
244  copyAndAddObject(tangentialSpringParticle);
245  }
246  else if(type.compare("DMP")==0)
247  {
248  DeltaMaxsParticle deltaMaxsParticle;
249  is>>deltaMaxsParticle;
250  copyAndAddObject(deltaMaxsParticle);
251  }
252  else if(isdigit(type[0]))
253  {
254  TangentialSpringParticle tangentialSpringParticle;
255  tangentialSpringParticle.oldRead(is,type);
256  copyAndAddObject(tangentialSpringParticle);
257  }
258  else
259  {
260  std::cerr<<"Particle type: "<<type<<" not understood in restart file"<<std::endl;
261  exit(-1);
262  }
263 }
void copyAndAddObject(const BaseParticle &O)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:93
void oldRead(std::istream &is, std::string &x)
void ParticleHandler::setSpecies ( std::vector< CSpecies > *  species)

Definition at line 312 of file ParticleHandler.cc.

References species_.

Referenced by MD::constructor().

312 {species_ = species;}
std::vector< CSpecies > * species_

Member Data Documentation

BaseParticle* ParticleHandler::largestParticle_
private

A pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler.

Definition at line 91 of file ParticleHandler.h.

Referenced by checkExtrema(), checkExtremaOnDelete(), clear(), getLargestParticle(), and ParticleHandler().

BaseParticle* ParticleHandler::smallestParticle_
private

A pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler.

Definition at line 94 of file ParticleHandler.h.

Referenced by checkExtrema(), checkExtremaOnDelete(), clear(), getSmallestParticle(), and ParticleHandler().

std::vector<CSpecies>* ParticleHandler::species_
private

Definition at line 97 of file ParticleHandler.h.

Referenced by getSpecies(), ParticleHandler(), and setSpecies().


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