MercuryDPM  Beta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BaseParticle.cc
Go to the documentation of this file.
1 //Copyright (c) 2013-2014, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
27 #include "InteractionHandler.h"
28 #include "Particles/BaseParticle.h"
31 #include "ParticleHandler.h"
32 #include "DPMBase.h"
33 
39 {
40  handler_ = nullptr;
42  radius_ = 1.0;
43  mass_ = invMass_ = 1.0;
44  inertia_ = invInertia_ = 1.0;
45  HGridNextObject_ = nullptr;
46 
47  periodicFromParticle_ = nullptr;
48 #ifdef CONTACT_LIST_HGRID
49  firstPossibleContact = nullptr;
50 #endif
51  HGridNextObject_ = nullptr;
52  HGridPrevObject_ = nullptr;
53  HGridLevel_ = 99999;
54  HGridX_ = 99999;
55  HGridY_ = 99999;
56  HGridZ_ = 99999;
57 
58  logger(DEBUG, "BaseParticle::BaseParticle() finished");
59 }
60 
70  : BaseInteractable(p)
71 {
72  handler_ = nullptr;
74  radius_ = p.radius_;
75  mass_ = p.getMass();
76  invMass_ = p.getInvMass();
77  inertia_ = p.getInertia();
79 
80  HGridNextObject_ = nullptr;
81  HGridPrevObject_ = nullptr;
82  HGridX_ = 99999;
83  HGridY_ = 99999;
84  HGridZ_ = 99999;
86 
88 #ifdef CONTACT_LIST_HGRID
89  firstPossibleContact = nullptr;
90 #endif
91  logger(DEBUG, "BaseParticle::BaseParticle(BaseParticle &p) finished");
92 }
93 
99 {
100  if (getHandler() != nullptr)
101  {
103  }
104  logger(DEBUG, "BaseParticle::~BaseParticle() of particle % finished.", getId());
105 }
106 
113 {
114  return new BaseParticle(*this);
115 }
116 
123 {
124  if (handler_ == nullptr)
125  {
126  logger(ERROR,"[BaseParticle::getVolume] no particle handler specified");
127  return 0;
128  }
129  switch (getParticleDimensions())
130  {
131  case 3:
132  return (4.0 / 3.0 * constants::pi * radius_ * radius_ * radius_);
133  case 2:
134  return (constants::pi * radius_ * radius_);
135  case 1:
136  return (2.0 * radius_);
137  default:
138  logger(ERROR, "[BaseParticle::getVolume] dimension of the particle is not set");
139  return 0;
140  }
141 }
142 
147 {
148  mass_ = 1e20;
149  invMass_ = 0.0;
150  inertia_ = 1e20;
151  invInertia_ = 0.0;
152  setVelocity(Vec3D(0.0,0.0,0.0));
153  setAngularVelocity(Vec3D(0.0,0.0,0.0));
154 }
155 
161 {
162  return (invMass_ == 0.0);
163 }
164 
171 {
172  invMass_ = 1.0;
173  getSpecies()->computeMass(this);
174 }
175 
182 void BaseParticle::write(std::ostream& os) const
183 {
185  os << " radius " << radius_
186  << " invMass " << invMass_
187  << " invInertia " << invInertia_;
188 }
189 
194 std::string BaseParticle::getName() const
195 {
196  return "BaseParticle";
197 }
198 
207 void BaseParticle::read(std::istream& is)
208 {
210  std::string dummy;
211  is >> dummy >> radius_ >> dummy >> invMass_ >> dummy >> invInertia_;
212  if (invMass_ != 0.0)
213  mass_ = 1.0 / invMass_;
214  else
215  mass_ = 1e20;
216  if (invInertia_ != 0.0)
217  inertia_ = 1.0 / invInertia_;
218  else
219  inertia_ = 1e20;
220 }
221 
227 void BaseParticle::oldRead(std::istream& is)
228 {
230 
231  unsigned int indSpecies;
232  Vec3D orientation;
233  Vec3D position;
234  is >> invMass_ >> invInertia_ >> indSpecies;
235  setPosition(position);
236  setOrientation(orientation);
237  setIndSpecies(indSpecies);
238  if (invMass_ != 0.0)
239  mass_ = 1.0 / invMass_;
240  else
241  mass_ = 1e20;
242  if (invInertia_ != 0.0)
243  inertia_ = 1.0 / invInertia_;
244  else
245  inertia_ = 1e20;
246 }
247 
253 void BaseParticle::printHGrid(std::ostream& os) const
254  {
255  os << "Particle( HGRID_Level:" << HGridLevel_
256  << ", HGRID_x:" << HGridX_
257  << ", HGRID_y:" << HGridY_
258  << ", HGRID_z:" << HGridZ_
259  << ")";
260 }
261 
266 unsigned int BaseParticle::getHGridLevel() const
267 {
268  return HGridLevel_;
269 }
270 
276 {
277  return HGridNextObject_;
278 }
279 
286 {
287  return HGridPrevObject_;
288 }
289 
290 #ifdef CONTACT_LIST_HGRID
291 
294 PossibleContact* BaseParticle::getFirstPossibleContact() const
295 {
296  return firstPossibleContact;
297 }
298 #endif
299 
305 {
306  return HGridX_;
307 }
308 
314 {
315  return HGridY_;
316 }
317 
323 {
324  return HGridZ_;
325 }
326 
332 {
333  return inertia_;
334 }
335 
341 {
342  return invInertia_;
343 }
344 
350 {
351  return invMass_;
352 }
353 
359 {
360  return 0.5 * mass_ * getVelocity().getLengthSquared();
361 }
362 
368 {
369  return mass_;
370 }
371 
378 {
379  return periodicFromParticle_;
380 }
381 
387 {
388  return radius_;
389 }
390 
401 {
402  return radius_ + getSpecies()->getInteractionDistance() * 0.5;
403 }
404 
411 {
413 }
414 
421 {
422  return displacement_;
423 }
424 
430 {
431  return previousPosition_;
432 }
433 
438 const Vec3D BaseParticle::getDisplacement2(Mdouble xmin, Mdouble xmax, Mdouble ymin, Mdouble ymax, Mdouble zmin, Mdouble zmax, Mdouble t) const
439 {
441  if (xmax > xmin && fabs(disp.X) > .5 * (xmax - xmin))
442  {
443  if (disp.X > 0)
444  disp.X -= xmax - xmin;
445  else
446  disp.X += xmax - xmin;
447  }
448  if (ymax > ymin && fabs(disp.Y) > .5 * (ymax - ymin))
449  {
450  if (disp.Y > 0)
451  disp.Y -= ymax - ymin;
452  else
453  disp.Y += ymax - ymin;
454  }
455  if (zmax > zmin && fabs(disp.Z) > .5 * (zmax - zmin))
456  {
457  if (disp.Z > 0)
458  disp.Z -= zmax - zmin;
459  else
460  disp.Z += zmax - zmin;
461  }
462  disp /= t;
463  return disp;
464 }
465 
470 void BaseParticle::setInertia(const Mdouble newInertia)
471 {
472  if (newInertia >= 0)
473  {
474  inertia_ = newInertia;
475  invInertia_ = 1.0 / newInertia;
476  }
477  else
478  {
479  logger(ERROR, "Error in set_inertia (%)", newInertia);
480  }
481 }
482 
488 {
489  inertia_ = 1e20;
490  invInertia_ = 0;
491 } //> i.e. no rotations
492 
500 {
502 }
503 
508 void BaseParticle::setHGridX(const int x)
509 {
510  HGridX_ = x;
511 }
512 
517 void BaseParticle::setHGridY(const int y)
518 {
519  HGridY_ = y;
520 }
521 
526 void BaseParticle::setHGridZ(const int z)
527 {
528  HGridZ_ = z;
529 }
530 
535 void BaseParticle::setHGridLevel(const unsigned int level)
536 {
537  HGridLevel_ = level;
538 }
539 
545 {
546  HGridNextObject_ = p;
547 }
548 
554 {
555  HGridPrevObject_ = p;
556 }
557 
561 #ifdef CONTACT_LIST_HGRID
562 void BaseParticle::setFirstPossibleContact (PossibleContact* PC)
563 {
564  firstPossibleContact=PC;
565 }
566 #endif
567 
575 {
576  radius_ = radius;
577  if (getHandler())
578  {
579  getSpecies()->computeMass(this);
580  getHandler()->checkExtrema(this);
581  }
582 }
588 {
589  logger(WARN, "WARNING: Do not use particle->setMass, instead use "
590  "particleSpecies->computeMass, since this function can cause "
591  "inconsistencies between the mass, density and radius of this particle!");
592  if(mass >= 0.0)
593  {
594  if(invMass_ != 0.0) //InvMass=0 is a flag for a fixed particle
595  {
596  mass_ = mass;
597  invMass_ = 1.0 / mass;
598  }
599  }
600  else
601  {
602  logger(ERROR, "Error in BaseParticle::setMass, the given mass to be set must be positive.");
603  }
604 }
605 
611 {
612  displacement_ = disp;
613 }
614 
620 {
621  previousPosition_ = pos;
622 }
623 
629 void BaseParticle::movePrevious(const Vec3D& posMove)
630 {
631  previousPosition_ += posMove;
632 }
633 
640 {
641  addVelocity(vel);
642 }
643 
650 {
651  addAngularVelocity(angVel);
652 }
653 
659 {
660  displacement_ += addDisp;
661 }
662 
669 {
670  handler_ = handler;
671  setSpecies(getHandler()->getDPMBase()->speciesHandler.getObject(getIndSpecies()));
672 }
673 
679 {
680  return handler_;
681 }
682 
695 {
696  //get the normal (from P away from the contact)
697  Vec3D branchVector = P->getPosition() - getPosition();
698  //Get the square of the distance between particle i and particle j
699  Mdouble distanceSquared = Vec3D::getLengthSquared(branchVector);
700  Mdouble sumOfInteractionRadii = P->getInteractionRadius() + getInteractionRadius();
701  if (distanceSquared < (sumOfInteractionRadii * sumOfInteractionRadii))
702  {
703  BaseInteraction* C = interactionHandler->getInteraction(P, this, timeStamp);
704  Mdouble distance = std::sqrt(distanceSquared);
705  C->setNormal(branchVector / distance);
706  C->setOverlap(P->getRadius() + getRadius() - distance);
707  C->setDistance(distance);
712  C->setContactPoint(P->getPosition() - (P->getRadius() - 0.5 * C->getOverlap()) * C->getNormal());
713  return C;
714  }
715  else
716  {
717  return nullptr;
718  }
719 }
720 
727 void BaseParticle::integrateBeforeForceComputation(double time, double timeStep)
728 {
733  if (getInvMass() == 0.0)
734  {
736  }
737  else
738  {
739  accelerate(getForce() * getInvMass() * 0.5 * timeStep);
740  setDisplacement(getVelocity() * timeStep);
742  getHandler()->getDPMBase()->hGridUpdateMove(this, getDisplacement().getLength());
743  if (getHandler()->getDPMBase()->getRotation())
744  {
745  angularAccelerate(getTorque() * getInvInertia() * 0.5 * timeStep);
746  rotate(getAngularVelocity() * timeStep);
747  }
748  }
749 }
750 
757 void BaseParticle::integrateAfterForceComputation(double time, double timeStep)
758 {
759  if (getInvMass() == 0.0)
760  {
762  }
763  else
764  {
765  accelerate(getForce() * getInvMass() * 0.5 * timeStep);
766  if (getHandler()->getDPMBase()->getRotation())
767  {
768  angularAccelerate(getTorque() * getInvInertia() * 0.5 * timeStep);
769  }
770  }
771 }
772 
778 {
780 }
781 
787 void BaseParticle::setIndSpecies(unsigned int indSpecies)
788 {
789  if (handler_ != nullptr)
790  {
793  }
794  else
795  {
797  logger(WARN, "setIndSpecies called on a particle with no particle handler.\n"
798  "Therefore I can't request the given species from the species handler.\n"
799  " PartID = %", getId());
800  }
801 }
802 
811 {
813 
814  //set pointer to the ParticleHandler handler_, which is needed to retrieve
815  //species information
816  if (handler_ == nullptr)
817  {
818  SpeciesHandler* sH = species->getHandler();
819  if (sH != nullptr)
820  {
821  DPMBase* dB = sH->getDPMBase();
822  if (dB != nullptr)
823  {
825  }
826  }
827  }
828 }
Mdouble getKineticEnergy() const
Calculates the particle's kinetic energy.
Container to store all ParticleSpecies.
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
Definition: Vector.cc:304
virtual Mdouble getInteractionDistance() const =0
returns the largest separation distance at which adhesive short-range forces can occur.
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.cc:113
void rotate(const Vec3D &rotate)
Rotates this BaseInteractable.
void addDisplacement(const Vec3D &addDisp)
Adds a vector to the particle's displacement_.
void checkExtremaOnDelete(BaseParticle *P)
Checks if the extrema of this ParticleHandler needs updating when a particle is deleted.
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
Definition: DPMBase.h:61
void setNormal(Vec3D normal)
Sets the normal vector between the two interacting objects.
Mdouble X
the vector components
Definition: Vector.h:52
void addVelocity(const Vec3D &velocity)
adds an increment to the velocity.
Mdouble invInertia_
Particle inertia_.
Definition: BaseParticle.h:397
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Mdouble getVolume() const
Get Particle volume function, which required a reference to the Species vector. It returns the volume...
void setInfiniteInertia()
Sets the particle's inertia_ to 'infinite' (1e20) and its invInertia_ to 0.
void setHGridLevel(const unsigned int level)
Sets the particle's HGrid level.
void setInertia(const Mdouble newInertia)
Sets the particle's inertia_ (and adjusts invInertia_ accordingly)
const Vec3D & getForce() const
Returns the force on this BaseInteractable.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void setOverlap(Mdouble overlap)
Set the overlap between the two interacting object.
void setDisplacement(const Vec3D &disp)
Sets the particle's displacement (= difference between current position and that of the previous time...
const Vec3D & getPreviousPosition() const
Returns the particle's position in the previous time step.
void checkExtrema(BaseParticle *P)
Checks if the extrema of this ParticleHandler needs updating.
void setMass(const Mdouble mass)
Sets the particle's mass.
void setOrientation(const Vec3D &orientation)
Sets the orientation of this BaseInteractable.
const ParticleSpecies * getSpecies() const
Returns a pointer to the species of this BaseInteractable.
unsigned int getParticleDimensions() const
Returns the particle dimensions.
Definition: DPMBase.cc:492
BaseInteraction * getInteraction(BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp)
Returns the Interaction between the BaseInteractable's P and I.
void setHandler(ParticleHandler *handler)
Sets the pointer to the particle's ParticleHandler.
double Mdouble
void setHGridY(const int y)
Sets the particle's HGrid cell Y-coordinate.
Mdouble mass_
Pointer to the previous Particle in the same HGrid cell.
Definition: BaseParticle.h:394
ParticleHandler * handler_
Pointer to the particle's ParticleHandler container.
Definition: BaseParticle.h:378
Mdouble invMass_
Particle mass_.
Definition: BaseParticle.h:395
void integrateBeforeForceComputation(double time, double timeStep)
This is part of integrate routine for objects with infinite mass.
void setZero()
Sets all elements to zero.
Definition: Vector.cc:52
void setContactPoint(Vec3D contactPoint)
Set the location of the contact point between the two interacting objects.
void setHGridNextObject(BaseParticle *p)
Sets the pointer to the next object in the particle's HGrid cell & level.
void setPeriodicFromParticle(BaseParticle *p)
Assigns the pointer to the 'original' particle this one's a periodic copy of.
virtual void computeMass(BaseParticle *p) const
Compute Particle mass function, which required a reference to the Species vector. It computes the Par...
void unfix()
Unfix Particle function, which required a reference to the Species vector. It unfixes a Particle by c...
virtual const Vec3D & getAngularVelocity() const
Returns the angular velocity of this interactable.
void setSpecies(const ParticleSpecies *species)
int getHGridY() const
Returns particle's HGrid cell Y-coordinate.
void setHGridX(const int x)
Sets the particle's HGrid cell X-coordinate.
ParticleHandler * getHandler() const
Returns pointer to the particle's ParticleHandler.
Mdouble getInvMass() const
Returns the particle's invMass_.
void accelerate(const Vec3D &vel)
Increases the particle's velocity_ by the given vector.
void setDistance(Mdouble distance)
Sets the interaction distance between the two interacting objects.
void setRadius(const Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Mdouble getLengthSquared() const
Calculates the squared length of this Vec3D: .
Definition: Vector.cc:313
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Stores information about interactions between two interactable objects; often particles but could be ...
Mdouble getWallInteractionRadius() const
Returns the interaction radius for interaction with walls. See also BaseParticle::getInteractionRadiu...
void addAngularVelocity(const Vec3D &angularVelocity)
add an increment to the angular velocity.
int HGridX_
Hgrid attributes.
Definition: BaseParticle.h:388
virtual std::string getName() const
Returns the name of the object.
SpeciesHandler * getHandler() const
Returns the pointer to the handler to which this species belongs.
Definition: BaseSpecies.cc:74
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
void setSpecies(const ParticleSpecies *species)
Sets the species of this BaseInteractable.
BaseParticle * HGridNextObject_
Grid level for the object.
Definition: BaseParticle.h:390
void printHGrid(std::ostream &os) const
Adds particle's HGrid level and cell coordinates to an ostream.
const Vec3D & getDisplacement() const
Returns the particle's displacement relative to the previous time step.
void integrateBeforeForceComputation(double time, double timeStep)
First step of Velocity Verlet integration.
Mdouble inertia_
Inverse Particle mass (for computation optimization)
Definition: BaseParticle.h:396
virtual void read(std::istream &is)=0
Reads a BaseInteractable from an input stream.
Vec3D displacement_
Pointer to originating Particle.
Definition: BaseParticle.h:401
virtual void read(std::istream &is)
Particle read function, which accepts an std::istream as input.
Mdouble getMass() const
Returns the particle's mass_.
virtual ~BaseParticle()
Particle destructor, needs to be implemented and checked if it removes tangential spring information...
Definition: BaseParticle.cc:98
const Mdouble pi
Definition: ExtendedMath.h:42
void setPreviousPosition(const Vec3D &pos)
Sets the particle's position in the previous time step.
unsigned int HGridLevel_
Cell position in the grid.
Definition: BaseParticle.h:389
int getHGridZ() const
Returns particle's HGrid cell Z-coordinate.
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:878
Container to store Interaction objects.
const Vec3D & getNormal() const
Gets the normal vector between the two interacting objects.
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:415
void setHGridZ(const int z)
Sets the particle's HGrid cell Z-coordinate.
const Vec3D & getTorque() const
Returns the torque on this BaseInteractable.
Vec3D previousPosition_
Displacement (only used in StatisticsVector, StatisticsPoint)
Definition: BaseParticle.h:402
BaseParticle * HGridPrevObject_
Pointer to the next Particle in the same HGrid cell.
Definition: BaseParticle.h:391
Mdouble getInertia() const
Returns the particle's inertia_.
MERCURY_DEPRECATED void setIndSpecies(unsigned int indSpecies)
Mdouble getRadius() const
Returns the particle's radius_.
Mdouble getOverlap() const
Returns a Mdouble with the current overlap between the two interacting objects.
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
Definition: DPMBase.h:868
const Vec3D getDisplacement2(Mdouble xmin, Mdouble xmax, Mdouble ymin, Mdouble ymax, Mdouble zmin, Mdouble zmax, Mdouble t) const
virtual void setIndSpecies(unsigned int indSpecies)
Sets the index of the Species of this BaseInteractable.
BaseInteraction * getInteractionWith(BaseParticle *P, Mdouble timeStamp, InteractionHandler *interactionHandler)
Checks if particle is in interaction with given particle P, and if so, returns pointer to the associa...
Container to store all BaseParticle.
Mdouble Y
Definition: Vector.h:52
virtual void write(std::ostream &os) const
Particle print function, which accepts an std::ostream as input.
Mdouble getInvInertia() const
Returns the particle's invInertia_.
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
BaseParticle()
Basic Particle constructor, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1...
Definition: BaseParticle.cc:38
virtual MERCURY_DEPRECATED void oldRead(std::istream &is)
deprecated version of the read function.
Mdouble radius_
Inverse Particle inverse inertia (for computation optimization)
Definition: BaseParticle.h:398
void setHGridPrevObject(BaseParticle *p)
Sets the pointer to the previous object in the particle's HGrid cell & level.
Defines the basic properties that a interactable object can have.
void angularAccelerate(const Vec3D &angVel)
Increases the particle's angularVelocity_ by the given vector.
BaseParticle * getHGridPrevObject() const
Returns pointer to previous object in particle's HGrid level & cell.
virtual void hGridUpdateMove(BaseParticle *, Mdouble)
no implementation but can be overidden in its derived classes.
Definition: DPMBase.cc:717
Class that describes a possible contact between two BaseParticle.
void integrateAfterForceComputation(double time, double timeStep)
Second step of Velocity Verlet integration.
unsigned int getIndSpecies() const
Returns the index of the Species of this BaseInteractable.
virtual void write(std::ostream &os) const =0
Write a BaseInteractable to an output stream.
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
BaseParticle * getHGridNextObject() const
Returns pointer to next object in particle's HGrid level & cell.
virtual void move(const Vec3D &move)
Moves this BaseInteractable by adding an amount to the position.
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
Definition: BaseHandler.h:512
BaseParticle * periodicFromParticle_
Particle radius_.
Definition: BaseParticle.h:399
unsigned int getHGridLevel() const
Returns particle's HGrid level.
unsigned int getParticleDimensions() const
Returns the particle's dimensions (either 2 or 3).
bool isFixed() const
Is fixed Particle function. It returns whether a Particle is fixed or not, by checking its inverse Ma...
Mdouble Z
Definition: Vector.h:52
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
Mdouble getInteractionRadius() const
Returns the particle's interaction radius, which might be different from radius_ (e.g., when dealing with wet particles)
void integrateAfterForceComputation(double time, double timeStep)
This is part of the integration routine for objects with infinite mass.
virtual BaseParticle * copy() const
Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism.
void movePrevious(const Vec3D &posMove)
Adds a vector to the particle's previousPosition_.
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...
int getHGridX() const
Returns particle's HGrid cell X-coordinate.