MercuryDPM
Alpha
|
#include <BaseParticle.h>
Public Member Functions | |
BaseParticle () | |
Basic Particle constructor, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1. More... | |
BaseParticle (const BaseParticle &p) | |
Particle copy constructor, which accepts as input a reference to a Particle. It creates a copy of this Particle and all it's information. Usually it is better to use the copy() function for polymorfism. More... | |
virtual | ~BaseParticle () |
Particle destructor, needs to be implemented and checked if it removes tangential spring information. More... | |
virtual BaseParticle * | copy () const |
Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism. More... | |
Mdouble | getVolume () const |
Get Particle volume function, which required a reference to the Species vector. It returns the volume of the Particle. More... | |
void | fixParticle () |
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to zero. More... | |
bool | isFixed () const |
Is fixed Particle function. It returns whether a Particle is fixed or not, by checking its inverse Mass. More... | |
void | unfix () |
Unfix Particle function, which required a reference to the Species vector. It unfixes a Particle by computing the Particles mass and inertia. More... | |
virtual void | read (std::istream &is) |
Particle read function, which accepts an std::istream as input. More... | |
virtual MERCURY_DEPRECATED void | oldRead (std::istream &is) |
deprecated version of the read function. More... | |
virtual void | write (std::ostream &os) const |
Particle print function, which accepts an std::ostream as input. More... | |
virtual std::string | getName () const |
Returns the name of the object. More... | |
void | printHGrid (std::ostream &os) const |
Adds particle's HGrid level and cell coordinates to an ostream. More... | |
unsigned int | getHGridLevel () const |
Returns particle's HGrid level. More... | |
BaseParticle * | getHGridNextObject () const |
Returns pointer to next object in particle's HGrid level & cell. More... | |
BaseParticle * | getHGridPrevObject () const |
Returns pointer to previous object in particle's HGrid level & cell. More... | |
int | getHGridX () const |
Returns particle's HGrid cell X-coordinate. More... | |
int | getHGridY () const |
Returns particle's HGrid cell Y-coordinate. More... | |
int | getHGridZ () const |
Returns particle's HGrid cell Z-coordinate. More... | |
Mdouble | getInertia () const |
Returns the particle's inertia_. More... | |
Mdouble | getInvInertia () const |
Returns the particle's invInertia_. More... | |
Mdouble | getInvMass () const |
Returns the particle's invMass_. More... | |
Mdouble | getKineticEnergy () const |
Calculates the particle's kinetic energy. More... | |
Mdouble | getMass () const |
Returns the particle's mass_. More... | |
BaseParticle * | getPeriodicFromParticle () const |
Returns the 'original' particle this one's a periodic copy of. More... | |
Mdouble | getRadius () const |
Returns the particle's radius_. More... | |
Mdouble | getInteractionRadius () const |
Returns the particle's interaction radius, which might be different from radius_ (e.g., when dealing with wet particles) More... | |
Mdouble | getWallInteractionRadius () const |
Returns the interaction radius for interaction with walls. See also BaseParticle::getInteractionRadius(). More... | |
const Vec3D & | getDisplacement () const |
Returns the particle's displacement relative to the previous time step. More... | |
const Vec3D & | getPreviousPosition () const |
Returns the particle's position in the previous time step. More... | |
const Vec3D | getDisplacement2 (Mdouble xmin, Mdouble xmax, Mdouble ymin, Mdouble ymax, Mdouble zmin, Mdouble zmax, Mdouble t) const |
void | setInertia (const Mdouble newInertia) |
Sets the particle's inertia_ (and adjusts invInertia_ accordingly) More... | |
void | setInfiniteInertia () |
Sets the particle's inertia_ to 'infinite' (1e20) and its invInertia_ to 0. More... | |
void | setPeriodicFromParticle (BaseParticle *p) |
Assigns the pointer to the 'original' particle this one's a periodic copy of. More... | |
void | setHGridX (const int x) |
Sets the particle's HGrid cell X-coordinate. More... | |
void | setHGridY (const int y) |
Sets the particle's HGrid cell Y-coordinate. More... | |
void | setHGridZ (const int z) |
Sets the particle's HGrid cell Z-coordinate. More... | |
void | setHGridLevel (const unsigned int level) |
Sets the particle's HGrid level. More... | |
void | setHGridNextObject (BaseParticle *p) |
Sets the pointer to the next object in the particle's HGrid cell & level. More... | |
void | setHGridPrevObject (BaseParticle *p) |
Sets the pointer to the previous object in the particle's HGrid cell & level. More... | |
void | setRadius (const Mdouble radius) |
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) More... | |
MERCURY_DEPRECATED void | setMass (const Mdouble mass) |
Sets the particle's mass. More... | |
void | setMassForP3Statistics (const Mdouble mass) |
Sets the particle's mass This function should not be used, but is necessary to extend the CG toolbox to non-spherical particles. More... | |
void | setDisplacement (const Vec3D &disp) |
Sets the particle's displacement (= difference between current position and that of the previous time step) More... | |
void | setPreviousPosition (const Vec3D &pos) |
Sets the particle's position in the previous time step. More... | |
void | movePrevious (const Vec3D &posMove) |
Adds a vector to the particle's previousPosition_. More... | |
void | accelerate (const Vec3D &vel) |
Increases the particle's velocity_ by the given vector. More... | |
void | angularAccelerate (const Vec3D &angVel) |
Increases the particle's angularVelocity_ by the given vector. More... | |
void | addDisplacement (const Vec3D &addDisp) |
Adds a vector to the particle's displacement_. More... | |
void | setHandler (ParticleHandler *handler) |
Sets the pointer to the particle's ParticleHandler. More... | |
ParticleHandler * | getHandler () const |
Returns pointer to the particle's ParticleHandler. More... | |
std::vector< 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 associated BaseInteraction object (else returns 0). More... | |
void | integrateBeforeForceComputation (double time, double timeStep) |
First step of Velocity Verlet integration. More... | |
void | integrateAfterForceComputation (double time, double timeStep) |
Second step of Velocity Verlet integration. More... | |
unsigned int | getParticleDimensions () const |
Returns the particle's dimensions (either 2 or 3). More... | |
MERCURY_DEPRECATED void | setIndSpecies (unsigned int indSpecies) |
void | setSpecies (const ParticleSpecies *species) |
virtual unsigned | getNumberOfFieldsVTK () const |
virtual std::string | getTypeVTK (unsigned i) const |
virtual std::string | getNameVTK (unsigned i) const |
virtual std::vector< Mdouble > | getFieldVTK (unsigned i) const |
Public Member Functions inherited from BaseInteractable | |
BaseInteractable () | |
Default BaseInteractable constructor, it simply creates an empty BaseInteractable. More... | |
BaseInteractable (const BaseInteractable &p) | |
Copy constructor. It copies the BaseInteractable and all objects it contains. More... | |
virtual | ~BaseInteractable () |
Destructor, it simply destructs the BaseInteractable and all the objects it contains. More... | |
unsigned int | getIndSpecies () const |
Returns the index of the Species of this BaseInteractable. More... | |
const ParticleSpecies * | getSpecies () const |
Returns a pointer to the species of this BaseInteractable. More... | |
void | setSpecies (const ParticleSpecies *species) |
Sets the species of this BaseInteractable. More... | |
const Vec3D & | getForce () const |
Returns the force on this BaseInteractable. More... | |
const Vec3D & | getTorque () const |
Returns the torque on this BaseInteractable. More... | |
void | setForce (const Vec3D &force) |
Sets the force on this BaseInteractable. More... | |
void | setTorque (const Vec3D &torque) |
Sets the torque on this BaseInteractable. More... | |
void | addForce (const Vec3D &addForce) |
Adds an amount to the force on this BaseInteractable. More... | |
void | addTorque (const Vec3D &addTorque) |
Adds an amount to the torque on this BaseInteractable. More... | |
const Vec3D & | getPosition () const |
Returns the position of this BaseInteractable. More... | |
const Vec3D & | getOrientation () const |
Returns the orientation of this BaseInteractable. More... | |
void | setPosition (const Vec3D &position) |
Sets the position of this BaseInteractable. More... | |
void | setOrientation (const Vec3D &orientation) |
Sets the orientation of this BaseInteractable. More... | |
virtual void | move (const Vec3D &move) |
Moves this BaseInteractable by adding an amount to the position. More... | |
void | rotate (const Vec3D &rotate) |
Rotates this BaseInteractable. More... | |
const std::list < BaseInteraction * > & | getInteractions () const |
Returns a reference to the list of interactions in this BaseInteractable. More... | |
void | addInteraction (BaseInteraction *I) |
Adds an interaction to this BaseInteractable. More... | |
bool | removeInteraction (BaseInteraction *I) |
Removes an interaction from this BaseInteractable. More... | |
void | copyInteractionsForPeriodicParticles (const BaseInteractable &p) |
Copies interactions to this BaseInteractable whenever a periodic copy made. More... | |
void | setVelocity (const Vec3D &velocity) |
set the velocity of the BaseInteractable. More... | |
void | setAngularVelocity (const Vec3D &angularVelocity) |
set the angular velocity of the BaseInteractble. More... | |
void | addVelocity (const Vec3D &velocity) |
adds an increment to the velocity. More... | |
void | addAngularVelocity (const Vec3D &angularVelocity) |
add an increment to the angular velocity. More... | |
virtual const Vec3D & | getVelocity () const |
Returns the velocity of this interactable. More... | |
virtual const Vec3D & | getAngularVelocity () const |
Returns the angular velocity of this interactable. More... | |
void | setPrescribedPosition (const std::function< Vec3D(double)> &prescribedPosition) |
Allows the position of an infinite mass interactable to be prescribed. More... | |
void | applyPrescribedPosition (double time) |
Computes the position from the user defined prescribed position function. More... | |
void | setPrescribedVelocity (const std::function< Vec3D(double)> &prescribedVelocity) |
Allows the velocity of an infinite mass interactable to be prescribed. More... | |
void | applyPrescribedVelocity (double time) |
Computes the velocity from the user defined prescribed velocity function. More... | |
void | setPrescribedOrientation (const std::function< Vec3D(double)> &prescribedOrientation) |
Allows the orientation of the infinite mass interactbale to be prescribed. More... | |
void | applyPrescribedOrientation (double time) |
Computes the orientation from the user defined prescribed orientation function. More... | |
void | setPrescribedAngularVelocity (const std::function< Vec3D(double)> &prescribedAngularVelocity) |
Allows the angular velocity of the infinite mass interactable to be prescribed. More... | |
void | applyPrescribedAngularVelocity (double time) |
Computes the angular velocity from the user defined prescribed angular velocity. More... | |
virtual const Vec3D | getVelocityAtContact (const Vec3D &contact) const |
Returns the velocity at the contact point, use by many force laws. More... | |
void | integrateBeforeForceComputation (double time, double timeStep) |
This is part of integrate routine for objects with infinite mass. More... | |
void | integrateAfterForceComputation (double time, double timeStep) |
This is part of the integration routine for objects with infinite mass. More... | |
Public Member Functions inherited from BaseObject | |
BaseObject () | |
Default constructor. More... | |
BaseObject (const BaseObject &p) | |
Copy constructor, copies all the objects BaseObject contains. More... | |
virtual | ~BaseObject () |
virtual destructor More... | |
virtual void | moveInHandler (const unsigned int index) |
Except that it is virtual, it does the same thing as setIndex() does. More... | |
void | setIndex (const unsigned int index) |
Allows one to assign an index to an object in the handler/container. More... | |
void | setId (const unsigned int id) |
Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler. More... | |
unsigned int | getIndex () const |
Returns the index of the object in the handler. More... | |
unsigned int | getId () const |
Returns the unique identifier of any particular object. More... | |
Private Attributes | |
ParticleHandler * | handler_ |
Pointer to the particle's ParticleHandler container. More... | |
int | HGridX_ |
Hgrid attributes. More... | |
int | HGridY_ |
int | HGridZ_ |
unsigned int | HGridLevel_ |
Cell position in the grid. More... | |
BaseParticle * | HGridNextObject_ |
Grid level for the object. More... | |
BaseParticle * | HGridPrevObject_ |
Pointer to the next Particle in the same HGrid cell. More... | |
Mdouble | mass_ |
Pointer to the previous Particle in the same HGrid cell. More... | |
Mdouble | invMass_ |
Particle mass_. More... | |
Mdouble | inertia_ |
Inverse Particle mass (for computation optimization) More... | |
Mdouble | invInertia_ |
Particle inertia_. More... | |
Mdouble | radius_ |
Inverse Particle inverse inertia (for computation optimization) More... | |
BaseParticle * | periodicFromParticle_ |
Particle radius_. More... | |
Vec3D | displacement_ |
Pointer to originating Particle. More... | |
Vec3D | previousPosition_ |
Displacement (only used in StatisticsVector, StatisticsPoint) More... | |
Friends | |
class | ParticleSpecies |
Particle's position at previous time step. More... | |
Definition at line 49 of file BaseParticle.h.
BaseParticle::BaseParticle | ( | ) |
Basic Particle constructor, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1.
default constructor, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1
Definition at line 38 of file BaseParticle.cc.
References DEBUG, displacement_, handler_, HGridLevel_, HGridNextObject_, HGridPrevObject_, HGridX_, HGridY_, HGridZ_, inertia_, invInertia_, invMass_, logger, mass_, periodicFromParticle_, radius_, and Vec3D::setZero().
Referenced by copy().
BaseParticle::BaseParticle | ( | const BaseParticle & | p | ) |
Particle copy constructor, which accepts as input a reference to a Particle. It creates a copy of this Particle and all it's information. Usually it is better to use the copy() function for polymorfism.
Constructor that copies most of the properties of the given particle. Please note that not everything is copied, for example the position in the HGrid is not determined yet by the end of this constructor. It also does not copy the interactions and the pointer to the handler that handles this particle. Use with care.
[in,out] | p | Reference to the BaseParticle this one should become a copy of. |
Definition at line 69 of file BaseParticle.cc.
References DEBUG, displacement_, getInertia(), getInvInertia(), getInvMass(), getMass(), handler_, HGridLevel_, HGridNextObject_, HGridPrevObject_, HGridX_, HGridY_, HGridZ_, inertia_, invInertia_, invMass_, logger, mass_, periodicFromParticle_, and radius_.
|
virtual |
Particle destructor, needs to be implemented and checked if it removes tangential spring information.
Destructor. It asks the ParticleHandler to check if this was the smallest or largest particle and adjust itself accordingly.
Definition at line 98 of file BaseParticle.cc.
References ParticleHandler::checkExtremaOnDelete(), DEBUG, getHandler(), BaseObject::getId(), and logger.
void BaseParticle::accelerate | ( | const Vec3D & | vel | ) |
Increases the particle's velocity_ by the given vector.
increases the the particle's velocity_ (BaseInteractable member) by adding the given vector.
[in] | vel | vector to be added to the velocity_ |
Definition at line 662 of file BaseParticle.cc.
References BaseInteractable::addVelocity().
Referenced by integrateAfterForceComputation(), integrateBeforeForceComputation(), and AngledPeriodicBoundary::shiftPosition().
void BaseParticle::addDisplacement | ( | const Vec3D & | addDisp | ) |
Adds a vector to the particle's displacement_.
Lets you add a vector to the particle's displacement_ vector.
[in] | addDisp | vector to be added. |
Definition at line 681 of file BaseParticle.cc.
References displacement_.
void BaseParticle::angularAccelerate | ( | const Vec3D & | angVel | ) |
Increases the particle's angularVelocity_ by the given vector.
increases the particle's angularVelocity_ (BaseInteractable member) by adding the given vector.
[in] | angVel | vector to be added to the angularVelocity_ |
Definition at line 672 of file BaseParticle.cc.
References BaseInteractable::addAngularVelocity().
Referenced by integrateAfterForceComputation(), integrateBeforeForceComputation(), and AngledPeriodicBoundary::shiftPosition().
|
virtual |
Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism.
Copy method. Uses copy constructor to create a copy on the heap. Useful for polymorphism.
Reimplemented in LiquidFilmParticle, and ThermalParticle.
Definition at line 112 of file BaseParticle.cc.
References BaseParticle().
Referenced by CircularPeriodicBoundary::checkBoundaryAfterParticleMoved(), LeesEdwardsBoundary::createHorizontalPeriodicParticles(), ShearBoxBoundary::createHorizontalPeriodicParticles(), CircularPeriodicBoundary::createPeriodicParticles(), MaserBoundary::createPeriodicParticles(), AngledPeriodicBoundary::createPeriodicParticles(), PeriodicBoundary::createPeriodicParticles(), ShearBoxBoundary::createVerticalPeriodicParticles(), LeesEdwardsBoundary::createVerticalPeriodicParticles(), ChuteInsertionBoundary::generateParticle(), CubeInsertionBoundary::generateParticle(), HopperInsertionBoundary::generateParticle(), InsertionBoundary::InsertionBoundary(), InsertionBoundary::set(), and InsertionBoundary::setParticleToCopy().
void BaseParticle::fixParticle | ( | ) |
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to zero.
Fixes a BaseParticle by setting its inverse mass and inertia and velocities to zero.
Definition at line 146 of file BaseParticle.cc.
References inertia_, invInertia_, invMass_, mass_, BaseInteractable::setAngularVelocity(), and BaseInteractable::setVelocity().
Referenced by DPMBase::setFixedParticles().
const Vec3D & BaseParticle::getDisplacement | ( | ) | const |
Returns the particle's displacement relative to the previous time step.
Returns the particle's displacement_, which is the difference between the current particle's position and its position in the previous time step.
Definition at line 421 of file BaseParticle.cc.
References displacement_.
Referenced by CircularPeriodicBoundary::checkBoundaryAfterParticleMoved(), and integrateBeforeForceComputation().
const Vec3D BaseParticle::getDisplacement2 | ( | Mdouble | xmin, |
Mdouble | xmax, | ||
Mdouble | ymin, | ||
Mdouble | ymax, | ||
Mdouble | zmin, | ||
Mdouble | zmax, | ||
Mdouble | t | ||
) | const |
Definition at line 439 of file BaseParticle.cc.
References BaseInteractable::getPosition(), getPreviousPosition(), Vec3D::X, Vec3D::Y, and Vec3D::Z.
|
virtual |
Reimplemented in LiquidFilmParticle.
Definition at line 864 of file BaseParticle.cc.
ParticleHandler * BaseParticle::getHandler | ( | ) | const |
Returns pointer to the particle's ParticleHandler.
Returns the particle's ParticleHandler
Definition at line 701 of file BaseParticle.cc.
References handler_.
Referenced by getParticleDimensions(), integrateAfterForceComputation(), integrateBeforeForceComputation(), setHandler(), setRadius(), and ~BaseParticle().
unsigned int BaseParticle::getHGridLevel | ( | ) | const |
Returns particle's HGrid level.
Returns the particle's HGridLevel_
Definition at line 266 of file BaseParticle.cc.
References HGridLevel_.
Referenced by Mercury2D::hGridFindContactsWithinTargetCell(), Mercury3D::hGridFindContactsWithinTargetCell(), Mercury2D::hGridFindContactsWithTargetCell(), Mercury3D::hGridFindContactsWithTargetCell(), Mercury3D::hGridFindOneSidedContacts(), Mercury2D::hGridFindOneSidedContacts(), Mercury3D::hGridHasContactsInTargetCell(), Mercury2D::hGridRemoveParticle(), Mercury3D::hGridRemoveParticle(), MercuryBase::hGridUpdateMove(), Mercury3D::hGridUpdateParticle(), and Mercury2D::hGridUpdateParticle().
BaseParticle * BaseParticle::getHGridNextObject | ( | ) | const |
Returns pointer to next object in particle's HGrid level & cell.
Returns the next object in the particle's HGrid cell
Definition at line 275 of file BaseParticle.cc.
References HGridNextObject_.
Referenced by Mercury2D::hGridFindContactsWithinTargetCell(), Mercury3D::hGridFindContactsWithinTargetCell(), Mercury2D::hGridFindContactsWithTargetCell(), Mercury3D::hGridFindContactsWithTargetCell(), Mercury3D::hGridHasContactsInTargetCell(), Mercury2D::hGridRemoveParticle(), and Mercury3D::hGridRemoveParticle().
BaseParticle * BaseParticle::getHGridPrevObject | ( | ) | const |
Returns pointer to previous object in particle's HGrid level & cell.
Returns the previous object in the particle's HGrid cell
Definition at line 285 of file BaseParticle.cc.
References HGridPrevObject_.
Referenced by Mercury2D::hGridRemoveParticle(), and Mercury3D::hGridRemoveParticle().
int BaseParticle::getHGridX | ( | ) | const |
Returns particle's HGrid cell X-coordinate.
Get the particle's HGrid cell's X-coordinate
Definition at line 305 of file BaseParticle.cc.
References HGridX_.
Referenced by Mercury2D::hGridFindContactsWithinTargetCell(), Mercury3D::hGridFindContactsWithinTargetCell(), Mercury2D::hGridFindContactsWithTargetCell(), Mercury3D::hGridFindContactsWithTargetCell(), Mercury3D::hGridFindOneSidedContacts(), Mercury2D::hGridFindOneSidedContacts(), Mercury3D::hGridHasContactsInTargetCell(), Mercury3D::hGridRemoveParticle(), Mercury2D::hGridRemoveParticle(), Mercury3D::hGridUpdateParticle(), and Mercury2D::hGridUpdateParticle().
int BaseParticle::getHGridY | ( | ) | const |
Returns particle's HGrid cell Y-coordinate.
Get the particle's HGrid cell's Y-coordinate
Definition at line 314 of file BaseParticle.cc.
References HGridY_.
Referenced by Mercury2D::hGridFindContactsWithinTargetCell(), Mercury3D::hGridFindContactsWithinTargetCell(), Mercury2D::hGridFindContactsWithTargetCell(), Mercury3D::hGridFindContactsWithTargetCell(), Mercury3D::hGridFindOneSidedContacts(), Mercury2D::hGridFindOneSidedContacts(), Mercury3D::hGridHasContactsInTargetCell(), Mercury3D::hGridRemoveParticle(), Mercury2D::hGridRemoveParticle(), Mercury3D::hGridUpdateParticle(), and Mercury2D::hGridUpdateParticle().
int BaseParticle::getHGridZ | ( | ) | const |
Returns particle's HGrid cell Z-coordinate.
Get the particle's HGrid cell's Z-coordinate
Definition at line 323 of file BaseParticle.cc.
References HGridZ_.
Referenced by Mercury3D::hGridFindContactsWithinTargetCell(), Mercury3D::hGridFindContactsWithTargetCell(), Mercury3D::hGridFindOneSidedContacts(), Mercury3D::hGridHasContactsInTargetCell(), Mercury3D::hGridRemoveParticle(), and Mercury3D::hGridUpdateParticle().
Mdouble BaseParticle::getInertia | ( | ) | const |
Returns the particle's inertia_.
Returns the particle's inertia_
Definition at line 332 of file BaseParticle.cc.
References inertia_.
Referenced by BaseParticle().
Mdouble BaseParticle::getInteractionRadius | ( | ) | const |
Returns the particle's interaction radius, which might be different from radius_ (e.g., when dealing with wet particles)
Calculates the interaction radius of the particle (when it comes to interaction with other particles), including the effect of a possible additional 'interaction distance' besides the 'normal' radius. The interaction radius differs from the radius_, for example, when dealing with wet particles (i.e. particles with an additional liquid layer, which is dealt with in the particle's species).
Definition at line 401 of file BaseParticle.cc.
References BaseSpecies::getInteractionDistance(), BaseInteractable::getSpecies(), and radius_.
Referenced by DPMBase::areInContact(), ParticleHandler::checkExtrema(), DPMBase::checkParticleForInteractionLocal(), DPMBase::checkParticleForInteractionLocalPeriodic(), ParticleHandler::computeLargestParticle(), ParticleHandler::computeSmallestParticle(), LeesEdwardsBoundary::createHorizontalPeriodicParticles(), ShearBoxBoundary::createHorizontalPeriodicParticles(), CircularPeriodicBoundary::createPeriodicParticles(), MaserBoundary::createPeriodicParticles(), AngledPeriodicBoundary::createPeriodicParticles(), PeriodicBoundary::createPeriodicParticles(), ShearBoxBoundary::createVerticalPeriodicParticles(), LeesEdwardsBoundary::createVerticalPeriodicParticles(), IntersectionOfWalls::getDistanceAndNormal(), MercuryBase::getHGridTargetMaxInteractionRadius(), MercuryBase::getHGridTargetMinInteractionRadius(), getInteractionWith(), Mercury3D::hGridFindOneSidedContacts(), Mercury2D::hGridFindOneSidedContacts(), Mercury2D::hGridHasParticleContacts(), MercuryBase::hGridNeedsRebuilding(), HGridOptimiser::initialise(), and HGrid::insertParticleToHgrid().
|
virtual |
Checks if particle is in interaction with given particle P, and if so, returns pointer to the associated BaseInteraction object (else returns 0).
Creates/updates a BaseInteraction object, treating the interaction between this particle and a given one, in case there is an overlap between the two.
[in] | P | particle to check the interaction with |
[in] | timeStamp | time stamp to be assigned to the interaction object (i.e., the current time) |
[in,out] | interactionHandler | BaseInteraction container from where the interaction is retrieved, and to which it is assigned (if it is a new interaction). |
Implements BaseInteractable.
Definition at line 717 of file BaseParticle.cc.
References InteractionHandler::getInteraction(), getInteractionRadius(), Vec3D::getLengthSquared(), BaseInteraction::getNormal(), BaseInteraction::getOverlap(), BaseInteractable::getPosition(), getRadius(), BaseInteraction::setContactPoint(), BaseInteraction::setDistance(), BaseInteraction::setNormal(), and BaseInteraction::setOverlap().
Referenced by DPMBase::computeInternalForces(), and FileReader::read().
Mdouble BaseParticle::getInvInertia | ( | ) | const |
Returns the particle's invInertia_.
Returns the particle's inverse inertia_
Definition at line 341 of file BaseParticle.cc.
References invInertia_.
Referenced by BaseParticle(), integrateAfterForceComputation(), and integrateBeforeForceComputation().
Mdouble BaseParticle::getInvMass | ( | ) | const |
Returns the particle's invMass_.
Returns the particle's inverse mass_
Definition at line 350 of file BaseParticle.cc.
References invMass_.
Referenced by BaseParticle(), ThermalInteraction< NormalForceInteraction >::computeNormalForce(), integrateAfterForceComputation(), and integrateBeforeForceComputation().
Mdouble BaseParticle::getKineticEnergy | ( | ) | const |
Calculates the particle's kinetic energy.
Calculates the particle's kinetic energy
Definition at line 359 of file BaseParticle.cc.
References Vec3D::getLengthSquared(), BaseInteractable::getVelocity(), and mass_.
Mdouble BaseParticle::getMass | ( | ) | const |
Returns the particle's mass_.
Returns the mass_ of the particle
Definition at line 368 of file BaseParticle.cc.
References mass_.
Referenced by BaseParticle(), DPMBase::computeExternalForces(), ParticleSpecies::computeMass(), and BaseInteraction::getEffectiveMass().
|
virtual |
Returns the name of the object.
Returns the name of the object; in this case 'BaseParticle'.
Implements BaseObject.
Reimplemented in LiquidFilmParticle, and ThermalParticle.
Definition at line 194 of file BaseParticle.cc.
Referenced by InsertionBoundary::write().
|
virtual |
Reimplemented in LiquidFilmParticle.
Definition at line 860 of file BaseParticle.cc.
Referenced by ParticleHandler::writeVTK().
|
virtual |
Reimplemented in LiquidFilmParticle.
Definition at line 852 of file BaseParticle.cc.
Referenced by ParticleHandler::writeVTK().
unsigned int BaseParticle::getParticleDimensions | ( | ) | const |
Returns the particle's dimensions (either 2 or 3).
Returns the amount of dimensions of the particle (2 or 3, basically)
Definition at line 801 of file BaseParticle.cc.
References BaseHandler< T >::getDPMBase(), getHandler(), and DPMBase::getParticleDimensions().
Referenced by ParticleSpecies::computeMass(), and getVolume().
BaseParticle * BaseParticle::getPeriodicFromParticle | ( | ) | const |
Returns the 'original' particle this one's a periodic copy of.
Returns a pointer to the 'original' particle if the current one is a 'periodic copy' used for a periodic boundary implementation.
Definition at line 378 of file BaseParticle.cc.
References periodicFromParticle_.
Referenced by DPMBase::computeForcesDueToWalls(), DPMBase::computeInternalForces(), LeesEdwardsBoundary::createHorizontalPeriodicParticles(), ShearBoxBoundary::createHorizontalPeriodicParticles(), CircularPeriodicBoundary::createPeriodicParticles(), MaserBoundary::createPeriodicParticles(), AngledPeriodicBoundary::createPeriodicParticles(), PeriodicBoundary::createPeriodicParticles(), ShearBoxBoundary::createVerticalPeriodicParticles(), LeesEdwardsBoundary::createVerticalPeriodicParticles(), LiquidMigrationWilletInteraction::form(), BaseInteraction::gatherContactStatistics(), DPMBase::removeDuplicatePeriodicParticles(), InteractionHandler::removeObjectKeepingPeriodics(), and BaseInteraction::writeToFStat().
const Vec3D & BaseParticle::getPreviousPosition | ( | ) | const |
Returns the particle's position in the previous time step.
Returns the particle's position in the previous time step.
Definition at line 430 of file BaseParticle.cc.
References previousPosition_.
Referenced by getDisplacement2().
Mdouble BaseParticle::getRadius | ( | ) | const |
Returns the particle's radius_.
Returns the particle's radius
Definition at line 387 of file BaseParticle.cc.
References radius_.
Referenced by ParticleSpecies::computeMass(), Chute::createBottom(), BaseInteraction::gatherContactStatistics(), ChuteInsertionBoundary::generateParticle(), HopperInsertionBoundary::generateParticle(), CylindricalWall::getDistanceAndNormal(), InfiniteWallWithHole::getDistanceAndNormal(), BaseInteraction::getEffectiveCorrectedRadius(), BaseInteraction::getEffectiveRadius(), TriangulatedWall::getInteractionWith(), BaseWall::getInteractionWith(), getInteractionWith(), FileReader::read(), ChuteBottom::setupInitialConditions(), DPMBase::writeFstatHeader(), and BaseInteraction::writeToFStat().
|
virtual |
Reimplemented in LiquidFilmParticle.
Definition at line 856 of file BaseParticle.cc.
Referenced by ParticleHandler::writeVTK().
Mdouble BaseParticle::getVolume | ( | ) | const |
Get Particle volume function, which required a reference to the Species vector. It returns the volume of the Particle.
Returns the volume of the BaseParticle, which is calculated using its number of dimensions and radius.
Definition at line 122 of file BaseParticle.cc.
References ERROR, getParticleDimensions(), handler_, logger, constants::pi, and radius_.
Mdouble BaseParticle::getWallInteractionRadius | ( | ) | const |
Returns the interaction radius for interaction with walls. See also BaseParticle::getInteractionRadius().
The interaction radius of the particle (when it comes to interaction with walls). See also BaseParticle::getInteractionRadius().
Definition at line 411 of file BaseParticle.cc.
References BaseSpecies::getInteractionDistance(), BaseInteractable::getSpecies(), and radius_.
Referenced by Screw::getDistanceAndNormal(), TriangulatedWall::Face::getDistanceAndNormal(), Coil::getDistanceAndNormal(), RestrictedWall::getDistanceAndNormal(), SphericalWall::getDistanceAndNormal(), AxisymmetricIntersectionOfWalls::getDistanceAndNormal(), and InfiniteWall::getDistanceAndNormal().
void BaseParticle::integrateAfterForceComputation | ( | double | time, |
double | timeStep | ||
) |
Second step of Velocity Verlet integration.
Second step of Velocity Verlet integration (see also http://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet).
[in] | time | current time |
[in] | timeStep | current time step |
Definition at line 781 of file BaseParticle.cc.
References accelerate(), angularAccelerate(), BaseInteractable::getForce(), getHandler(), getInvInertia(), getInvMass(), BaseInteractable::getTorque(), and BaseInteractable::integrateAfterForceComputation().
void BaseParticle::integrateBeforeForceComputation | ( | double | time, |
double | timeStep | ||
) |
First step of Velocity Verlet integration.
First step of Velocity Verlet integration (see also http://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet).
[in] | time | current time |
[in] | timeStep | current time step |
Definition at line 751 of file BaseParticle.cc.
References accelerate(), angularAccelerate(), BaseInteractable::getAngularVelocity(), getDisplacement(), BaseHandler< T >::getDPMBase(), BaseInteractable::getForce(), getHandler(), getInvInertia(), getInvMass(), BaseInteractable::getTorque(), BaseInteractable::getVelocity(), DPMBase::hGridUpdateMove(), BaseInteractable::integrateBeforeForceComputation(), BaseInteractable::move(), BaseInteractable::rotate(), and setDisplacement().
bool BaseParticle::isFixed | ( | ) | const |
Is fixed Particle function. It returns whether a Particle is fixed or not, by checking its inverse Mass.
Checks whether a BaseParticle is fixed or not, by checking its inverse Mass.
Definition at line 160 of file BaseParticle.cc.
References invMass_.
Referenced by DPMBase::computeExternalForces(), DPMBase::computeInternalForces(), ParticleSpecies::computeMass(), BaseInteraction::gatherContactStatistics(), and BaseInteraction::writeToFStat().
void BaseParticle::movePrevious | ( | const Vec3D & | posMove | ) |
Adds a vector to the particle's previousPosition_.
Lets you add a vector to the particle's previousPosition_ vector.
[in] | posMove | the vector to be added to the current previousPosition_ vector. |
Definition at line 652 of file BaseParticle.cc.
References previousPosition_.
|
virtual |
deprecated version of the read function.
This is the previously used version of the read function. Now just kept for legacy purposes.
Definition at line 227 of file BaseParticle.cc.
References inertia_, invInertia_, invMass_, mass_, setIndSpecies(), BaseInteractable::setOrientation(), and BaseInteractable::setPosition().
Referenced by ParticleHandler::readObject().
void BaseParticle::printHGrid | ( | std::ostream & | os | ) | const |
Adds particle's HGrid level and cell coordinates to an ostream.
Adds the particle's HGridLevel_ and HGRid x/y/z positions to an std::ostream.
[in,out] | os | the ostream which has the mentioned properties added. |
Definition at line 253 of file BaseParticle.cc.
References HGridLevel_, HGridX_, HGridY_, and HGridZ_.
|
virtual |
Particle read function, which accepts an std::istream as input.
Particle read function. Has an std::istream as argument, from which it extracts the radius_, invMass_ and invInertia_, respectively. From these the mass_ and inertia_ are deduced. An additional set of properties is read through the call to the parent's method BaseInteractable::read().
[in,out] | is | input stream with particle properties. |
Implements BaseInteractable.
Reimplemented in LiquidFilmParticle, and ThermalParticle.
Definition at line 207 of file BaseParticle.cc.
References inertia_, invInertia_, invMass_, mass_, radius_, and BaseInteractable::read().
Referenced by LiquidFilmParticle::read(), and ThermalParticle::read().
void BaseParticle::setDisplacement | ( | const Vec3D & | disp | ) |
Sets the particle's displacement (= difference between current position and that of the previous time step)
This is used to set the particle displacement_
[in] | disp | the displacement vector |
Definition at line 633 of file BaseParticle.cc.
References displacement_.
Referenced by CircularPeriodicBoundary::checkBoundaryAfterParticleMoved(), and integrateBeforeForceComputation().
void BaseParticle::setHandler | ( | ParticleHandler * | handler | ) |
Sets the pointer to the particle's ParticleHandler.
Assigns the particle to a ParticleHandler, and assigns a species to it based on the particles indSpecies_ (BaseInteractable data member).
[in] | handler | pointer to the ParticleHandler |
Definition at line 691 of file BaseParticle.cc.
References getHandler(), BaseInteractable::getIndSpecies(), BaseHandler< T >::getObject(), handler_, and setSpecies().
Referenced by ParticleHandler::addObject(), Chute::createBottom(), ParticleHandler::readObject(), setSpecies(), and ChuteBottom::setupInitialConditions().
void BaseParticle::setHGridLevel | ( | const unsigned int | level | ) |
Sets the particle's HGrid level.
Sets the particle's HGridLevel_
[in] | level | the particle's HGridLevel_ |
Definition at line 536 of file BaseParticle.cc.
References HGridLevel_.
Referenced by HGrid::insertParticleToHgrid().
void BaseParticle::setHGridNextObject | ( | BaseParticle * | p | ) |
Sets the pointer to the next object in the particle's HGrid cell & level.
Sets the pointer to the next object in the particle's HGrid cell
[in] | p | pointer to the next object |
Definition at line 545 of file BaseParticle.cc.
References HGridNextObject_.
Referenced by Mercury2D::hGridRemoveParticle(), Mercury3D::hGridRemoveParticle(), Mercury3D::hGridUpdateParticle(), and Mercury2D::hGridUpdateParticle().
void BaseParticle::setHGridPrevObject | ( | BaseParticle * | p | ) |
Sets the pointer to the previous object in the particle's HGrid cell & level.
Sets the pointer to the previous object in the particle's HGrid cell
[in] | p | pointer to the previous object |
Definition at line 554 of file BaseParticle.cc.
References HGridPrevObject_.
Referenced by Mercury2D::hGridRemoveParticle(), Mercury3D::hGridRemoveParticle(), Mercury3D::hGridUpdateParticle(), and Mercury2D::hGridUpdateParticle().
void BaseParticle::setHGridX | ( | const int | x | ) |
Sets the particle's HGrid cell X-coordinate.
Set the x-index of the particle's HGrid cell position
[in] | x | x-index of particle's HGrid cell |
Definition at line 509 of file BaseParticle.cc.
References HGridX_.
Referenced by Mercury2D::hGridUpdateParticle(), and Mercury3D::hGridUpdateParticle().
void BaseParticle::setHGridY | ( | const int | y | ) |
Sets the particle's HGrid cell Y-coordinate.
Set the y-index of the particle's HGrid cell position
[in] | y | y-index of particle's HGrid cell |
Definition at line 518 of file BaseParticle.cc.
References HGridY_.
Referenced by Mercury2D::hGridUpdateParticle(), and Mercury3D::hGridUpdateParticle().
void BaseParticle::setHGridZ | ( | const int | z | ) |
Sets the particle's HGrid cell Z-coordinate.
Set the z-index of the particle's HGrid cell position
[in] | z | z-index of particle's HGrid cell |
Definition at line 527 of file BaseParticle.cc.
References HGridZ_.
Referenced by Mercury3D::hGridUpdateParticle().
|
virtual |
Set the particle's species and species' index. Logs a warning if no ParticleHandler is assigned.
[in] | indSpecies | The index of the species in the SpeciesHandler. |
Reimplemented from BaseInteractable.
Definition at line 811 of file BaseParticle.cc.
References ERROR, BaseHandler< T >::getDPMBase(), BaseObject::getId(), BaseHandler< T >::getObject(), handler_, logger, BaseInteractable::setIndSpecies(), setSpecies(), and DPMBase::speciesHandler.
Referenced by oldRead().
void BaseParticle::setInertia | ( | const Mdouble | newInertia | ) |
Sets the particle's inertia_ (and adjusts invInertia_ accordingly)
Sets the particle's inertia_ and invInertia_.
[in] | newInertia | the new inertia_ to be set. |
Definition at line 471 of file BaseParticle.cc.
References ERROR, inertia_, invInertia_, and logger.
void BaseParticle::setInfiniteInertia | ( | ) |
Sets the particle's inertia_ to 'infinite' (1e20) and its invInertia_ to 0.
Sets the inertia_ to 1e20 and the invInertia_ (which is actually used in the calculations) to 0.
Definition at line 488 of file BaseParticle.cc.
References inertia_, and invInertia_.
void BaseParticle::setMass | ( | const Mdouble | mass | ) |
Sets the particle's mass.
Sets the mass_ of the particle
[in] | mass | the new particle's mass |
Definition at line 590 of file BaseParticle.cc.
References ERROR, invMass_, logger, mass_, and WARN.
void BaseParticle::setMassForP3Statistics | ( | const Mdouble | mass | ) |
Sets the particle's mass This function should not be used, but is necessary to extend the CG toolbox to non-spherical particles.
Sets the mass_ of the particle
[in] | mass | the new particle's mass |
Definition at line 613 of file BaseParticle.cc.
References ERROR, invMass_, logger, and mass_.
void BaseParticle::setPeriodicFromParticle | ( | BaseParticle * | p | ) |
Assigns the pointer to the 'original' particle this one's a periodic copy of.
Lets you set which particle this one is actually a periodic copy of (used in periodic boundary condition implementations).
[in] | p | pointer to the 'original' particle this one is a periodic copy of. |
Definition at line 500 of file BaseParticle.cc.
References periodicFromParticle_.
Referenced by LeesEdwardsBoundary::createHorizontalPeriodicParticles(), ShearBoxBoundary::createHorizontalPeriodicParticles(), CircularPeriodicBoundary::createPeriodicParticles(), MaserBoundary::createPeriodicParticles(), AngledPeriodicBoundary::createPeriodicParticles(), PeriodicBoundary::createPeriodicParticles(), LeesEdwardsBoundary::createVerticalPeriodicParticles(), and ShearBoxBoundary::createVerticalPeriodicParticles().
void BaseParticle::setPreviousPosition | ( | const Vec3D & | pos | ) |
Sets the particle's position in the previous time step.
This is used to set the particle's previous position
[in] | pos | the particle's previous position vector. |
Definition at line 642 of file BaseParticle.cc.
References previousPosition_.
void BaseParticle::setRadius | ( | const Mdouble | radius | ) |
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Sets the radius of the particle, and from that computes the new mass (using its species) and checks whether it now is either the smallest or biggest particle in its ParticleHandler.
[in] | radius | the new radius |
Definition at line 576 of file BaseParticle.cc.
References ParticleHandler::checkExtrema(), ParticleSpecies::computeMass(), getHandler(), BaseInteractable::getSpecies(), and radius_.
Referenced by Chute::createBottom(), ChuteInsertionBoundary::generateParticle(), CubeInsertionBoundary::generateParticle(), HopperInsertionBoundary::generateParticle(), helpers::loadingTest(), helpers::normalAndTangentialLoadingTest(), helpers::objectivenessTest(), FileReader::read(), and ChuteBottom::setupInitialConditions().
void BaseParticle::setSpecies | ( | const ParticleSpecies * | species | ) |
In addition to the functionality of BaseInteractable::setSpecies, this function sets the pointer to the particleHandler, which is needed to retrieve species information.
Sets the particle's species. If this particle does not have a handler yet, this function also assigns the ParticleHandler in the same DPMBase as the SpeciesHandler of the given species as its handler.
[in] | species | pointer to the ParticleSpecies object, to be set as the particle's species. |
Definition at line 834 of file BaseParticle.cc.
References BaseHandler< T >::getDPMBase(), BaseSpecies::getHandler(), handler_, DPMBase::particleHandler, setHandler(), and BaseInteractable::setSpecies().
Referenced by MaserBoundary::addParticleToMaser(), MaserBoundary::checkBoundaryAfterParticleMoved(), Chute::createBottom(), helpers::loadingTest(), ChuteBottom::makeRoughBottom(), helpers::normalAndTangentialLoadingTest(), helpers::objectivenessTest(), FileReader::read(), DPMBase::readNextDataFile(), ParticleHandler::readObject(), setHandler(), setIndSpecies(), ChuteBottom::setupInitialConditions(), Chute::setupInitialConditions(), and ChuteWithHopper::setupInitialConditions().
void BaseParticle::unfix | ( | ) |
Unfix Particle function, which required a reference to the Species vector. It unfixes a Particle by computing the Particles mass and inertia.
Unfixes the particle by computing the Particles mass and inertia, using the species and radius.
Definition at line 170 of file BaseParticle.cc.
References ParticleSpecies::computeMass(), BaseInteractable::getSpecies(), and invMass_.
Referenced by DPMBase::readNextDataFile().
|
virtual |
Particle print function, which accepts an std::ostream as input.
BaseParticle print method, which accepts an os std::ostream as input. It prints human readable BaseParticle information to the std::ostream.
[in,out] | os | stream to which the info is written |
Implements BaseInteractable.
Reimplemented in LiquidFilmParticle, and ThermalParticle.
Definition at line 182 of file BaseParticle.cc.
References invInertia_, invMass_, radius_, and BaseInteractable::write().
Referenced by LiquidFilmParticle::write(), and ThermalParticle::write().
|
friend |
Particle's position at previous time step.
Since ParticleSpecies is allowed to set the mass of a BaseParticle, it is a friend of this class.
Definition at line 421 of file BaseParticle.h.
|
private |
Pointer to originating Particle.
Definition at line 413 of file BaseParticle.h.
Referenced by addDisplacement(), BaseParticle(), getDisplacement(), and setDisplacement().
|
private |
Pointer to the particle's ParticleHandler container.
Definition at line 390 of file BaseParticle.h.
Referenced by BaseParticle(), getHandler(), getVolume(), setHandler(), setIndSpecies(), and setSpecies().
|
private |
Cell position in the grid.
Definition at line 401 of file BaseParticle.h.
Referenced by BaseParticle(), getHGridLevel(), printHGrid(), and setHGridLevel().
|
private |
Grid level for the object.
Definition at line 402 of file BaseParticle.h.
Referenced by BaseParticle(), getHGridNextObject(), and setHGridNextObject().
|
private |
Pointer to the next Particle in the same HGrid cell.
Definition at line 403 of file BaseParticle.h.
Referenced by BaseParticle(), getHGridPrevObject(), and setHGridPrevObject().
|
private |
Hgrid attributes.
Definition at line 400 of file BaseParticle.h.
Referenced by BaseParticle(), getHGridX(), printHGrid(), and setHGridX().
|
private |
Definition at line 400 of file BaseParticle.h.
Referenced by BaseParticle(), getHGridY(), printHGrid(), and setHGridY().
|
private |
Definition at line 400 of file BaseParticle.h.
Referenced by BaseParticle(), getHGridZ(), printHGrid(), and setHGridZ().
|
private |
Inverse Particle mass (for computation optimization)
Definition at line 408 of file BaseParticle.h.
Referenced by BaseParticle(), ParticleSpecies::computeMass(), fixParticle(), getInertia(), oldRead(), read(), setInertia(), and setInfiniteInertia().
|
private |
Particle inertia_.
Definition at line 409 of file BaseParticle.h.
Referenced by BaseParticle(), ParticleSpecies::computeMass(), fixParticle(), getInvInertia(), oldRead(), read(), setInertia(), setInfiniteInertia(), and write().
|
private |
Particle mass_.
Definition at line 407 of file BaseParticle.h.
Referenced by BaseParticle(), ParticleSpecies::computeMass(), fixParticle(), getInvMass(), isFixed(), oldRead(), read(), setMass(), setMassForP3Statistics(), unfix(), and write().
|
private |
Pointer to the previous Particle in the same HGrid cell.
Particle attributes
Definition at line 406 of file BaseParticle.h.
Referenced by BaseParticle(), ParticleSpecies::computeMass(), fixParticle(), getKineticEnergy(), getMass(), oldRead(), read(), setMass(), and setMassForP3Statistics().
|
private |
Particle radius_.
Definition at line 411 of file BaseParticle.h.
Referenced by BaseParticle(), getPeriodicFromParticle(), and setPeriodicFromParticle().
|
private |
Displacement (only used in StatisticsVector, StatisticsPoint)
Definition at line 414 of file BaseParticle.h.
Referenced by getPreviousPosition(), movePrevious(), and setPreviousPosition().
|
private |
Inverse Particle inverse inertia (for computation optimization)
Definition at line 410 of file BaseParticle.h.
Referenced by BaseParticle(), getInteractionRadius(), getRadius(), getVolume(), getWallInteractionRadius(), read(), setRadius(), and write().