revision: v0.14
BaseParticle.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2020, 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 
26 #ifndef BASEPARTICLE_H
27 #define BASEPARTICLE_H
28 
29 #include <vector>
30 #include "Math/Vector.h"
31 #include "BaseInteractable.h"
32 #include "HGridCell.h"
34 
35 class ParticleHandler;
36 
37 class SpeciesHandler;
38 
39 class HGrid;
40 
41 class BaseInteraction;
42 
43 #ifdef CONTACT_LIST_HGRID
44 class PossibleContact;
45 #endif
46 
54 {
55 public:
59  BaseParticle();
60 
64  BaseParticle(const BaseParticle& p);
65 
66  explicit BaseParticle(const ParticleSpecies* s);
67 
71  ~BaseParticle() override;
72 
76  virtual BaseParticle* copy() const = 0;
77 
81  virtual Mdouble getVolume() const;
82 
86  void fixParticle();
87 
93  bool isFixed() const override
94  { return (invMass_ == 0.0); }
95 
99  bool isMPIParticle() const;
100 
104  void setMPIParticle(bool flag);
105 
109  bool isInMPIDomain();
110 
114  void setInMPIDomain(bool flag);
115 
119  bool isInPeriodicDomain() const;
120 
124  void setInPeriodicDomain(bool flag);
125 
129  bool isPeriodicGhostParticle() const;
130 
134  void setPeriodicGhostParticle(bool flag);
135 
139  bool isMaserParticle() const;
140 
144  void setMaserParticle(bool flag);
145 
149  void setCommunicationComplexity(unsigned complexity);
150 
154  unsigned getCommunicationComplexity();
155 
159  void setPeriodicComplexity(std::vector<int> complexity);
160 
164  void setPeriodicComplexity(int index, int value);
165 
169  const std::vector<int>& getPeriodicComplexity();
170 
174  void setPreviousPeriodicComplexity(std::vector<int> complexity);
175 
179  const std::vector<int>& getPreviousPeriodicComplexity() const;
180 
184  int getPeriodicComplexity(int index);
185 
186  //void setCurrentPeriodicPosition(Vec3D position);
187 
188  //Vec3D getCurrentPeriodicPosition();
189 
193  void unfix();
194 
198  void read(std::istream& is) override;
199 
204  virtual void oldRead(std::istream& is);
205 
209  void write(std::ostream& os) const override;
210 
214  std::string getName() const override;
215 
219  virtual void setInfo(Mdouble info);
220 
224  virtual Mdouble getInfo() const;
225 
229  void printHGrid(std::ostream& os) const;
230 
234  unsigned int getHGridLevel() const
235  { return hGridCell.getHGridLevel(); }
236 
243  { return hGridNextObject_; }
244 
251  { return hGridPrevObject_; }
252 
253 #ifdef CONTACT_LIST_HGRID
254 
258  PossibleContact* getFirstPossibleContact() const;
259 #endif
260 
265  int getHGridX() const
266  { return hGridCell.getHGridX(); }
267 
272  int getHGridY() const
273  { return hGridCell.getHGridY(); }
274 
279  int getHGridZ() const
280  { return hGridCell.getHGridZ(); }
281 
287  { return invInertia_; }
288 
293  Mdouble getInvMass() const override
294  { return invMass_; }
295 
296  Mdouble getCurvature(const Vec3D& labFixedCoordinates) const override
297  { return 1.0/radius_; }
298 
303  Mdouble getKineticEnergy() const;
304 
310 
317 
322  Mdouble getMass() const
323  { return 1.0 / invMass_; }
324 
326  { return 4.0*constants::pi*getRadius()*getRadius(); }
327 
329  { return getVelocity() / invMass_; }
330 
332  { return invInertia_.inverse(); }
333 
334  Vec3D getAngularMomentum() const;
335 
342  { return periodicFromParticle_; }
343 
349  { return radius_; }
350 
363  return getRadius() + getSpecies()->getMaxInteractionDistance() * 0.5;
364  }
365 
370  {
371  //const auto mixedSpecies = getSpecies()->getHandler()->getMixedObject(getSpecies(),particle->getSpecies());
372  //return mixedSpecies->getInteractionDistance();
373  return getSpecies()->getMixedSpecies(i->getSpecies())->getInteractionDistance();
374  }
375 
380  return getRadius() + particle->getRadius() + getInteractionDistance((const BaseInteractable*)particle);
381  }
382 
387  return getRadius() + getInteractionDistance((const BaseInteractable*)wall);
388  }
389 
395  const Vec3D& getDisplacement() const
396  { return displacement_; }
397 
403  const Vec3D& getPreviousPosition() const
404  { return previousPosition_; }
405 
411  const Vec3D getDisplacement2(Mdouble xmin, Mdouble xmax, Mdouble ymin, Mdouble ymax, Mdouble zmin, Mdouble zmax,
412  Mdouble t) const;
413 
417  virtual void setInertia();
418 
422  void setInertia(MatrixSymmetric3D inertia);
423 
427  void setInverseInertia(MatrixSymmetric3D inverseInertia);
428 
433  void setInfiniteInertia();
434 
442  { periodicFromParticle_ = p; };
443 
449  void setHGridX(const int x)
450  { hGridCell.setHGridX(x); }
451 
457  void setHGridY(const int y)
458  { hGridCell.setHGridY(y); }
459 
465  void setHGridZ(const int z)
466  { hGridCell.setHGridZ(z); }
467 
472  void setHGridLevel(const unsigned int level)
473  { hGridCell.setHGridLevel(level); }
474 
481  { hGridNextObject_ = p; }
482 
489  { hGridPrevObject_ = p; }
490 
491 #ifdef CONTACT_LIST_HGRID
492 
495  void setFirstPossibleContact(PossibleContact* PC);
496 #endif
497 
502  virtual void setRadius(Mdouble radius);
503 
504  /*
505  * The below 6 functions had to be declared virtual here in order to allow access of these functions in ParticleHandler class in the function writeVTK.
506  */
507 
511  virtual Vec3D getAxes() const;
512 
516  virtual Mdouble getExponentEps1() const;
517 
521  virtual Mdouble getExponentEps2() const;
522 
523 
527  virtual void setAxes(const Vec3D& axes){ }
528 
532  virtual void setExponents(const Mdouble& eps1, const Mdouble& eps2){}
533 
534  //
541  void setMass(Mdouble mass);
542 
548  void setMassForP3Statistics(Mdouble mass);
549 
554  void setDisplacement(const Vec3D& disp);
555 
559  void setPreviousPosition(const Vec3D& pos);
560 
564  void movePrevious(const Vec3D& posMove);
565 
569  void accelerate(const Vec3D& vel);
570 
574  void angularAccelerate(const Vec3D& angVel);
575 
579  void addDisplacement(const Vec3D& addDisp);
580 
584  void setHandler(ParticleHandler* handler);
585 
589  ParticleHandler* getHandler() const;
590 
595  BaseInteraction* getInteractionWith(BaseParticle* P, unsigned timeStamp, InteractionHandler* interactionHandler) override;
596 
600  virtual bool isInContactWith(const BaseParticle* P) const;
601 
607  void integrateBeforeForceComputation(double time, double timeStep);
608 
613  void integrateAfterForceComputation(double time, double timeStep);
614 
618  unsigned int getParticleDimensions() const;
619 
625  void setIndSpecies(unsigned int indSpecies) override;
626 
631  void setSpecies(const ParticleSpecies* species);
633 
634  virtual unsigned getNumberOfFieldsVTK() const;
635 
636  virtual std::string getTypeVTK(unsigned i) const;
637 
638  virtual std::string getNameVTK(unsigned i) const;
639 
640  virtual std::vector<Mdouble> getFieldVTK(unsigned i) const;
641 
642  virtual void actionsAfterTimeStep()
643  {};
644 
645  virtual bool isSphericalParticle() const {return false;}
646 
647  //const HGridCell& getHGridCell() const;
648  const HGridCell& getHGridCell() const
649  { return hGridCell; }
650 
651  virtual void computeMass(const ParticleSpecies& s);
652 
653 protected:
654 
658 
659 
660 private:
661 
666 
667 #ifdef CONTACT_LIST_HGRID
668 
671  PossibleContact* firstPossibleContact;
672 #endif
673 
677 
680 
683 
684  //MPI particle attributes
687  unsigned communicationComplexity_; //Determins if the particle in the corner of a domain, rib, side or not at all
688 
689  //Periodic boundary particle attributes
692  std::vector<int> previousPeriodicComplexity_;
693  std::vector<int> periodicComplexity_;
695 
698 
704 
705  Mdouble info_; // by default, the species ID (if a species is set)
706 };
707 
708 #endif
MatrixSymmetric3D::inverse
MatrixSymmetric3D inverse() const
Computes the inverse of a matrix; exits if the inverse doesn't exist.
Definition: MatrixSymmetric.cc:298
BaseParticle::getInteractionWith
BaseInteraction * getInteractionWith(BaseParticle *P, unsigned timeStamp, InteractionHandler *interactionHandler) override
Checks if particle is in interaction with given particle P, and if so, returns vector of pointer to t...
Definition: BaseParticle.cc:678
BaseParticle::setHGridY
void setHGridY(const int y)
Sets the particle's HGrid cell Y-coordinate.
Definition: BaseParticle.h:457
BaseParticle::handler_
ParticleHandler * handler_
Inverse Particle inverse inertia (for computation optimization)
Definition: BaseParticle.h:665
BaseParticle::getPreviousPeriodicComplexity
const std::vector< int > & getPreviousPeriodicComplexity() const
Sets the previous periodic communication complexity of the particle.
Definition: BaseParticle.cc:265
BaseParticle::isPeriodicGhostParticle_
bool isPeriodicGhostParticle_
bool that indicates if a particle is in the periodic domain of any boundary
Definition: BaseParticle.h:691
BaseInteractable::getAngularVelocity
virtual const Vec3D & getAngularVelocity() const
Returns the angular velocity of this interactable.
Definition: BaseInteractable.cc:341
mathsFunc::square
T square(const T val)
squares a number
Definition: ExtendedMath.h:106
BaseParticle::periodicFromParticle_
BaseParticle * periodicFromParticle_
Pointer to the previous Particle in the same HGrid cell.
Definition: BaseParticle.h:682
ParticleHandler::checkExtrema
void checkExtrema(BaseParticle *P)
Checks if the extrema of this ParticleHandler needs updating.
Definition: ParticleHandler.cc:1163
BaseParticle::getDisplacement2
const Vec3D getDisplacement2(Mdouble xmin, Mdouble xmax, Mdouble ymin, Mdouble ymax, Mdouble zmin, Mdouble zmax, Mdouble t) const
Definition: BaseParticle.cc:465
BaseInteractable::getSpecies
const ParticleSpecies * getSpecies() const
Returns a pointer to the species of this BaseInteractable.
Definition: BaseInteractable.h:108
BaseParticle::setHGridNextObject
void setHGridNextObject(BaseParticle *p)
Sets the pointer to the next object in the particle's HGrid cell & level.
Definition: BaseParticle.h:480
BaseParticle::setHandler
void setHandler(ParticleHandler *handler)
Sets the pointer to the particle's ParticleHandler.
Definition: BaseParticle.cc:651
DPMBase::getParticleDimensions
unsigned int getParticleDimensions() const
Returns the particle dimensionality.
Definition: DPMBase.cc:1458
BaseParticle::printHGrid
void printHGrid(std::ostream &os) const
Adds particle's HGrid level and cell coordinates to an ostream.
Definition: BaseParticle.cc:420
BaseParticle::invInertia_
MatrixSymmetric3D invInertia_
Inverse Particle mass (for computation optimization)
Definition: BaseParticle.h:657
BaseParticle::setCommunicationComplexity
void setCommunicationComplexity(unsigned complexity)
Set the communication complexity of the particle.
Definition: BaseParticle.cc:190
BaseInteractable::rotate
virtual void rotate(const Vec3D &angularVelocityDt)
Rotates this BaseInteractable.
Definition: BaseInteractable.cc:230
Vector.h
Vec3D::setZero
void setZero()
Sets all elements to zero.
Definition: Vector.cc:43
HGridCell::getHGridZ
int getHGridZ() const
Definition: HGridCell.h:76
constants::pi
const Mdouble pi
Definition: ExtendedMath.h:45
BaseParticle::setInPeriodicDomain
void setInPeriodicDomain(bool flag)
Flags the status of the particle wether it is in the periodic communication zone or not.
Definition: BaseParticle.cc:286
BaseParticle::setHGridX
void setHGridX(const int x)
Sets the particle's HGrid cell X-coordinate.
Definition: BaseParticle.h:449
BaseSpecies::getInteractionDistance
Mdouble getInteractionDistance() const
returns the largest separation distance at which adhesive short-range forces can occur.
Definition: BaseSpecies.h:146
BaseParticle::accelerate
void accelerate(const Vec3D &vel)
Increases the particle's velocity_ by the given vector.
Definition: BaseParticle.cc:622
InteractionHandler
Container to store Interaction objects.
Definition: InteractionHandler.h:44
BaseParticle::getHGridLevel
unsigned int getHGridLevel() const
Returns particle's HGrid level.
Definition: BaseParticle.h:234
BaseParticle::fixParticle
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...
Definition: BaseParticle.cc:165
BaseSpecies::getHandler
SpeciesHandler * getHandler() const
Returns the pointer to the handler to which this species belongs.
Definition: BaseSpecies.cc:99
HGridCell::getHGridLevel
unsigned int getHGridLevel() const
Definition: HGridCell.h:86
BaseParticle::getPeriodicFromParticle
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
Definition: BaseParticle.h:341
BaseParticle::getName
std::string getName() const override
Returns the name of the object.
Definition: BaseParticle.cc:342
BaseInteractable::setPosition
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
BaseParticle::movePrevious
void movePrevious(const Vec3D &posMove)
Adds a vector to the particle's previousPosition_.
Definition: BaseParticle.cc:612
BaseWall
Basic class for walls.
Definition: BaseWall.h:48
logger
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
BaseParticle::getMomentum
Vec3D getMomentum() const
Definition: BaseParticle.h:328
BaseInteractable::getForce
const Vec3D & getForce() const
Returns the force on this BaseInteractable.
Definition: BaseInteractable.h:126
HGrid
In the HGrid class, here all information about the HGrid is stored.
Definition: HGrid.h:43
BaseParticle::getExponentEps2
virtual Mdouble getExponentEps2() const
Only ustilised in case of superquadric particles. Had to create a virtual function to allow function ...
Definition: BaseParticle.cc:848
BaseInteractable::getTorque
const Vec3D & getTorque() const
Returns the torque on this BaseInteractable.
Definition: BaseInteractable.h:138
Vec3D::X
Mdouble X
the vector components
Definition: Vector.h:65
BaseParticle::isMaserParticle
bool isMaserParticle() const
Indicates if this particle belongs to the maser boundary.
Definition: BaseParticle.cc:301
ParticleSpecies::getMixedSpecies
const BaseSpecies * getMixedSpecies(const ParticleSpecies *s) const
Definition: ParticleSpecies.cc:237
BaseParticle::setIndSpecies
MERCURY_DEPRECATED void setIndSpecies(unsigned int indSpecies) override
Definition: BaseParticle.cc:780
DPMBase::periodicBoundaryHandler
PeriodicBoundaryHandler periodicBoundaryHandler
Internal handler that deals with periodic boundaries, especially in a parallel build.
Definition: DPMBase.h:1415
Vec3D::dot
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Definition: Vector.cc:76
BaseParticle::setPreviousPeriodicComplexity
void setPreviousPeriodicComplexity(std::vector< int > complexity)
Set the previous periodic communication complexity of the paritcle.
Definition: BaseParticle.cc:260
HGridCell::getHGridY
int getHGridY() const
Definition: HGridCell.h:66
BaseParticle::getInteractionDistance
Mdouble getInteractionDistance(const BaseInteractable *i) const
Returns the interactionDistance_ of the mixed species of this particle and the particle or wall i.
Definition: BaseParticle.h:369
BaseParticle::getKineticEnergy
Mdouble getKineticEnergy() const
Calculates the particle's translational kinetic energy.
Definition: BaseParticle.cc:444
BaseParticle::setInfiniteInertia
void setInfiniteInertia()
Sets the particle's inertia_ to 'infinite' (1e20) and its invInertia_ to 0.
Definition: BaseParticle.cc:520
BaseParticle::hGridCell
HGridCell hGridCell
Definition: BaseParticle.h:676
BaseParticle::getNumberOfFieldsVTK
virtual unsigned getNumberOfFieldsVTK() const
Definition: BaseParticle.cc:822
BaseHandler::getSize
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
BaseParticle::integrateBeforeForceComputation
void integrateBeforeForceComputation(double time, double timeStep)
First step of Velocity Verlet integration.
Definition: BaseParticle.cc:708
BaseParticle::communicationComplexity_
unsigned communicationComplexity_
returns true if it flagged as being in MPI domain
Definition: BaseParticle.h:687
BaseParticle::setDisplacement
void setDisplacement(const Vec3D &disp)
Sets the particle's displacement (= difference between current position and that of the previous time...
Definition: BaseParticle.cc:593
BaseInteractable::getOrientation
const Quaternion & getOrientation() const
Returns the orientation of this BaseInteractable.
Definition: BaseInteractable.h:230
BaseParticle::setInertia
virtual void setInertia()
Definition: BaseParticle.cc:497
BaseParticle::isInPeriodicDomain_
bool isInPeriodicDomain_
Definition: BaseParticle.h:690
BaseParticle::setInMPIDomain
void setInMPIDomain(bool flag)
Flags the status of the particle if wether it is in the communication zone or not.
Definition: BaseParticle.cc:275
BaseInteractable::getIndSpecies
unsigned int getIndSpecies() const
Returns the index of the species associated with the interactable object.
Definition: BaseInteractable.h:88
BaseParticle::getAngularMomentum
Vec3D getAngularMomentum() const
Definition: BaseParticle.cc:567
BaseParticle::setHGridLevel
void setHGridLevel(const unsigned int level)
Sets the particle's HGrid level.
Definition: BaseParticle.h:472
BaseInteractable::move
virtual void move(const Vec3D &move)
Moves this BaseInteractable by adding an amount to the position.
Definition: BaseInteractable.cc:215
ParticleSpecies
Definition: ParticleSpecies.h:37
BaseInteractable::setIndSpecies
virtual void setIndSpecies(unsigned int indSpecies)
Sets the index of the Species of this BaseInteractable.
Definition: BaseInteractable.h:98
BaseInteractable
Defines the basic properties that a interactable object can have.
Definition: BaseInteractable.h:55
BaseParticle::getInertia
MatrixSymmetric3D getInertia() const
Definition: BaseParticle.h:331
BaseParticle::getParticleDimensions
unsigned int getParticleDimensions() const
Returns the particle's dimensions (either 2 or 3).
Definition: BaseParticle.cc:770
DPMBase::hGridUpdateMove
virtual void hGridUpdateMove(BaseParticle *, Mdouble)
Definition: DPMBase.cc:1924
BaseParticle::getVolume
virtual Mdouble getVolume() const
Get Particle volume function, which required a reference to the Species vector. It returns the volume...
Definition: BaseParticle.cc:141
BaseInteractable::getVelocity
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Definition: BaseInteractable.cc:329
BaseParticle::getHGridY
int getHGridY() const
Returns particle's HGrid cell Y-coordinate.
Definition: BaseParticle.h:272
BaseParticle::setRadius
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:542
Vec3D
Definition: Vector.h:50
BaseParticle::getNameVTK
virtual std::string getNameVTK(unsigned i) const
Definition: BaseParticle.cc:832
BaseParticle::~BaseParticle
~BaseParticle() override
Particle destructor, needs to be implemented and checked if it removes tangential spring information.
Definition: BaseParticle.cc:123
ParticleSpecies::getDensity
Mdouble getDensity() const
Allows density_ to be accessed.
Definition: ParticleSpecies.cc:117
BaseInteraction::setDistance
void setDistance(Mdouble distance)
Sets the interaction distance between the two interacting objects.
Definition: BaseInteraction.cc:219
BaseInteractable::setOrientation
void setOrientation(const Quaternion &orientation)
Sets the orientation of this BaseInteractable.
Definition: BaseInteractable.h:260
BaseParticle::isInMPIDomain_
bool isInMPIDomain_
returns true if the particle acts as an MPI particle instead of a real particle
Definition: BaseParticle.h:686
BaseInteraction
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
BaseParticle::setAxes
virtual void setAxes(const Vec3D &axes)
Only ustilised in case of superquadric particles.
Definition: BaseParticle.h:527
BaseObject::setId
void setId(unsigned long id)
Assigns a unique identifier to each object in the handler (container) which remains constant even aft...
Definition: BaseObject.cc:72
BaseParticle::getHGridNextObject
BaseParticle * getHGridNextObject() const
Returns pointer to next object in particle's HGrid level & cell.
Definition: BaseParticle.h:242
Mdouble
double Mdouble
Definition: GeneralDefine.h:34
BaseParticle::hGridNextObject_
BaseParticle * hGridNextObject_
Definition: BaseParticle.h:678
MatrixSymmetric3D::setZero
void setZero()
Sets all elements to zero.
Definition: MatrixSymmetric.cc:70
ParticleHandler::addedFixedParticle
void addedFixedParticle()
Increment of the number of fixed particles.
Definition: ParticleHandler.cc:1224
BaseParticle::getRadius
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
BaseParticle::unfix
void unfix()
Unfix Particle function, which required a reference to the Species vector. It unfixes a Particle by c...
Definition: BaseParticle.cc:316
BaseParticle::getAxes
virtual Vec3D getAxes() const
Only ustilised in case of superquadric particles. Had to create a virtual function to allow function ...
Definition: BaseParticle.cc:842
BaseParticle::setHGridZ
void setHGridZ(const int z)
Sets the particle's HGrid cell Z-coordinate.
Definition: BaseParticle.h:465
BaseParticle::invMass_
Mdouble invMass_
Particle radius_.
Definition: BaseParticle.h:656
ParticleSpecies.h
BaseInteractable::setVelocity
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
BaseParticle::getWallInteractionRadius
Mdouble getWallInteractionRadius(const BaseWall *wall) const
returns the radius plus the interactionDistance
Definition: BaseParticle.h:386
BaseParticle::getHGridPrevObject
BaseParticle * getHGridPrevObject() const
Returns pointer to previous object in particle's HGrid level & cell.
Definition: BaseParticle.h:250
BaseParticle::copy
virtual BaseParticle * copy() const =0
Particle copy method. It calls to copy constructor of this Particle, useful for polymorphism.
SpeciesHandler
Container to store all ParticleSpecies.
Definition: SpeciesHandler.h:37
BaseParticle::setInverseInertia
void setInverseInertia(MatrixSymmetric3D inverseInertia)
Sets the particle's inertia_ (and adjusts invInertia_ accordingly)
Definition: BaseParticle.cc:511
BaseParticle::isMPIParticle
bool isMPIParticle() const
Indicates if this particle is a ghost in the MPI domain.
Definition: BaseParticle.cc:175
BaseParticle::setMass
MERCURY_DEPRECATED void setMass(Mdouble mass)
Sets the particle's mass.
Definition: BaseParticle.cc:556
BaseParticle::setPeriodicFromParticle
void setPeriodicFromParticle(BaseParticle *p)
Assigns the pointer to the 'original' particle this one's a periodic copy of (used in periodic bounda...
Definition: BaseParticle.h:441
double
BaseInteractable::setAngularVelocity
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
Definition: BaseInteractable.cc:360
BaseParticle::computeMass
virtual void computeMass(const ParticleSpecies &s)
Computes the particle's (inverse) mass and inertia.
Definition: BaseParticle.cc:862
ERROR
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
MERCURY_DEPRECATED
#define MERCURY_DEPRECATED
Definition: GeneralDefine.h:37
BaseParticle::setSpecies
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:804
BaseParticle::getDisplacement
const Vec3D & getDisplacement() const
Returns the particle's displacement relative to the previous time step.
Definition: BaseParticle.h:395
BaseInteraction::getOverlap
Mdouble getOverlap() const
Returns a Mdouble with the current overlap between the two interacting objects.
Definition: BaseInteraction.h:240
BaseInteraction::getNormal
const Vec3D & getNormal() const
Gets the normal vector between the two interacting objects.
Definition: BaseInteraction.h:226
BaseInteraction::setOverlap
void setOverlap(Mdouble overlap)
Set the overlap between the two interacting object.
Definition: BaseInteraction.cc:229
WARN
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:54
ParticleSpecies::getMaxInteractionDistance
Mdouble getMaxInteractionDistance() const
returns the largest separation distance at which adhesive short-range forces can occur.
Definition: ParticleSpecies.h:113
BaseParticle::getInvMass
Mdouble getInvMass() const override
Returns the inverse of the particle's mass.
Definition: BaseParticle.h:293
Log::FATAL
@ FATAL
DPMBase::speciesHandler
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1385
BaseParticle::setMaserParticle
void setMaserParticle(bool flag)
Flags the status of the particle if it belongs to the maser boundary or not.
Definition: BaseParticle.cc:306
HGridCell::setHGridLevel
void setHGridLevel(unsigned int HGridLevel)
Definition: HGridCell.h:91
BaseInteractable::read
void read(std::istream &is) override
Reads a BaseInteractable from an input stream.
Definition: BaseInteractable.cc:244
MatrixSymmetric3D::ZZ
Mdouble ZZ
Definition: MatrixSymmetric.h:42
HGridCell::setHGridY
void setHGridY(int HGridY)
Definition: HGridCell.h:71
BaseParticle::setMPIParticle
void setMPIParticle(bool flag)
Flags the mpi particle status.
Definition: BaseParticle.cc:185
HGridCell.h
BaseParticle::setExponents
virtual void setExponents(const Mdouble &eps1, const Mdouble &eps2)
Only ustilised in case of superquadric particles.
Definition: BaseParticle.h:532
DPMBase.h
BaseParticle::setPeriodicComplexity
void setPeriodicComplexity(std::vector< int > complexity)
Set the periodic communication complexity of the particle.
Definition: BaseParticle.cc:200
BaseParticle::getHGridX
int getHGridX() const
Returns particle's HGrid cell X-coordinate.
Definition: BaseParticle.h:265
ParticleHandler::removedFixedParticle
void removedFixedParticle()
Decrement of the number of fixed particles.
Definition: ParticleHandler.cc:1229
BaseInteractable::integrateAfterForceComputation
void integrateAfterForceComputation(double time, double timeStep)
This is part of the integration routine for objects with infinite mass.
Definition: BaseInteractable.cc:611
BaseParticle::getSurfaceArea
Mdouble getSurfaceArea() const
Definition: BaseParticle.h:325
BaseInteractable::addVelocity
void addVelocity(const Vec3D &velocity)
adds an increment to the velocity.
Definition: BaseInteractable.h:312
BaseParticle::integrateAfterForceComputation
void integrateAfterForceComputation(double time, double timeStep)
Second step of Velocity Verlet integration.
Definition: BaseParticle.cc:748
BaseParticle::setInfo
virtual void setInfo(Mdouble info)
Sets some user-defined information about this object (by default, species ID).
Definition: BaseParticle.cc:347
Vec3D::Y
Mdouble Y
Definition: Vector.h:65
BaseParticle::isMPIParticle_
bool isMPIParticle_
Pointer to originating Particle.
Definition: BaseParticle.h:685
DPMBase::getHGridUpdateEachTimeStep
virtual bool getHGridUpdateEachTimeStep() const
Definition: DPMBase.cc:1709
BaseParticle::isMaserParticle_
bool isMaserParticle_
Indicates the periodic complexity at current time step. Used to update periodic status.
Definition: BaseParticle.h:694
InteractionHandler::getInteraction
BaseInteraction * getInteraction(BaseInteractable *P, BaseInteractable *I, unsigned timeStamp)
Returns the Interaction between the BaseInteractable's P and I.
Definition: InteractionHandler.cc:149
BaseParticle::isInMPIDomain
bool isInMPIDomain()
Indicates if the particle is in the communication zone of the mpi domain.
Definition: BaseParticle.cc:270
BaseInteraction::setContactPoint
void setContactPoint(Vec3D contactPoint)
Set the location of the contact point between the two interacting objects.
Definition: BaseInteraction.cc:238
BaseParticle::setMassForP3Statistics
void setMassForP3Statistics(Mdouble mass)
Sets the particle's mass This function should not be used, but is necessary to extend the CG toolbox ...
Definition: BaseParticle.cc:577
HGridCell::setHGridZ
void setHGridZ(int HGridZ)
Definition: HGridCell.h:81
MatrixSymmetric3D::inverse
static MatrixSymmetric3D inverse(const MatrixSymmetric3D &A)
Computes the inverse of a matrix; exits if the inverse doesn't exist.
Definition: MatrixSymmetric.cc:288
BaseParticle::displacement_
Vec3D displacement_
Indicates if this particle belongs to the maser boundary or is released into the wide open world.
Definition: BaseParticle.h:696
constants::i
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
BaseInteraction::setNormal
void setNormal(Vec3D normal)
Sets the normal vector between the two interacting objects.
Definition: BaseInteraction.cc:210
BaseParticle::periodicComplexity_
std::vector< int > periodicComplexity_
Indicates the periodic complexity at previous time step.
Definition: BaseParticle.h:693
Quaternion
This class contains the 4 components of a quaternion and the standard operators and functions needed ...
Definition: Quaternion.h:63
BaseParticle::getCurvature
Mdouble getCurvature(const Vec3D &labFixedCoordinates) const override
Definition: BaseParticle.h:296
BaseParticle::getExponentEps1
virtual Mdouble getExponentEps1() const
Only ustilised in case of superquadric particles. Had to create a virtual function to allow function ...
Definition: BaseParticle.cc:845
BaseObject::setIndex
void setIndex(unsigned int index)
Allows one to assign an index to an object in the handler/container.
Definition: BaseObject.cc:64
BaseParticle::actionsAfterTimeStep
virtual void actionsAfterTimeStep()
Definition: BaseParticle.h:642
BaseHandler::getObject
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
MatrixSymmetric3D::XX
Mdouble XX
The six distinctive matrix elements.
Definition: MatrixSymmetric.h:42
BaseObject::getId
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:125
BaseParticle::setPreviousPosition
void setPreviousPosition(const Vec3D &pos)
Sets the particle's position in the previous time step.
Definition: BaseParticle.cc:602
BaseHandler::getDPMBase
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
Definition: BaseHandler.h:725
HGridCell::setHGridX
void setHGridX(int HGridX)
Definition: HGridCell.h:61
BaseParticle
Definition: BaseParticle.h:54
Vec3D::getLengthSquared
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
Definition: Vector.h:316
BaseInteractable::setSpecies
void setSpecies(const ParticleSpecies *species)
Sets the species of this BaseInteractable.
Definition: BaseInteractable.cc:185
BaseParticle::previousPeriodicComplexity_
std::vector< int > previousPeriodicComplexity_
Indicates if the particle is a ghost particle of a periodic particle.
Definition: BaseParticle.h:692
HGridCell
Definition: HGridCell.h:33
BaseParticle::write
void write(std::ostream &os) const override
Particle print function, which accepts an std::ostream as input.
Definition: BaseParticle.cc:330
BaseParticle::getMaxInteractionRadius
Mdouble getMaxInteractionRadius() const
Returns the particle's interaction radius, which might be different from radius_ (e....
Definition: BaseParticle.h:362
BaseParticle::getHGridCell
const HGridCell & getHGridCell() const
Definition: BaseParticle.h:648
BaseParticle::previousPosition_
Vec3D previousPosition_
Displacement (only used in StatisticsVector, StatisticsPoint)
Definition: BaseParticle.h:697
Vec3D::cross
static Vec3D cross(const Vec3D &a, const Vec3D &b)
Calculates the cross product of two Vec3D: .
Definition: Vector.cc:163
BaseParticle::getHandler
ParticleHandler * getHandler() const
Returns pointer to the particle's ParticleHandler.
Definition: BaseParticle.cc:661
HGridCell::getHGridX
int getHGridX() const
Definition: HGridCell.h:56
Quaternion::setEuler
void setEuler(const Vec3D &e)
Convert Euler angles to a quaternion. See Wikipedia for details.
Definition: Quaternion.cc:473
BaseParticle::hGridPrevObject_
BaseParticle * hGridPrevObject_
Pointer to the next Particle in the same HGrid cell.
Definition: BaseParticle.h:679
BaseParticle::read
void read(std::istream &is) override
Particle read function, which accepts an std::istream as input.
Definition: BaseParticle.cc:368
BaseInteractable::write
void write(std::ostream &os) const override
Write a BaseInteractable to an output stream.
Definition: BaseInteractable.cc:274
ParticleHandler
Container to store all BaseParticle.
Definition: ParticleHandler.h:48
Vec3D::getDistanceSquared
static Mdouble getDistanceSquared(const Vec3D &a, const Vec3D &b)
Calculates the squared distance between two Vec3D: .
Definition: Vector.h:295
BaseParticle::isFixed
bool isFixed() const override
Is fixed Particle function. It returns whether a Particle is fixed or not, by checking its inverse Ma...
Definition: BaseParticle.h:93
BaseParticle::addDisplacement
void addDisplacement(const Vec3D &addDisp)
Adds a vector to the particle's displacement_.
Definition: BaseParticle.cc:641
BaseParticle::isSphericalParticle
virtual bool isSphericalParticle() const
Definition: BaseParticle.h:645
MatrixSymmetric3D
Implementation of a 3D symmetric matrix.
Definition: MatrixSymmetric.h:37
DPMBase::getRotation
bool getRotation() const
Indicates whether particle rotation is enabled or disabled.
Definition: DPMBase.h:559
DPMBase::particleHandler
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1395
BaseParticle::getInvInertia
MatrixSymmetric3D getInvInertia() const
Returns the inverse of the particle's inertia tensor.
Definition: BaseParticle.h:286
Vec3D::Z
Mdouble Z
Definition: Vector.h:65
BaseParticle::isPeriodicGhostParticle
bool isPeriodicGhostParticle() const
Indicates if this particle is a ghost in the periodic boundary.
Definition: BaseParticle.cc:291
BaseParticle::getPeriodicComplexity
const std::vector< int > & getPeriodicComplexity()
Obtains the periodic communication complexity of the particle.
Definition: BaseParticle.cc:225
BaseParticle::getPreviousPosition
const Vec3D & getPreviousPosition() const
Returns the particle's position in the previous time step.
Definition: BaseParticle.h:403
BaseParticle::isInContactWith
virtual bool isInContactWith(const BaseParticle *P) const
Get whether or not this particle is in contact with the given particle.
Definition: BaseParticle.cc:851
ParticleHandler::checkExtremaOnDelete
void checkExtremaOnDelete(BaseParticle *P)
Checks if the extrema of this ParticleHandler needs updating when a particle is deleted.
Definition: ParticleHandler.cc:1189
BaseInteractable::addAngularVelocity
void addAngularVelocity(const Vec3D &angularVelocity)
add an increment to the angular velocity.
Definition: BaseInteractable.cc:370
BaseParticle::BaseParticle
BaseParticle()
Basic Particle constructor, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1.
Definition: BaseParticle.cc:33
BaseInteractable::integrateBeforeForceComputation
void integrateBeforeForceComputation(double time, double timeStep)
This is part of integrate routine for objects with infinite mass.
Definition: BaseInteractable.cc:538
BaseParticle::oldRead
virtual void oldRead(std::istream &is)
Definition: BaseParticle.cc:380
BaseParticle::getRotationalEnergy
Mdouble getRotationalEnergy() const
Calculates the particle's rotational kinetic energy.
Definition: BaseParticle.cc:452
BaseParticle::getSumOfInteractionRadii
Mdouble getSumOfInteractionRadii(const BaseParticle *particle) const
returns the sum of the radii plus the interactionDistance
Definition: BaseParticle.h:379
BaseParticle::radius_
Mdouble radius_
Definition: BaseParticle.h:655
BaseParticle::getMass
Mdouble getMass() const
Returns the particle's mass.
Definition: BaseParticle.h:322
BaseParticle::getTypeVTK
virtual std::string getTypeVTK(unsigned i) const
Definition: BaseParticle.cc:827
BaseParticle::getFieldVTK
virtual std::vector< Mdouble > getFieldVTK(unsigned i) const
Definition: BaseParticle.cc:837
BaseParticle.h
BaseParticle::getHGridZ
int getHGridZ() const
Returns particle's HGrid cell Z-coordinate.
Definition: BaseParticle.h:279
BaseParticle::setPeriodicGhostParticle
void setPeriodicGhostParticle(bool flag)
Flags the status of the particle to be a ghost in periodic boundary or not.
Definition: BaseParticle.cc:296
BaseParticle::getGravitationalEnergy
Mdouble getGravitationalEnergy() const
Calculates the particle's gravitational energy.
BaseParticle::getCommunicationComplexity
unsigned getCommunicationComplexity()
Obtains the communication complexity of the particle.
Definition: BaseParticle.cc:195
BaseParticle::info_
Mdouble info_
Definition: BaseParticle.h:705
BaseParticle::getInfo
virtual Mdouble getInfo() const
Returns some user-defined information about this object (by default, species ID).
Definition: BaseParticle.cc:352
BaseParticle::setHGridPrevObject
void setHGridPrevObject(BaseParticle *p)
Sets the pointer to the previous object in the particle's HGrid cell & level.
Definition: BaseParticle.h:488
Vec3D::getLengthSquared
Mdouble getLengthSquared() const
Calculates the squared length of this Vec3D: .
Definition: Vector.cc:184
BaseInteractable.h
MatrixSymmetric3D::YY
Mdouble YY
Definition: MatrixSymmetric.h:42
BaseParticle::angularAccelerate
void angularAccelerate(const Vec3D &angVel)
Increases the particle's angularVelocity_ by the given vector.
Definition: BaseParticle.cc:632
BaseParticle::isInPeriodicDomain
bool isInPeriodicDomain() const
Indicates if the particle is in the periodic boundary communication zone.
Definition: BaseParticle.cc:281
BaseInteractable::getPosition
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
PossibleContact
Class that describes a possible contact between two BaseParticle.
Definition: PossibleContact.h:42
DPMBase
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:76
ParticleSpecies::computeMass
void computeMass(BaseParticle *p) const
Compute Particle mass function, which required a reference to the Species vector. It computes the Par...
Definition: ParticleSpecies.cc:166