MercuryDPM
Beta
|
Defines the basic properties that a interactable object can have. More...
#include <BaseInteractable.h>
Public Member Functions | |
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... | |
virtual void | read (std::istream &is)=0 |
Reads a BaseInteractable from an input stream. More... | |
virtual void | write (std::ostream &os) const =0 |
Write a BaseInteractable to an output stream. More... | |
unsigned int | getIndSpecies () const |
Returns the index of the Species of this BaseInteractable. More... | |
virtual void | setIndSpecies (unsigned int indSpecies) |
Sets 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 (Vec3D force) |
Sets the force on this BaseInteractable. More... | |
void | setTorque (Vec3D torque) |
Sets the torque on this BaseInteractable. More... | |
void | addForce (Vec3D addForce) |
Adds an amount to the force on this BaseInteractable. More... | |
void | addTorque (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 (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 (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 (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 (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 BaseInteraction * | getInteractionWith (BaseParticle *P, Mdouble timeStamp, InteractionHandler *interactionHandler)=0 |
Returns the interaction between this object and a given BaseParticle. 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 std::string | getName () const =0 |
A purely virtual function. 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 | |
std::function< Vec3D(double)> | prescribedPosition_ |
std::function< Vec3D(double)> | prescribedVelocity_ |
std::function< Vec3D(double)> | prescribedOrientation_ |
std::function< Vec3D(double)> | prescribedAngularVelocity_ |
Vec3D | position_ |
Vec3D | orientation_ |
Vec3D | angularVelocity_ |
Vec3D | force_ |
Vec3D | torque_ |
const ParticleSpecies * | species_ |
unsigned int | indSpecies_ |
Vec3D | velocity_ |
std::list< BaseInteraction * > | interactions_ |
Defines the basic properties that a interactable object can have.
Inherits from class BaseObject (public) Also it includes a lot of code to deal with interactable objects that have a prescibed motion. Most of the code in here is MercuryDPM internal. The only place an user will interface with this code is for setting the lambda functions that prescribe the motion of infinite mass particles.
Definition at line 50 of file BaseInteractable.h.
BaseInteractable::BaseInteractable | ( | ) |
Default BaseInteractable constructor, it simply creates an empty BaseInteractable.
Sets all vectors to zero and all point to nullptr.
Definition at line 38 of file BaseInteractable.cc.
References angularVelocity_, force_, indSpecies_, orientation_, position_, prescribedPosition_, prescribedVelocity_, Vec3D::setZero(), species_, torque_, and velocity_.
BaseInteractable::BaseInteractable | ( | const BaseInteractable & | p | ) |
Copy constructor. It copies the BaseInteractable and all objects it contains.
Note, this does not copy interactions of a interactable. As these often require extra work. All the other properties are copied normally. Please use this copy with care.
Definition at line 61 of file BaseInteractable.cc.
References angularVelocity_, force_, indSpecies_, interactions_, orientation_, position_, prescribedPosition_, prescribedVelocity_, species_, torque_, and velocity_.
|
virtual |
Destructor, it simply destructs the BaseInteractable and all the objects it contains.
Removes all the interactions from the interactable.
Definition at line 83 of file BaseInteractable.cc.
References interactions_.
void BaseInteractable::addAngularVelocity | ( | const Vec3D & | angularVelocity | ) |
add an increment to the angular velocity.
See also BaseInteractable::setAngularVelocity
[in] | angularVelocity | increment which to increase the angularVelocity by. |
Definition at line 433 of file BaseInteractable.cc.
References angularVelocity_.
Referenced by BaseParticle::angularAccelerate().
void BaseInteractable::addForce | ( | Vec3D | addForce | ) |
Adds an amount to the force on this BaseInteractable.
Incremental version of BaseInteractable::setForce. Also see BaseInteraction::setForce for were this is used.
[in] | addForce | Vec3D incremental force which is added to the total force of the interactable. |
Definition at line 199 of file BaseInteractable.cc.
References force_.
Referenced by DPMBase::computeExternalForces(), DPMBase::computeForcesDueToWalls(), and DPMBase::computeInternalForces().
void BaseInteractable::addInteraction | ( | BaseInteraction * | I | ) |
Adds an interaction to this BaseInteractable.
Added a new interactions to the current interactable.
[in] | I | Pointer to the new interaction which is to be added to the list of interactions of this interactable. |
Definition at line 345 of file BaseInteractable.cc.
References interactions_.
Referenced by BaseInteraction::BaseInteraction(), BaseInteraction::copySwitchPointer(), BaseInteraction::setI(), and BaseInteraction::setP().
void BaseInteractable::addTorque | ( | Vec3D | addTorque | ) |
Adds an amount to the torque on this BaseInteractable.
Incremental version of BaseInteractable::setTorque. Also see BaseInteraction::setTorque for were this is used.
[in] | addTorque | Vec3D incremental force which is added to the total torque of the interactable. |
Definition at line 210 of file BaseInteractable.cc.
References torque_.
Referenced by DPMBase::computeForcesDueToWalls(), and DPMBase::computeInternalForces().
void BaseInteractable::addVelocity | ( | const Vec3D & | velocity | ) |
adds an increment to the velocity.
See also BaseInteractable::setVelocity
[in] | velocity | Vec3D containing the velocity increment which to increase the velocity by. |
Definition at line 423 of file BaseInteractable.cc.
References velocity_.
Referenced by BaseParticle::accelerate(), and LeesEdwardsBoundary::shiftVerticalPosition().
void BaseInteractable::applyPrescribedAngularVelocity | ( | double | time | ) |
Computes the angular velocity from the user defined prescribed angular velocity.
This calls the prescribedAngularVelocity function if one has been defined. See also BaseInteractable::setPrescribedAngularVelocity
[in] | time | double which is the current time of the simulation. |
Definition at line 574 of file BaseInteractable.cc.
References prescribedAngularVelocity_, and setAngularVelocity().
Referenced by integrateAfterForceComputation(), and integrateBeforeForceComputation().
void BaseInteractable::applyPrescribedOrientation | ( | double | time | ) |
Computes the orientation from the user defined prescribed orientation function.
This calls the prescribedOrientation function if one has been defined. See also BaseInteractable::setPrescribedOrientation
[in] | time | double which is the current time of the simulation. |
Definition at line 547 of file BaseInteractable.cc.
References prescribedOrientation_, and setOrientation().
Referenced by integrateBeforeForceComputation().
void BaseInteractable::applyPrescribedPosition | ( | double | time | ) |
Computes the position from the user defined prescribed position function.
This calls the prescribedPosition function if one has been defined. See also BaseInteractable::setPrescribedPosition
[in] | time | double which is the current time of the simulation. |
Definition at line 485 of file BaseInteractable.cc.
References prescribedPosition_, and setPosition().
Referenced by integrateBeforeForceComputation().
void BaseInteractable::applyPrescribedVelocity | ( | double | time | ) |
Computes the velocity from the user defined prescribed velocity function.
This calls the prescribedVeclocity function if one has been defined. See also BaseInteractable::setPrescribedVelocity
[in] | time | double which is the current time of the simulation. |
Definition at line 516 of file BaseInteractable.cc.
References prescribedVelocity_, and setVelocity().
Referenced by integrateAfterForceComputation(), and integrateBeforeForceComputation().
void BaseInteractable::copyInteractionsForPeriodicParticles | ( | const BaseInteractable & | pOriginal | ) |
Copies interactions to this BaseInteractable whenever a periodic copy made.
This loops over all interactions of periodic (particle) and calls copySwitchPointer, which copies the interactions.
[in] | pOriginal | Reference to the BaseInteractable which is to be copied to create the ghost particles. |
Definition at line 448 of file BaseInteractable.cc.
References interactions_.
Referenced by LeesEdwardsBoundary::createHorizontalPeriodicParticles(), MaserBoundary::createPeriodicParticles(), AngledPeriodicBoundary::createPeriodicParticles(), PeriodicBoundary::createPeriodicParticles(), and LeesEdwardsBoundary::createVerticalPeriodicParticles().
|
virtual |
Returns the angular velocity of this interactable.
Returns the angular velocity of the BaseInteractbale. Note, this is the same for all BaseInteractables; it is the direction the object is moving in.
Definition at line 394 of file BaseInteractable.cc.
References angularVelocity_.
Referenced by getVelocityAtContact(), integrateBeforeForceComputation(), BaseParticle::integrateBeforeForceComputation(), and AngledPeriodicBoundary::shiftPosition().
const Vec3D & BaseInteractable::getForce | ( | ) | const |
Returns the force on this BaseInteractable.
Return the current force being to the BaseInteractable. Note, the code works by first computing the forces of each interaction and then it loops over all BaseInteracables applying forces to them from the interactions they are involved in.
Definition at line 150 of file BaseInteractable.cc.
References force_.
Referenced by BaseParticle::integrateAfterForceComputation(), and BaseParticle::integrateBeforeForceComputation().
unsigned int BaseInteractable::getIndSpecies | ( | ) | const |
Returns the index of the Species of this BaseInteractable.
Returns the unsigned int to the index of the species associated with the interactable object.
Definition at line 100 of file BaseInteractable.cc.
References indSpecies_.
Referenced by InteractionHandler::getInteraction(), BaseWall::setHandler(), BaseParticle::setHandler(), and BaseWall::setIndSpecies().
const std::list< BaseInteraction * > & BaseInteractable::getInteractions | ( | ) | const |
Returns a reference to the list of interactions in this BaseInteractable.
Returns a list of interactions which belong to this interactable.
Definition at line 335 of file BaseInteractable.cc.
References interactions_.
Referenced by InteractionHandler::getExistingInteraction(), DPMBase::removeDuplicatePeriodicParticles(), and AngledPeriodicBoundary::shiftPosition().
|
pure virtual |
Returns the interaction between this object and a given BaseParticle.
TW make sure this function sets normal, distance, overlap, contact point
AT why is this a BaseParticle and not a BaseInteratable.
Implemented in BaseParticle, IntersectionOfWalls, InfiniteWall, InfiniteWallWithHole, CylindricalWall, Screw, AxisymmetricIntersectionOfWalls, and Coil.
const Vec3D & BaseInteractable::getOrientation | ( | ) | const |
Returns the orientation of this BaseInteractable.
Returns the reference to a Vec3D which contains the orientation of the interactionable. Please note the interpretation of this depends on which interactable. Please see derived objects for details.
Definition at line 239 of file BaseInteractable.cc.
References orientation_.
Referenced by AxisymmetricIntersectionOfWalls::getDistanceAndNormal(), and AngledPeriodicBoundary::shiftPosition().
const Vec3D & BaseInteractable::getPosition | ( | ) | const |
Returns the position of this BaseInteractable.
Returns the reference to a Vec3D which contains the position of the interactionable. Please note the interpretation of this depends on which interactable. For particles this is the centre of the particle; where for walls it is one point of the wall given \(r.n=p\)
Definition at line 224 of file BaseInteractable.cc.
References position_.
Referenced by IntersectionOfWalls::addObject(), DPMBase::areInContact(), DeletionBoundary::checkBoundaryAfterParticleMoved(), CircularPeriodicBoundary::checkBoundaryAfterParticleMoved(), DPMBase::checkParticleForInteraction(), Chute::cleanChute(), DPMBase::computeForcesDueToWalls(), DPMBase::computeInternalForces(), CircularPeriodicBoundary::createPeriodicParticles(), AngledPeriodicBoundary::distance(), BaseInteraction::gatherContactStatistics(), BaseParticle::getDisplacement2(), MaserBoundary::getDistance(), PeriodicBoundary::getDistance(), InfiniteWall::getDistance(), Screw::getDistanceAndNormal(), CylindricalWall::getDistanceAndNormal(), AxisymmetricIntersectionOfWalls::getDistanceAndNormal(), Coil::getDistanceAndNormal(), InfiniteWallWithHole::getDistanceAndNormal(), InfiniteWall::getDistanceAndNormal(), IntersectionOfWalls::getDistanceAndNormal(), LeesEdwardsBoundary::getHorizontalDistance(), Coil::getInteractionWith(), AxisymmetricIntersectionOfWalls::getInteractionWith(), Screw::getInteractionWith(), CylindricalWall::getInteractionWith(), InfiniteWallWithHole::getInteractionWith(), InfiniteWall::getInteractionWith(), IntersectionOfWalls::getInteractionWith(), BaseParticle::getInteractionWith(), getVelocityAtContact(), LeesEdwardsBoundary::getVerticalDistance(), Mercury2D::hGridFindOneSidedContacts(), Mercury3D::hGridFindOneSidedContacts(), Mercury2D::hGridHasParticleContacts(), Mercury3D::hGridUpdateParticle(), Mercury2D::hGridUpdateParticle(), CircularPeriodicBoundary::rotateParticle(), AngledPeriodicBoundary::shiftPosition(), and BaseInteraction::writeToFStat().
const ParticleSpecies * BaseInteractable::getSpecies | ( | ) | const |
Returns a pointer to the species of this BaseInteractable.
This function return a ParticleSpecies* for the current interacable. Please note, this is a ParticleSpecies; not, a BaseSpecies as interactables must have physically properties as well.
Definition at line 123 of file BaseInteractable.cc.
References species_.
Referenced by ParticleHandler::addObject(), MaserBoundary::addParticleToMaser(), MaserBoundary::checkBoundaryAfterParticleMoved(), MaserBoundary::createPeriodicParticles(), DPMBase::getInfo(), BaseParticle::getInteractionRadius(), BaseParticle::getWallInteractionRadius(), BaseParticle::setRadius(), and BaseParticle::unfix().
const Vec3D & BaseInteractable::getTorque | ( | ) | const |
Returns the torque on this BaseInteractable.
Return the current torque being to the BaseInteractable. Note, the code works by first computing the forces of each interaction and then it loops over all BaseInteracables applying forces to them from the interactions they are involved in.
Definition at line 163 of file BaseInteractable.cc.
References torque_.
Referenced by BaseParticle::integrateAfterForceComputation(), and BaseParticle::integrateBeforeForceComputation().
|
virtual |
Returns the velocity of this interactable.
Returns the velocity of the BaseInteractbale. Note, this is the same for all BaseInteractables; it is the direction the object is moving in.
Definition at line 382 of file BaseInteractable.cc.
References velocity_.
Referenced by BaseParticle::getKineticEnergy(), getVelocityAtContact(), integrateBeforeForceComputation(), BaseParticle::integrateBeforeForceComputation(), InfiniteWallWithHole::move_time(), CircularPeriodicBoundary::rotateParticle(), and AngledPeriodicBoundary::shiftPosition().
Returns the velocity at the contact point, use by many force laws.
Definition at line 437 of file BaseInteractable.cc.
References Vec3D::cross(), getAngularVelocity(), getPosition(), and getVelocity().
void BaseInteractable::integrateAfterForceComputation | ( | double | time, |
double | timeStep | ||
) |
This is part of the integration routine for objects with infinite mass.
This is the last part of time integration for interactable objects which have an infinite mass.
[in] | time | double which is the current simulation time |
[in] | timeStep | double which is the current delta time of the simulation i.e. the size of each time step. |
Definition at line 669 of file BaseInteractable.cc.
References applyPrescribedAngularVelocity(), applyPrescribedVelocity(), prescribedAngularVelocity_, prescribedOrientation_, prescribedPosition_, prescribedVelocity_, setAngularVelocity(), and setVelocity().
Referenced by BaseParticle::integrateAfterForceComputation().
void BaseInteractable::integrateBeforeForceComputation | ( | double | time, |
double | timeStep | ||
) |
This is part of integrate routine for objects with infinite mass.
This does not first part of verlet integration but for objects with an infinite mass i.e. there motion is prescribed and not calculated from the applied forces. First it deals with the translation degrees of freedom and then secondly if deals with the angular degrees of freedom. Note, in both cases if the user has prescribed both positions and velocity these are used. If only only position is prescribed the velocity is computed from a finite difference. If only the velocity is prescribed the position is computed from integrating the velocity.
In the weird case they neither is set. The objects computed velocity is used to update its position.
[in] | time | double which is the current simulation time |
[in] | timeStep | double which is the current delta time of the simulation i.e. the size of each time step. |
Definition at line 600 of file BaseInteractable.cc.
References applyPrescribedAngularVelocity(), applyPrescribedOrientation(), applyPrescribedPosition(), applyPrescribedVelocity(), getAngularVelocity(), getVelocity(), move(), prescribedAngularVelocity_, prescribedOrientation_, prescribedPosition_, prescribedVelocity_, rotate(), setAngularVelocity(), and setVelocity().
Referenced by BaseParticle::integrateBeforeForceComputation().
|
virtual |
Moves this BaseInteractable by adding an amount to the position.
Moves (displaces) the interacable a given distance. Note, this just updates the position by the move.
[in] | move | Reference to Vec3D which is the distance to move the interactable. |
Reimplemented in IntersectionOfWalls.
Definition at line 274 of file BaseInteractable.cc.
References position_.
Referenced by HopperInsertionBoundary::generateParticle(), integrateBeforeForceComputation(), BaseParticle::integrateBeforeForceComputation(), IntersectionOfWalls::move(), LeesEdwardsBoundary::shiftHorizontalPosition(), AngledPeriodicBoundary::shiftPosition(), MaserBoundary::shiftPosition(), PeriodicBoundary::shiftPosition(), and LeesEdwardsBoundary::shiftVerticalPosition().
|
pure virtual |
Reads a BaseInteractable from an input stream.
BaseInteacatable read functions. Reads in all the information about an interacatable. Note, this can be from any istream but would normally be a file See also BaseInteractable::write
[in] | is | std::istream to which the information is read from. |
Implements BaseObject.
Implemented in IntersectionOfWalls, InfiniteWallWithHole, InfiniteWall, BaseParticle, Coil, AxisymmetricIntersectionOfWalls, Screw, CylindricalWall, and BaseWall.
Definition at line 297 of file BaseInteractable.cc.
References angularVelocity_, force_, indSpecies_, orientation_, position_, BaseObject::read(), torque_, and velocity_.
Referenced by BaseWall::read(), and BaseParticle::read().
bool BaseInteractable::removeInteraction | ( | BaseInteraction * | I | ) |
Removes an interaction from this BaseInteractable.
Removes a given interaction form the list of interactions belonging to the current interacable. This functions returns true to the interaction was found and returns false if the given interaction did not exist and the interaction was not removed.
[in] | I | BaseInteraction pointer which is the interaction to be removed. |
Definition at line 360 of file BaseInteractable.cc.
References interactions_.
Referenced by BaseInteraction::setI(), BaseInteraction::setP(), and BaseInteraction::~BaseInteraction().
void BaseInteractable::rotate | ( | const Vec3D & | rotate | ) |
Rotates this BaseInteractable.
Rotates the interacable a given solid angle. Note, this just updates the orientation by the angle.
[in] | rotate | Reference to Vec3D which is the solid angle through which the interactable is rotated. |
Definition at line 285 of file BaseInteractable.cc.
References orientation_.
Referenced by integrateBeforeForceComputation(), BaseParticle::integrateBeforeForceComputation(), and AngledPeriodicBoundary::shiftPosition().
void BaseInteractable::setAngularVelocity | ( | const Vec3D & | angularVelocity | ) |
set the angular velocity of the BaseInteractble.
See also BaseInteractable::getAngularVelocity
[in] | angularVelocity | Vec3D which is the angularVelocity of the interactable. |
Definition at line 413 of file BaseInteractable.cc.
References angularVelocity_.
Referenced by applyPrescribedAngularVelocity(), BaseParticle::fixParticle(), integrateAfterForceComputation(), integrateBeforeForceComputation(), and ChuteBottom::setupInitialConditions().
void BaseInteractable::setForce | ( | Vec3D | force | ) |
Sets the force on this BaseInteractable.
This sets the force being applied to this interactable. Note, first the code computes all forces in the interactions and then loops over all interactable objects applying the forces from the interactions to the interactables involved in the interaction.
[in] | force | Vec3D which is the force to be applied. |
Definition at line 175 of file BaseInteractable.cc.
References force_.
|
virtual |
Sets the index of the Species of this BaseInteractable.
This set the species associated with this interactable. This function should not be used and BaseInteractable::setSpecies should be used instead. See also BaseInteractable::setSpecies
Reimplemented in BaseParticle, and BaseWall.
Definition at line 111 of file BaseInteractable.cc.
References indSpecies_.
Referenced by BaseWall::setIndSpecies(), and BaseParticle::setIndSpecies().
void BaseInteractable::setOrientation | ( | const Vec3D & | orientation | ) |
Sets the orientation of this BaseInteractable.
Sets the orientation of the interactable. interpretation depends on which interactable is being considered See also BaseInteractable::getOrientation.
[in] | orientation | Reference to Vec3D storing the orientation of the particle. |
Definition at line 263 of file BaseInteractable.cc.
References orientation_.
Referenced by applyPrescribedOrientation(), BaseParticle::oldRead(), and ChuteBottom::setupInitialConditions().
void BaseInteractable::setPosition | ( | const Vec3D & | position | ) |
Sets the position of this BaseInteractable.
Sets the positions of the interactable. interpretation depends on which interactable is being considered See also BaseInteractable::getPosistion.
[in] | position | Reference to Vec3D storing the position of the particle. |
Definition at line 250 of file BaseInteractable.cc.
References position_.
Referenced by applyPrescribedPosition(), Chute::createBottom(), ChuteInsertionBoundary::generateParticle(), CubeInsertionBoundary::generateParticle(), HopperInsertionBoundary::generateParticle(), InfiniteWall::move(), BaseParticle::oldRead(), InfiniteWall::oldRead(), CircularPeriodicBoundary::rotateParticle(), InfiniteWall::set(), and ChuteBottom::setupInitialConditions().
void BaseInteractable::setPrescribedAngularVelocity | ( | std::function< Vec3D(double)> | prescribedAngularVelocity | ) |
Allows the angular velocity of the infinite mass interactable to be prescribed.
Definition at line 563 of file BaseInteractable.cc.
References prescribedAngularVelocity_.
void BaseInteractable::setPrescribedOrientation | ( | std::function< Vec3D(double)> | prescribedOrientation | ) |
Allows the orientation of the infinite mass interactbale to be prescribed.
This is similar to the BaseInteractable::setPrescribedPosition and works the same way. See BaseInteractable::setPrescibedPosition and BaseInteractable::setPrescribedVelocity for more details how it works. Note, the rate of change of the orientation can also be set using the function BaseInteractable::setPrescribedAngularVelocity.
[in] | prescribedOrientation | std::function which is the lambda function and takes a double the time and returns a Vec 3D which is the orientation of the interactable for that time. |
Definition at line 536 of file BaseInteractable.cc.
References prescribedOrientation_.
void BaseInteractable::setPrescribedPosition | ( | std::function< Vec3D(double)> | prescribedPosition | ) |
Allows the position of an infinite mass interactable to be prescribed.
This functions is used to give an interactable a prescribed motion, which is defined by a std::function. This is the new moving walls interface. A demo of the use would be: setPrescribedPosition([this] (double time) { return Vec3D(getXMin(),0.0,shaker_amp * std::sin(t * 2.0 * shaker_freq * constants::pi)); } ); This example moves the wall sinusoidally with time.
[in] | prescribedPosition | std::function which is the lambda function and takes a double the time and returns a Vec 3D which is the position of the interactable for that time. See also BaseInteractable::setPrescribedVelocity for more information. |
Definition at line 475 of file BaseInteractable.cc.
References prescribedPosition_.
void BaseInteractable::setPrescribedVelocity | ( | std::function< Vec3D(double)> | prescribedVelocity | ) |
Allows the velocity of an infinite mass interactable to be prescribed.
In a similar manner to BaseInteractable::setPrescribedPosition this sets the velocity of the BaseInteactable. See also BaseInteractable::setPrescribedPosition Note, it is valid to set both the velocity and the position. No checking if these are consist is done at all. If you only set one of these function the other is automatically calculated using a by numerically differentiating or integrating the functions will is prescribed.
[in] | prescribedVelocity | std::function which is the lambda function and takes a double the time and returns a Vec 3D which is the velocity of the intertable for that time. |
Definition at line 506 of file BaseInteractable.cc.
References prescribedVelocity_.
void BaseInteractable::setSpecies | ( | const ParticleSpecies * | species | ) |
Sets the species of this BaseInteractable.
This function sets the species associated with this interactable object. Again this must be a ParticleSpecies. Note, it also automatically sets the index on the indSpecies_ by working up the correct index. However, index should be carefully used
[in] | species | ParticleSpcies pointer which is species holding the physical properties. |
Definition at line 136 of file BaseInteractable.cc.
References BaseObject::getIndex(), indSpecies_, and species_.
Referenced by BaseWall::setSpecies(), and BaseParticle::setSpecies().
void BaseInteractable::setTorque | ( | Vec3D | torque | ) |
Sets the torque on this BaseInteractable.
This sets the torque being applied to this interactable. Note, first the code computes all force/torques in the interactions and then loops over all interactable objects applying the torques from the interactions to the interactables involved in the interaction.
[in] | torque | Vec3D which is the force to be applied. |
Definition at line 188 of file BaseInteractable.cc.
References torque_.
void BaseInteractable::setVelocity | ( | const Vec3D & | velocity | ) |
set the velocity of the BaseInteractable.
See also BaseInteractable::getVelocity
[in] | velocity | Vec3D which is the velocity of the interactable. |
Definition at line 403 of file BaseInteractable.cc.
References velocity_.
Referenced by applyPrescribedVelocity(), BaseParticle::fixParticle(), ChuteInsertionBoundary::generateParticle(), CubeInsertionBoundary::generateParticle(), HopperInsertionBoundary::generateParticle(), integrateAfterForceComputation(), integrateBeforeForceComputation(), InfiniteWall::oldRead(), InfiniteWallWithHole::oldRead(), CircularPeriodicBoundary::rotateParticle(), and ChuteBottom::setupInitialConditions().
|
pure virtual |
Write a BaseInteractable to an output stream.
[in] | os | The output stream to which the BaseInteractable is written. |
BaseInteractable write function. Writes out all the information required to recreate this interactable. To write this interactable to the screen call write(std::cout). See also BaseInteractable::read
[in] | os | std::ostream to which the information is written. Note, is any ostream is can be file or screen. |
Implements BaseObject.
Implemented in IntersectionOfWalls, InfiniteWallWithHole, InfiniteWall, BaseParticle, Coil, Screw, CylindricalWall, AxisymmetricIntersectionOfWalls, and BaseWall.
Definition at line 318 of file BaseInteractable.cc.
References angularVelocity_, force_, indSpecies_, orientation_, position_, torque_, velocity_, and BaseObject::write().
Referenced by BaseWall::write(), and BaseParticle::write().
|
private |
Store the angular velocity of the interactable.
Definition at line 325 of file BaseInteractable.h.
Referenced by addAngularVelocity(), BaseInteractable(), getAngularVelocity(), read(), setAngularVelocity(), and write().
|
private |
Stores the force applied to the interactable.
Definition at line 330 of file BaseInteractable.h.
Referenced by addForce(), BaseInteractable(), getForce(), read(), setForce(), and write().
|
private |
Stores the index on the species associated with this interactable.
Definition at line 346 of file BaseInteractable.h.
Referenced by BaseInteractable(), getIndSpecies(), read(), setIndSpecies(), setSpecies(), and write().
|
private |
List of interactions this interactable is involved with.
Definition at line 356 of file BaseInteractable.h.
Referenced by addInteraction(), BaseInteractable(), copyInteractionsForPeriodicParticles(), getInteractions(), removeInteraction(), and ~BaseInteractable().
|
private |
Stores the orientation of the interactable. Exactly what is stored depends on the type of interatable
Definition at line 320 of file BaseInteractable.h.
Referenced by BaseInteractable(), getOrientation(), read(), rotate(), setOrientation(), and write().
|
private |
Stores the position of the interactable. Exactly what is stored depends on the type of interactable.
Definition at line 314 of file BaseInteractable.h.
Referenced by BaseInteractable(), getPosition(), move(), read(), setPosition(), and write().
|
private |
User defined functions which if set describes the angular velocity of the interactable.
Definition at line 308 of file BaseInteractable.h.
Referenced by applyPrescribedAngularVelocity(), integrateAfterForceComputation(), integrateBeforeForceComputation(), and setPrescribedAngularVelocity().
|
private |
User defined function which if set describes the orientation of the interactable
Definition at line 302 of file BaseInteractable.h.
Referenced by applyPrescribedOrientation(), integrateAfterForceComputation(), integrateBeforeForceComputation(), and setPrescribedOrientation().
|
private |
User defined function which if set describes the position of the interactable
Definition at line 290 of file BaseInteractable.h.
Referenced by applyPrescribedPosition(), BaseInteractable(), integrateAfterForceComputation(), integrateBeforeForceComputation(), and setPrescribedPosition().
|
private |
User defined function which if set describes the velocity of the interactable.
Definition at line 296 of file BaseInteractable.h.
Referenced by applyPrescribedVelocity(), BaseInteractable(), integrateAfterForceComputation(), integrateBeforeForceComputation(), and setPrescribedVelocity().
|
private |
Point to the ParticlesSpecies which stores density and other material properties of the interactable.
Definition at line 341 of file BaseInteractable.h.
Referenced by BaseInteractable(), getSpecies(), and setSpecies().
|
private |
Stores the torque applied to the interactable.
Definition at line 335 of file BaseInteractable.h.
Referenced by addTorque(), BaseInteractable(), getTorque(), read(), setTorque(), and write().
|
private |
Stores the velocity of this interactable.
Definition at line 351 of file BaseInteractable.h.
Referenced by addVelocity(), BaseInteractable(), getVelocity(), read(), setVelocity(), and write().