BaseInteractable Class Referenceabstract

Defines the basic properties that a interactable object can have. More...

#include <BaseInteractable.h>

+ Inheritance diagram for BaseInteractable:

Public Member Functions

 BaseInteractable ()
 Default BaseInteractable constructor. More...
 
 BaseInteractable (const BaseInteractable &p)
 Copy constructor. More...
 
 ~BaseInteractable () override
 Destructor, it simply destructs the BaseInteractable and all the objects it contains. More...
 
void read (std::istream &is) override
 Reads a BaseInteractable from an input stream. More...
 
void write (std::ostream &os) const override
 Write a BaseInteractable to an output stream. More...
 
unsigned int getIndSpecies () const
 Returns the index of the species associated with the interactable object. More...
 
virtual void setIndSpecies (unsigned int indSpecies)
 Sets the index of the Species of this BaseInteractable. More...
 
const ParticleSpeciesgetSpecies () const
 Returns a pointer to the species of this BaseInteractable. More...
 
void setSpecies (const ParticleSpecies *species)
 Sets the species of this BaseInteractable. More...
 
const Vec3DgetForce () const
 Returns the force on this BaseInteractable. More...
 
const Vec3DgetTorque () 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...
 
virtual void resetForceTorque (int numberOfOMPthreads)
 
void sumForceTorqueOMP ()
 
const Vec3DgetPosition () const
 Returns the position of this BaseInteractable. More...
 
const QuaterniongetOrientation () const
 Returns the orientation of this BaseInteractable. More...
 
virtual void setPosition (const Vec3D &position)
 Sets the position of this BaseInteractable. More...
 
void setOrientationViaNormal (Vec3D normal)
 Sets the orientation of this BaseInteractable by defining the vector that results from the rotation of the (1,0,0) vector. More...
 
void setOrientationViaEuler (Vec3D eulerAngle)
 Sets the orientation of this BaseInteractable by defining the euler angles. More...
 
virtual void setOrientation (const Quaternion &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...
 
virtual void rotate (const Vec3D &angularVelocityDt)
 Rotates this BaseInteractable. More...
 
const std::vector< BaseInteraction * > & getInteractions () const
 Returns a list of interactions which belong to this interactable. 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 Vec3DgetVelocity () const
 Returns the velocity of this interactable. More...
 
virtual const Vec3DgetAngularVelocity () 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< Quaternion(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 BaseInteractiongetInteractionWith (BaseParticle *P, unsigned 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...
 
virtual bool isFixed () const =0
 
virtual Mdouble getInvMass () const
 
virtual Mdouble getCurvature (const Vec3D &labFixedCoordinates) const
 
virtual bool isFaceContact (const Vec3D &normal) const
 
- Public Member Functions inherited from BaseObject
 BaseObject ()=default
 Default constructor. More...
 
 BaseObject (const BaseObject &p)=default
 Copy constructor, copies all the objects BaseObject contains. More...
 
virtual ~BaseObject ()=default
 virtual destructor More...
 
virtual std::string getName () const =0
 A purely virtual function. More...
 
virtual void moveInHandler (unsigned int index)
 Except that it is virtual, it does the same thing as setIndex() does. More...
 
void setIndex (unsigned int index)
 Allows one to assign an index to an object in the handler/container. More...
 
void setId (unsigned long 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...
 
void setGroupId (unsigned groupId)
 
unsigned getGroupId () const
 

Private Attributes

std::function< Vec3D(double)> prescribedPosition_
 
std::function< Vec3D(double)> prescribedVelocity_
 
std::function< Quaternion(double)> prescribedOrientation_
 
std::function< Vec3D(double)> prescribedAngularVelocity_
 
Vec3D position_
 
Quaternion orientation_
 
Vec3D angularVelocity_
 
Vec3D force_
 
Vec3D torque_
 
std::vector< Vec3DforceOMP_
 
std::vector< Vec3DtorqueOMP_
 
const ParticleSpeciesspecies_
 
unsigned int indSpecies_
 
Vec3D velocity_
 
std::vector< BaseInteraction * > interactions_
 

Detailed Description

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.

Todo:
Check prescribed objects have infinite mass.

Constructor & Destructor Documentation

◆ BaseInteractable() [1/2]

BaseInteractable::BaseInteractable ( )

Default BaseInteractable constructor.

Simply creates an empty BaseInteractable, with all vectors relating to the positions and motions of the current object initialised to zero and all pointers to null.

Note that the function also sets the species index (indSpecies_) to zero by default, so any objects created will, by default, possess the properties associated with species 0.

20  :
21  BaseObject()
22 {
23  //setting all vectors to zero
28  force_.setZero();
29  torque_.setZero();
30  //setting the default species to species 0
31  indSpecies_ = 0;
32  //setting all relevant pointers to nullptr
33  species_ = nullptr;
34  prescribedPosition_ = nullptr;
35  prescribedVelocity_ = nullptr;
36  prescribedOrientation_ = nullptr;
38  logger(DEBUG, "BaseInteractable::BaseInteractable() finished");
39 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ DEBUG
unsigned int indSpecies_
Definition: BaseInteractable.h:476
std::function< Vec3D(double)> prescribedAngularVelocity_
Definition: BaseInteractable.h:421
std::function< Vec3D(double)> prescribedVelocity_
Definition: BaseInteractable.h:409
const ParticleSpecies * species_
Definition: BaseInteractable.h:471
std::function< Vec3D(double)> prescribedPosition_
Definition: BaseInteractable.h:403
Vec3D position_
Definition: BaseInteractable.h:427
Vec3D velocity_
Definition: BaseInteractable.h:481
Quaternion orientation_
Definition: BaseInteractable.h:433
Vec3D torque_
Definition: BaseInteractable.h:448
Vec3D angularVelocity_
Definition: BaseInteractable.h:438
std::function< Quaternion(double)> prescribedOrientation_
Definition: BaseInteractable.h:415
Vec3D force_
Definition: BaseInteractable.h:443
BaseObject()=default
Default constructor.
void setUnity()
Sets quaternion value to (1,0,0,0)
Definition: Quaternion.cc:34
void setZero()
Sets all elements to zero.
Definition: Vector.cc:23

References angularVelocity_, DEBUG, force_, indSpecies_, logger, orientation_, position_, prescribedAngularVelocity_, prescribedOrientation_, prescribedPosition_, prescribedVelocity_, Quaternion::setUnity(), Vec3D::setZero(), species_, torque_, and velocity_.

◆ BaseInteractable() [2/2]

BaseInteractable::BaseInteractable ( const BaseInteractable p)

Copy constructor.

Copies an existing BaseInteractable, p, and (almost) all objects it contains.

Note, that the interactions are not copied as these often require extra work. Rather, the interactions list is simply emptied using the standard C++ clear function, destroying all contents and leaving the interactions_ vector with a size of zero.

All the other properties are copied normally.

Please use this copy with care.

54  : BaseObject(p)
55 {
56  interactions_.clear();
57  position_ = p.position_;
58  orientation_ = p.orientation_;
59  velocity_ = p.velocity_;
60  angularVelocity_ = p.angularVelocity_;
61  force_ = p.force_;
62  torque_ = p.torque_;
63  species_ = p.species_;
64  indSpecies_ = p.indSpecies_;
65  prescribedPosition_ = p.prescribedPosition_;
66  prescribedVelocity_ = p.prescribedVelocity_;
67  prescribedOrientation_ = p.prescribedOrientation_;
68  prescribedAngularVelocity_ = p.prescribedAngularVelocity_;
69  logger(DEBUG, "BaseInteractable::BaseInteractable(const BaseInteractable &p finished");
70 }
float * p
Definition: Tutorial_Map_using.cpp:9
std::vector< BaseInteraction * > interactions_
Definition: BaseInteractable.h:486

References angularVelocity_, DEBUG, force_, indSpecies_, interactions_, logger, orientation_, p, position_, prescribedAngularVelocity_, prescribedOrientation_, prescribedPosition_, prescribedVelocity_, species_, torque_, and velocity_.

◆ ~BaseInteractable()

BaseInteractable::~BaseInteractable ( )
override

Destructor, it simply destructs the BaseInteractable and all the objects it contains.

Removes all the interactions from the interactable.

76 {
77  logger(VERBOSE, "Deleting BaseInteractable with index= % and id = %, size = %", getIndex(), getId(),
78  interactions_.size());
79  while (!interactions_.empty())
80  {
81  interactions_.front()->removeFromHandler();
82  }
83  logger(DEBUG, "BaseInteractable::~BaseInteractable() finished");
84 }
@ VERBOSE
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:104
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.h:97

References DEBUG, BaseObject::getId(), BaseObject::getIndex(), interactions_, logger, and VERBOSE.

Member Function Documentation

◆ addAngularVelocity()

void BaseInteractable::addAngularVelocity ( const Vec3D angularVelocity)

add an increment to the angular velocity.

See also BaseInteractable::setAngularVelocity

Parameters
[in]angularVelocityincrement which to increase the angularVelocity by.
349 {
350  angularVelocity_ += angularVelocity;
351 }

References angularVelocity_.

Referenced by BaseParticle::angularAccelerate().

◆ addForce()

void BaseInteractable::addForce ( const 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.

Parameters
[in]addForceVec3D incremental force which is added to the total force of the interactable.
95 {
96  if (OMP_THREAD_NUM==0) {
97  force_ += addForce;
98  } else {
100  }
101 }
#define OMP_THREAD_NUM
Definition: GeneralDefine.h:48
std::vector< Vec3D > forceOMP_
Definition: BaseInteractable.h:460
void addForce(const Vec3D &addForce)
Adds an amount to the force on this BaseInteractable.
Definition: BaseInteractable.cc:94

References force_, forceOMP_, and OMP_THREAD_NUM.

Referenced by MeshTriangle::checkInteractions(), SingleParticleSegregation::computeAdditionalForces(), DPMBase::computeExternalForces(), Contact::computeExternalForces(), VolumeCoupling::computeExternalForces(), DPMBase::computeForcesDueToWalls(), DPMBase::computeInternalForce(), ChuteWithPeriodicInflow::computeInternalForces(), and BaseWall::getInteractionWith().

◆ addInteraction()

void BaseInteractable::addInteraction ( BaseInteraction I)

Adds an interaction to this BaseInteractable.

Added a new interactions to the current interactable.

Parameters
[in]IPointer to the new interaction which is to be added to the list of interactions of this interactable.
271 {
272  interactions_.push_back(I);
273 }
#define I
Definition: main.h:127

References I, and interactions_.

Referenced by BaseInteraction::importI(), BaseInteraction::importP(), BaseInteraction::setI(), and BaseInteraction::setP().

◆ addTorque()

void BaseInteractable::addTorque ( const 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.

Parameters
[in]addTorqueVec3D incremental force which is added to the total torque of the interactable.
111 {
112  if (OMP_THREAD_NUM==0) {
113  torque_ += addTorque;
114  } else {
116  }
117 }
std::vector< Vec3D > torqueOMP_
Definition: BaseInteractable.h:465
void addTorque(const Vec3D &addTorque)
Adds an amount to the torque on this BaseInteractable.
Definition: BaseInteractable.cc:110

References OMP_THREAD_NUM, torque_, and torqueOMP_.

Referenced by MeshTriangle::checkInteractions(), DPMBase::computeForcesDueToWalls(), DPMBase::computeInternalForce(), ChuteWithPeriodicInflow::computeInternalForces(), and BaseWall::getInteractionWith().

◆ addVelocity()

void BaseInteractable::addVelocity ( const Vec3D velocity)
inline

adds an increment to the velocity.

See also BaseInteractable::setVelocity

Parameters
[in]velocityVec3D containing the velocity increment which to increase the velocity by.
292  { velocity_ += velocity; }
double velocity(const double &t)
Angular velocity as function of time t.
Definition: jeffery_orbit.cc:107

References Jeffery_Solution::velocity(), and velocity_.

Referenced by BaseParticle::accelerate(), and ClumpParticle::updatePebblesVelPos().

◆ applyPrescribedAngularVelocity()

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

Parameters
[in]timedouble which is the current time of the simulation.
491 {
493  {
495  }
496 }
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
Definition: BaseInteractable.cc:338

References prescribedAngularVelocity_, and setAngularVelocity().

Referenced by integrateAfterForceComputation(), and integrateBeforeForceComputation().

◆ applyPrescribedOrientation()

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

Parameters
[in]timedouble which is the current time of the simulation.
464 {
466  {
468  }
469 }
virtual void setOrientation(const Quaternion &orientation)
Sets the orientation of this BaseInteractable.
Definition: BaseInteractable.h:239

References prescribedOrientation_, and setOrientation().

Referenced by integrateBeforeForceComputation().

◆ applyPrescribedPosition()

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

Parameters
[in]timedouble which is the current time of the simulation.
402 {
404  {
406  }
407 }
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:218

References prescribedPosition_, and setPosition().

Referenced by integrateBeforeForceComputation().

◆ applyPrescribedVelocity()

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

Parameters
[in]timedouble which is the current time of the simulation.
433 {
435  {
437  }
438 }
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:328

References prescribedVelocity_, and setVelocity().

Referenced by integrateAfterForceComputation(), and integrateBeforeForceComputation().

◆ copyInteractionsForPeriodicParticles()

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.

Parameters
[in]pOriginalReference to the BaseInteractable which is to be copied to create the ghost particles.
365 {
366  for (BaseInteraction* interaction : pOriginal.interactions_)
367  {
368  //So here this is the ghost and it is the interaction of the ghost/
369  interaction->copySwitchPointer(&pOriginal, this);
370  }
371 }
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:39
void copySwitchPointer(const BaseInteractable *original, BaseInteractable *ghost) const
This copies the interactions of the original particle and replaces the original with the ghost copy.
Definition: BaseInteraction.cc:322

References BaseInteraction::copySwitchPointer(), and interactions_.

Referenced by ConstantMassFlowMaserBoundary::createGhostCopy(), SubcriticalMaserBoundary::createGhostCopy(), PeriodicBoundary::createGhostParticle(), TimeDependentPeriodicBoundary::createGhostParticle(), LeesEdwardsBoundary::createHorizontalPeriodicParticle(), ShearBoxBoundary::createHorizontalPeriodicParticle(), AngledPeriodicBoundary::createPeriodicParticle(), LeesEdwardsBoundary::createVerticalPeriodicParticle(), and ShearBoxBoundary::createVerticalPeriodicParticle().

◆ getAngularVelocity()

◆ getCurvature()

virtual Mdouble BaseInteractable::getCurvature ( const Vec3D labFixedCoordinates) const
inlinevirtual

returns the inverse radius, or curvature, of the surface. This value is zero for walls and gets overridden for particles that have finite radius

Todo:
should be wall-type dependent

Reimplemented in BaseParticle, and SuperQuadricParticle.

394  { return 0.0; }

Referenced by BaseInteraction::getEffectiveRadius(), and BaseInteraction::getOverlapVolume().

◆ getForce()

const Vec3D& BaseInteractable::getForce ( ) const
inline

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.

Returns
const Vec3D reference that is the total force applied to this interactable.
106  { return force_; }

References force_.

Referenced by T_protectiveWall::actionsAfterTimeStep(), ClosedCSCWalls::actionsAfterTimeStep(), MercuryProblem::actionsAfterTimeStep(), protectiveWall::actionsAfterTimeStep(), Slide::actionsBeforeTimeStep(), SphericalIndenter::getForceOnIndenter(), BaseParticle::integrateAfterForceComputation(), ClumpParticle::integrateAfterForceComputation(), BaseParticle::integrateBeforeForceComputation(), ClumpParticle::integrateBeforeForceComputation(), BaseWall::setForceControl(), BaseWall::setVelocityControl(), ClumpParticle::updateExtraQuantities(), and Slide::writeEneTimeStep().

◆ getIndSpecies()

◆ getInteractions()

const std::vector<BaseInteraction*>& BaseInteractable::getInteractions ( ) const
inline

Returns a list of interactions which belong to this interactable.

Returns
An list of pointers to all the interactions which this interacable is involved in.
257  { return interactions_; }

References interactions_.

Referenced by SilbertPeriodic::add_flow_particles(), MeshTriangle::checkInteractions(), WearableNurbsWall::computeWear(), WearableTriangulatedWall::computeWear(), PeriodicBoundaryHandler::findNewInteractions(), and DPMBase::removeDuplicatePeriodicParticles().

◆ getInteractionWith()

virtual BaseInteraction* BaseInteractable::getInteractionWith ( BaseParticle P,
unsigned  timeStamp,
InteractionHandler interactionHandler 
)
pure virtual

Returns the interaction between this object and a given BaseParticle.

Todo:

TW make sure this function sets normal, distance, overlap, contact point

AT why is this a BaseParticle and not a BaseInteratable.

Implemented in VChute, TriangulatedWall, TriangleMeshWall, SineWall, RestrictedWall, ParabolaChute, MeshTriangle, Combtooth, BaseWall, ArcWall, SuperQuadricParticle, and BaseParticle.

◆ getInvMass()

virtual Mdouble BaseInteractable::getInvMass ( ) const
inlinevirtual

returns the inverse mass. This value is zero for walls and gets overridden for particles that have finite mass

Reimplemented in MeshTriangle, and BaseParticle.

388  { return 0.0; }

Referenced by BaseInteraction::getEffectiveMass().

◆ getOrientation()

const Quaternion& BaseInteractable::getOrientation ( ) const
inline

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.

Returns
Returns a reference to a Vec3D returns the position of the interactable.
210  { return orientation_; }

References orientation_.

Referenced by MarbleRun::actionsAfterTimeStep(), NautaMixer::addScrew(), compareParticles(), ScrewsymmetricIntersectionOfWalls::computeDeltaZ(), SuperQuadricParticle::computeHessianLabFixed(), SuperQuadricParticle::computeShape(), SuperQuadricParticle::computeShapeGradientLabFixed(), WearableTriangleMeshWall::computeWear(), AxisymmetricIntersectionOfWalls::convertLimits(), HorizontalBaseScrew::convertLimits(), ScrewsymmetricIntersectionOfWalls::convertLimits(), copyPositionFrom(), InfiniteWall::createVTK(), BaseWall::getAxis(), SuperQuadricParticle::getContactPointPlanB(), InfiniteWall::getDistance(), AxisymmetricIntersectionOfWalls::getDistanceAndNormal(), HorizontalBaseScrew::getDistanceAndNormal(), NurbsWall::getDistanceAndNormal(), Screw::getDistanceAndNormal(), BasicIntersectionOfWalls::getDistanceAndNormal(), BasicUnionOfWalls::getDistanceAndNormal(), InfiniteWall::getDistanceAndNormal(), IntersectionOfWalls::getDistanceAndNormal(), LevelSetWall::getDistanceAndNormal(), TriangleMeshWall::getDistanceAndNormal(), InfiniteWall::getDistanceNormalOverlapSuperquadric(), TriangleMeshWall::getInteractionWith(), InfiniteWall::getNormal(), BasicIntersectionOfWalls::getVTK(), BasicUnionOfWalls::getVTK(), integrateAfterForceComputation(), BaseParticle::integrateAfterForceComputation(), integrateBeforeForceComputation(), BaseParticle::integrateBeforeForceComputation(), ChuteWithPeriodicInflow::outputXBallsDataParticlee(), WearableNurbsWall::storeDebris(), TriangleMeshWall::updateBoundingBoxGlobal(), PeriodicBoundaryHandler::updateParticles(), ClumpParticle::updatePebblesVelPos(), TriangleWall::updateVertexAndNormal(), SuperQuadricParticle::writeDebugMessageMiddleOfLoop(), SuperQuadricParticle::writeDebugMessageStep1(), BasicUnionOfWalls::writeVTK(), IntersectionOfWalls::writeVTK(), LevelSetWall::writeVTK(), NurbsWall::writeVTK(), Screw::writeVTK(), ScrewsymmetricIntersectionOfWalls::writeVTK(), TriangleMeshWall::writeVTK(), AxisymmetricIntersectionOfWalls::writeVTK(), NurbsWall::writeWallDetailsVTK(), and WearableNurbsWall::writeWallDetailsVTK().

◆ getPosition()

const Vec3D& BaseInteractable::getPosition ( ) const
inline

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\)

Returns
Returns a reference to a Vec3D returns the position of the interactable.
198  { return position_; }

References position_.

Referenced by ClosedCSCRestart::actionsAfterTimeStep(), ClosedCSCRun::actionsAfterTimeStep(), ChangingTOIParticle::actionsAfterTimeStep(), SingleParticleSegregation::actionsAfterTimeStep(), BouncingSuperQuadric::actionsAfterTimeStep(), DrivenParticleClass::actionsAfterTimeStep(), AngleOfRepose::actionsBeforeTimeStep(), Slide::actionsBeforeTimeStep(), NautaMixer::addScrew(), statistics_while_running< T >::auto_set_domain(), statistics_while_running< T >::auto_set_z(), BaseParticle::BaseParticle(), CircularPeriodicBoundary::checkBoundaryAfterParticleMoved(), FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), InsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), Mercury3Dclump::checkClumpForInteractionPeriodic(), ChuteWithPeriodicInflow::cleanChute(), ChuteWithContraction::cleanChute(), Funnel::cleanChute(), Chute::cleanChute(), compareParticles(), SingleParticleSegregation::computeAdditionalForces(), Contact::computeExternalForces(), DPMBase::computeForcesDueToWalls(), SuperQuadricParticle::computeHessianLabFixed(), DPMBase::computeInternalForce(), Mercury2D::computeInternalForces(), Mercury3D::computeInternalForces(), ChuteWithPeriodicInflow::computeInternalForces(), SuperQuadricParticle::computeShape(), SuperQuadricParticle::computeShapeGradientLabFixed(), WearableTriangleMeshWall::computeWear(), Domain::containsParticle(), AxisymmetricIntersectionOfWalls::convertLimits(), HorizontalBaseScrew::convertLimits(), ScrewsymmetricIntersectionOfWalls::convertLimits(), copyPositionFrom(), Funnel::create_funnel(), Funnel::create_inflow_particle(), InfiniteWall::createVTK(), ChuteWithWedge::extendBottom(), Domain::findNearbyBoundaries(), Domain::findNewMPIInteractions(), PeriodicBoundaryHandler::findNewParticle(), Domain::flushParticlesFromList(), BaseInteraction::gatherContactStatistics(), BaseParticle::getAngularMomentum(), SuperQuadricParticle::getContactPointPlanB(), BaseInteraction::getCP(), BaseParticle::getDisplacement2(), SphericalWall::getDistance(), InfiniteWall::getDistance(), AxisymmetricIntersectionOfWalls::getDistanceAndNormal(), HorizontalBaseScrew::getDistanceAndNormal(), NurbsWall::getDistanceAndNormal(), Screw::getDistanceAndNormal(), ScrewsymmetricIntersectionOfWalls::getDistanceAndNormal(), BasicIntersectionOfWalls::getDistanceAndNormal(), BasicUnionOfWalls::getDistanceAndNormal(), IntersectionOfWalls::getDistanceAndNormal(), LevelSetWall::getDistanceAndNormal(), SphericalWall::getDistanceAndNormal(), TriangleMeshWall::getDistanceAndNormal(), InfiniteWall::getDistanceNormalOverlapSuperquadric(), BaseInteraction::getIC(), SphericalIndenter::getIndenterHeight(), SuperQuadricParticle::getInitialGuessForContact(), BaseParticle::getInteractionWith(), SuperQuadricParticle::getInteractionWith(), TriangleMeshWall::getInteractionWith(), SuperQuadricParticle::getInteractionWithSuperQuad(), DomainHandler::getParticleDomainGlobalIndex(), ClumpParticle::getPebblePositions(), getVelocityAtContact(), Mercury3D::hGridFindContactsWithTargetCell(), Mercury2D::hGridFindParticleContacts(), Mercury3D::hGridFindParticleContacts(), Mercury2D::hGridGetInteractingParticleList(), Mercury3D::hGridGetInteractingParticleList(), Mercury2D::hGridHasParticleContacts(), Mercury3D::hGridHasParticleContacts(), Mercury2D::hGridUpdateParticle(), Mercury3D::hGridUpdateParticle(), BaseParticle::integrateBeforeForceComputation(), ClumpParticle::integrateBeforeForceComputation(), BaseParticle::isInContactWith(), LawinenBox::LawinenBox(), main(), SubcriticalMaserBoundaryTEST::modifyPeriodicComplexity(), SphericalIndenter::outputXBallsData(), ChuteWithPeriodicInflow::outputXBallsDataParticlee(), CubeDeletionBoundarySelfTest::printTime(), DeletionBoundarySelfTest::printTime(), PeriodicBoundaryHandler::processLocalGhostParticles(), Domain::processReceivedBoundaryParticleData(), PeriodicBoundaryHandler::processReceivedGhostParticleData(), FileReader::read(), ClosedCSCWalls::saveWalls(), IntersectionOfWalls::setPointsAndLines(), MarbleRun::setupInitialConditions(), AngleOfRepose::setupInitialConditions(), TriangleWall::setVertices(), WearableNurbsWall::storeDebris(), TriangleMeshWall::updateBoundingBoxGlobal(), PeriodicBoundaryHandler::updateMaserParticle(), PeriodicBoundaryHandler::updateParticles(), PeriodicBoundaryHandler::updateParticleStatus(), ClumpParticle::updatePebblesVelPos(), SCoupling< M, O >::updateTriangleWall(), TriangleWall::updateVertexAndNormal(), MeshTriangle::updateVerticesFromParticles(), SuperQuadricParticle::writeDebugMessageMiddleOfLoop(), SuperQuadricParticle::writeDebugMessageStep1(), Penetration::writeEneTimeStep(), Slide::writeEneTimeStep(), SingleParticle< SpeciesType >::writeEneTimeStep(), BasicUnionOfWalls::writeVTK(), HorizontalBaseScrew::writeVTK(), IntersectionOfWalls::writeVTK(), LevelSetWall::writeVTK(), NurbsWall::writeVTK(), Screw::writeVTK(), ScrewsymmetricIntersectionOfWalls::writeVTK(), TriangleMeshWall::writeVTK(), AxisymmetricIntersectionOfWalls::writeVTK(), NurbsWall::writeWallDetailsVTK(), and WearableNurbsWall::writeWallDetailsVTK().

◆ getSpecies()

const ParticleSpecies* BaseInteractable::getSpecies ( ) const
inline

◆ getTorque()

const Vec3D& BaseInteractable::getTorque ( ) const
inline

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.

Returns
const Vec3D reference that is the total force applied to this interactable.
118  { return torque_; }

References torque_.

Referenced by ClumpParticle::angularAccelerateClumpIterative(), BaseParticle::integrateAfterForceComputation(), BaseParticle::integrateBeforeForceComputation(), and ClumpParticle::updateExtraQuantities().

◆ getVelocity()

const Vec3D & BaseInteractable::getVelocity ( ) const
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.

Returns
Vec3D reference which contains the current velocity of the current BaseInteractable.
308 {
309  return velocity_;
310 }

References velocity_.

Referenced by HertzianBSHPInteractionTwoParticleElasticCollision::actionsAfterSolve(), SphericalSuperQuadricCollision::actionsAfterSolve(), SpeciesTest::actionsAfterSolve(), ClosedCSCRestart::actionsAfterTimeStep(), ClosedCSCRun::actionsAfterTimeStep(), ClosedCSCWalls::actionsAfterTimeStep(), SphericalIndenter::actionsAfterTimeStep(), BouncingSuperQuadric::actionsAfterTimeStep(), LawinenBox::actionsBeforeTimeStep(), Slide::actionsBeforeTimeStep(), FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), InsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), ChuteWithContraction::ChuteWithContraction(), compareParticles(), DPMBase::computeExternalForces(), ChuteWithPeriodicInflow::computeInternalForces(), ClosedCSCWalls::continueSolve(), copyVelocityFrom(), BaseParticle::getAngularMomentum(), SphericalIndenter::getIndenterVelocity(), TriangleMeshWall::getInteractionWith(), BaseParticle::getKineticEnergy(), ClumpParticle::getKineticEnergy(), BaseParticle::getMomentum(), ParticleParticleCollision::getRelativeVelocity(), WallParticleCollision::getRelativeVelocity(), getVelocityAtContact(), ClumpParticle::integrateAfterForceComputation(), integrateBeforeForceComputation(), BaseParticle::integrateBeforeForceComputation(), ClumpParticle::integrateBeforeForceComputation(), main(), InfiniteWallWithHole::move_time(), SphericalIndenter::outputXBallsData(), ChuteWithPeriodicInflow::outputXBallsDataParticlee(), LawinenBox::printTime(), ClosedCSCRestart::printTime(), ClosedCSCRun::printTime(), ClosedCSCWalls::printTime(), ChuteWithPeriodicInflow::printTime(), ContactDetectionNormalSpheresTest::test(), HertzContactRestitutionUnitTest::test(), PeriodicBoundaryHandler::updateParticles(), ClumpParticle::updatePebblesVelPos(), and MeshTriangle::updateVerticesFromParticles().

◆ getVelocityAtContact()

const Vec3D BaseInteractable::getVelocityAtContact ( const Vec3D contact) const
virtual

Returns the velocity at the contact point, use by many force laws.

Reimplemented in MeshTriangle.

354 {
355  return getVelocity() - Vec3D::cross(contact - getPosition(), getAngularVelocity());
356 }
virtual const Vec3D & getAngularVelocity() const
Returns the angular velocity of this interactable.
Definition: BaseInteractable.cc:319
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Definition: BaseInteractable.cc:307
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:197
static Vec3D cross(const Vec3D &a, const Vec3D &b)
Calculates the cross product of two Vec3D: .
Definition: Vector.cc:143

References Vec3D::cross(), getAngularVelocity(), getPosition(), and getVelocity().

◆ integrateAfterForceComputation()

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.

Parameters
[in]timedouble which is the current simulation time
[in]timeStepdouble which is the current delta time of the simulation i.e. the size of each time step.
590 {
592  {
594  {
595  applyPrescribedVelocity(time + timeStep);
596  }
597  else
598  {
599  setVelocity((prescribedPosition_(time + 1.1 * timeStep) - prescribedPosition_(time + 0.9 * timeStep)) /
600  (0.2 * timeStep));
601  }
602  }
603  else
604  {
606  {
607  applyPrescribedVelocity(time + 0.5 * timeStep);
608  }
609  }
611  {
613  {
614  applyPrescribedAngularVelocity(time + timeStep);
615  }
616  else
617  {
618  setAngularVelocity(getOrientation().applyCInverse(
619  (prescribedOrientation_(time + 1.1 * timeStep) - prescribedOrientation_(time + 0.9 * timeStep)) /
620  (0.2 * timeStep)
621  ));
622  }
623  }
624  else
625  {
627  {
628  applyPrescribedAngularVelocity(time + 0.5 * timeStep);
629  }
630  }
631 }
const Quaternion & getOrientation() const
Returns the orientation of this BaseInteractable.
Definition: BaseInteractable.h:209
void applyPrescribedAngularVelocity(double time)
Computes the angular velocity from the user defined prescribed angular velocity.
Definition: BaseInteractable.cc:490
void applyPrescribedVelocity(double time)
Computes the velocity from the user defined prescribed velocity function.
Definition: BaseInteractable.cc:432

References applyPrescribedAngularVelocity(), applyPrescribedVelocity(), getOrientation(), prescribedAngularVelocity_, prescribedOrientation_, prescribedPosition_, prescribedVelocity_, setAngularVelocity(), and setVelocity().

Referenced by BaseParticle::integrateAfterForceComputation(), and ClumpParticle::integrateAfterForceComputation().

◆ integrateBeforeForceComputation()

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.

Parameters
[in]timedouble which is the current simulation time
[in]timeStepdouble which is the current delta time of the simulation i.e. the size of each time step.
517 {
519  {
521  {
522  //Both the velocity and position are defined; as we are using leap
523  //frog method so the velocity is evaluated half a time later.
524  applyPrescribedPosition(time + timeStep);
525  applyPrescribedVelocity(time + 0.5 * timeStep);
526  }
527  else
528  {
529  //Only the position is defined.
530  //Velocity is evaluated from a finite different of the Position
531  //Note, we use 0.5 +- 0.1 timeStep for the velocity eval.
532  applyPrescribedPosition(time + timeStep);
533  setVelocity((prescribedPosition_(time + 0.6 * timeStep) - prescribedPosition_(time + 0.4 * timeStep)) /
534  (0.2 * timeStep));
535  }
536  }
537  else
538  {
540  {
541  //Only the velocity is set. The position is calculated from the
542  //the integral of velocity.
543  applyPrescribedVelocity(time + 0.5 * timeStep);
544  move(getVelocity() * timeStep);
545  }
546  else
547  {
548  //Neither is set move based on the computed velocity of the object.
549  move(getVelocity() * timeStep);
550  }
551  }
553  {
555  {
556  applyPrescribedOrientation(time + timeStep);
557  applyPrescribedAngularVelocity(time + 0.5 * timeStep);
558  }
559  else
560  {
561  applyPrescribedOrientation(time + timeStep);
562  setAngularVelocity(getOrientation().applyCInverse(
563  (prescribedOrientation_(time + 0.6 * timeStep) - prescribedOrientation_(time + 0.4 * timeStep)) /
564  (0.2 * timeStep)
565  ));
566  }
567  }
568  else
569  {
571  {
572  applyPrescribedAngularVelocity(time + 0.5 * timeStep);
573  rotate(getAngularVelocity() * timeStep);
574  }
575  else
576  {
577  rotate(getAngularVelocity() * timeStep);
578  }
579  }
580 }
void applyPrescribedPosition(double time)
Computes the position from the user defined prescribed position function.
Definition: BaseInteractable.cc:401
void applyPrescribedOrientation(double time)
Computes the orientation from the user defined prescribed orientation function.
Definition: BaseInteractable.cc:463
virtual void move(const Vec3D &move)
Moves this BaseInteractable by adding an amount to the position.
Definition: BaseInteractable.cc:193
virtual void rotate(const Vec3D &angularVelocityDt)
Rotates this BaseInteractable.
Definition: BaseInteractable.cc:208

References applyPrescribedAngularVelocity(), applyPrescribedOrientation(), applyPrescribedPosition(), applyPrescribedVelocity(), getAngularVelocity(), getOrientation(), getVelocity(), move(), prescribedAngularVelocity_, prescribedOrientation_, prescribedPosition_, prescribedVelocity_, rotate(), setAngularVelocity(), and setVelocity().

Referenced by BaseParticle::integrateBeforeForceComputation(), and ClumpParticle::integrateBeforeForceComputation().

◆ isFaceContact()

virtual bool BaseInteractable::isFaceContact ( const Vec3D normal) const
inlinevirtual

Reimplemented in TriangleWall.

396 {return true;}

◆ isFixed()

virtual bool BaseInteractable::isFixed ( ) const
pure virtual

used to distinguish particles which belong to the flow and fixed particles/walls

Implemented in BaseWall, and BaseParticle.

◆ move()

◆ read()

void BaseInteractable::read ( std::istream &  is)
overridevirtual

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

Parameters
[in]isstd::istream to which the information is read from.

Implements BaseObject.

Reimplemented in WearableTriangulatedWall, WearableTriangleMeshWall, WearableNurbsWall, VChute, TriangulatedWall, TriangleWall, TriangleMeshWall, SphericalWall, SineWall, Screw, RestrictedWall, ParabolaChute, NurbsWall, MeshTriangle, LevelSetWall, IntersectionOfWalls, InfiniteWallWithHole, InfiniteWall, HorizontalScrew, CylindricalWall, Combtooth, Coil, BasicUnionOfWalls, BasicIntersectionOfWalls, BaseWall, ArcWall, SuperQuadricParticle, ClumpParticle, BaseParticle, SimpleDrumSuperquadrics, ScrewsymmetricIntersectionOfWalls, HorizontalBaseScrew, and AxisymmetricIntersectionOfWalls.

223 {
224  BaseObject::read(is);
225  std::string dummy;
226  is >> dummy >> indSpecies_;
227  is >> dummy >> position_;
228  is >> dummy;
229  //this if-statement is added to read Kasper van der Vaart's data files, which contain an additional variable named positionAbsolute
230  if (dummy == "positionAbsolute")
231  {
232  is >> dummy >> dummy >> dummy >> dummy;
233  }
234  is >> orientation_;
235  is >> dummy >> velocity_;
236  is >> dummy >> angularVelocity_;
237  is >> dummy;
238  if (dummy == "0")
239  is >> dummy;
240  is >> force_;
241  is >> dummy >> torque_;
242 }
virtual void read(std::istream &is)=0
Definition: BaseObject.cc:59
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References angularVelocity_, force_, indSpecies_, orientation_, position_, BaseObject::read(), oomph::Global_string_for_annotation::string(), torque_, and velocity_.

Referenced by BaseParticle::read(), and BaseWall::read().

◆ removeInteraction()

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. Note that this cannot be done with a range-based for, since we need the iterator to erase the interaction.

Parameters
[in]IBaseInteraction pointer which is the interaction to be removed.
Returns
bool True if the interaction was found and removed; false if the interaction did not exist for that interactable.
287 {
288  for (std::vector<BaseInteraction*>::iterator it = interactions_.begin(); it != interactions_.end(); ++it)
289  {
290  if (I == (*it))
291  {
292  interactions_.erase(it);
293  return true;
294  }
295  }
296  logger(WARN, "Error in BaseInteractable::removeInteraction: Interaction could not be removed");
297  return false;
298 }
@ WARN

References I, interactions_, logger, and WARN.

Referenced by BaseInteraction::importI(), BaseInteraction::importP(), BaseInteraction::setI(), BaseInteraction::setP(), and BaseInteraction::~BaseInteraction().

◆ resetForceTorque()

void BaseInteractable::resetForceTorque ( int  numberOfOMPthreads)
virtual

Reimplemented in TriangleMeshWall.

120 {
121  #ifdef MERCURYDPM_USE_OMP
122  forceOMP_.resize(numberOfOMPthreads-1);
123  torqueOMP_.resize(numberOfOMPthreads-1);
124  for (auto& force : forceOMP_)
125  {
126  force.setZero();
127  }
128 
129  for (auto& torque : torqueOMP_)
130  {
131  torque.setZero();
132  }
133  #endif
134 
135  force_.setZero();
136  torque_.setZero();
137 }

References force_, forceOMP_, Vec3D::setZero(), torque_, and torqueOMP_.

Referenced by SphericalIndenter::actionsBeforeTimeStep(), DPMBase::computeAllForces(), and TriangleMeshWall::resetForceTorque().

◆ rotate()

void BaseInteractable::rotate ( const Vec3D angularVelocityDt)
virtual

Rotates this BaseInteractable.

Rotates the interacable a given solid angle. Note, this just updates the orientation by the angle.

This function has been declared virtual, so it can be overridden for IntersectionOfWalls.

Parameters
[in]angularVelocityDtReference to Vec3D which is the solid angle through which the interactable is rotated.
Todo:
TW the move and rotate functions should only pass the time step, as teh velocity can be accessed directly by the object; this would simplify functions like Screw::rotate

Reimplemented in Screw, TriangleWall, TriangleMeshWall, and MeshTriangle.

209 {
210  //if (!angularVelocityDt.isZero()) {
211  orientation_.updateAngularDisplacement(angularVelocityDt);
212  //}
213 }
void updateAngularDisplacement(Vec3D angularVelocityDt)
Definition: Quaternion.cc:412

References orientation_, and Quaternion::updateAngularDisplacement().

Referenced by VerticalMixerStraightBlades::addBlades(), VerticalMixerAngledBlades::addBlades(), VerticalMixerAngledBlades::addPrettyBlades(), integrateBeforeForceComputation(), BaseParticle::integrateBeforeForceComputation(), ClumpParticle::integrateBeforeForceComputation(), MeshTriangle::rotate(), TriangleMeshWall::rotate(), TriangleWall::rotate(), and Screw::rotate().

◆ setAngularVelocity()

◆ setForce()

void BaseInteractable::setForce ( const Vec3D force)
inline

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.

Parameters
[in]forceVec3D which is the force to be applied.
129  { force_ = force; }

References force_.

Referenced by SmoothChute::actionsBeforeTimeStep().

◆ setIndSpecies()

virtual void BaseInteractable::setIndSpecies ( unsigned int  indSpecies)
inlinevirtual

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 BaseWall, and BaseParticle.

78  { indSpecies_ = indSpecies; }

References indSpecies_.

Referenced by BaseParticle::oldRead(), BaseParticle::setIndSpecies(), and BaseWall::setIndSpecies().

◆ setOrientation()

virtual void BaseInteractable::setOrientation ( const Quaternion orientation)
inlinevirtual

◆ setOrientationViaEuler()

void BaseInteractable::setOrientationViaEuler ( Vec3D  eulerAngle)

Sets the orientation of this BaseInteractable by defining the euler angles.

183 {
184  orientation_.setEuler(eulerAngle);
185 }
void setEuler(const Vec3D &e)
Convert Euler angles to a quaternion. See Wikipedia for details.
Definition: Quaternion.cc:453

References orientation_, and Quaternion::setEuler().

◆ setOrientationViaNormal()

void BaseInteractable::setOrientationViaNormal ( Vec3D  normal)

Sets the orientation of this BaseInteractable by defining the vector that results from the rotation of the (1,0,0) vector.

Sets the orientation of the interactable. interpretation depends on which interactable is being considered See also BaseInteractable::getOrientation.

Parameters
[in]orientationReference to Vec3D storing the orientation of the particle.
178 {
180 }
void setOrientationViaNormal(Vec3D normal)
Definition: Quaternion.cc:523
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65

References WallFunction::normal(), orientation_, and Quaternion::setOrientationViaNormal().

Referenced by AxisymmetricIntersectionOfWalls::AxisymmetricIntersectionOfWalls(), HorizontalBaseScrew::HorizontalBaseScrew(), main(), Screw::Screw(), ScrewsymmetricIntersectionOfWalls::ScrewsymmetricIntersectionOfWalls(), AxisymmetricIntersectionOfWalls::setAxis(), HorizontalBaseScrew::setAxis(), ScrewsymmetricIntersectionOfWalls::setAxis(), SimpleDrumSuperquadrics::setAxis(), InfiniteWall::setNormal(), MinimalExampleDrum::setupInitialConditions(), EllipsoidsBouncingOnWallDemo::setupInitialConditions(), GranularCollapse::setupInitialConditions(), ContactDetectionWithWallTester::setupParticleAndWall(), ContactDetectionTester::setupParticles(), ContactDetectionTester::testEllipsoidsContact(), ContactDetectionWithWallTester::testEllipsoidsContact(), ContactDetectionTester::testSpheresContact(), and ContactDetectionWithWallTester::testSpheresContact().

◆ setPosition()

virtual void BaseInteractable::setPosition ( const Vec3D position)
inlinevirtual

Sets the position of this BaseInteractable.

Interpretation depends on which interactable is being considered See also BaseInteractable::getPosistion.

Parameters
[in]positionReference to Vec3D storing the position of the particle.

Reimplemented in TriangleWall, and TriangleMeshWall.

219  { position_ = position; }

References position_.

Referenced by Slide::actionsBeforeTimeStep(), VerticalMixerAngledBlades::addBlades(), VerticalMixerAngledBlades::addPrettyBlades(), NautaMixer::addScrew(), applyPrescribedPosition(), AxisymmetricIntersectionOfWalls::AxisymmetricIntersectionOfWalls(), Funnel::create_funnel(), LawinenBox::create_inflow_particle(), ChuteWithContraction::create_inflow_particle(), Funnel::create_inflow_particle(), AngleOfRepose::create_inflow_particle(), FlowRule::create_inflow_particle(), SilbertPeriodic::create_inflow_particle(), SegregationWithHopper::create_inflow_particle(), Chute::createBottom(), ChuteWithWedge::extendBottom(), PeriodicBoundaryHandler::findTargetProcessor(), SuperQuadricParticle::getContactPointPlanB(), BasicIntersectionOfWalls::getDistanceAndNormal(), BasicUnionOfWalls::getDistanceAndNormal(), TriangleMeshWall::getDistanceAndNormal(), BasicIntersectionOfWalls::getVTK(), BasicUnionOfWalls::getVTK(), HorizontalBaseScrew::HorizontalBaseScrew(), InfiniteWall::InfiniteWall(), LawinenBox::LawinenBox(), main(), BaseParticle::oldRead(), InfiniteWall::oldRead(), regimeForceUnitTest::regimeForceUnitTest(), ScrewsymmetricIntersectionOfWalls::ScrewsymmetricIntersectionOfWalls(), InfiniteWall::set(), Slide::set_Walls(), SphericalIndenter::setIndenterHeight(), MarbleRun::setParticlePosition(), TriangleMeshWall::setPosition(), TriangleWall::setPosition(), ExtremeOverlapVolumeUnitTest::setupInitialConditions(), T_protectiveWall::setupInitialConditions(), AxisymmetricHopper::setupInitialConditions(), CFDDEMCoupleTest::setupInitialConditions(), my_problem::setupInitialConditions(), ForceLawsMPI2Test::setupInitialConditions(), TwoByTwoMPIDomainMPI4Test::setupInitialConditions(), HourGlass::setupInitialConditions(), MinimalExampleDrum::setupInitialConditions(), ParameterStudy1DDemo::setupInitialConditions(), ParameterStudy2DDemo::setupInitialConditions(), ParameterStudy3DDemo::setupInitialConditions(), statistics_while_running< T >::setupInitialConditions(), Drum::setupInitialConditions(), HertzSelfTest::setupInitialConditions(), MindlinSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), EllipsoidsBouncingOnWallDemo::setupInitialConditions(), GranularCollapse::setupInitialConditions(), SlidingSpheresUnitTest::setupInitialConditions(), protectiveWall::setupInitialConditions(), Tutorial11::setupInitialConditions(), Tutorial12::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), FullRestartTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWall::setupInitialConditions(), MovingWallReference::setupInitialConditions(), MovingWallSimpleIntegration::setupInitialConditions(), MovingWallPrescribedVelocity::setupInitialConditions(), MovingWallTangential::setupInitialConditions(), MovingWallTangentialReference::setupInitialConditions(), MovingWallTangentialSimpleIntegration::setupInitialConditions(), MovingWallTangentialPrescribedVelocity::setupInitialConditions(), MultiParticlesInsertion::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), my_problem_HGRID::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), TangentialSpringUnitTest::setupInitialConditions(), ChuteBottom::setupInitialConditions(), ContactDetectionWithWallTester::setupParticleAndWall(), ContactDetectionTester::setupParticles(), TriangleWall::setVertices(), MeshTriangle::setVertices(), Slide::Slide(), FlowFrontChute::stretch(), ContactDetectionTester::testEllipsoidsContact(), ContactDetectionWithWallTester::testEllipsoidsContact(), ContactDetectionTester::testSpheresContact(), ContactDetectionWithWallTester::testSpheresContact(), PeriodicBoundaryHandler::updateParticles(), ClumpParticle::updatePebblesVelPos(), and viscoElasticUnitTest::viscoElasticUnitTest().

◆ setPrescribedAngularVelocity()

void BaseInteractable::setPrescribedAngularVelocity ( const std::function< Vec3D(double)> &  prescribedAngularVelocity)

Allows the angular velocity of the infinite mass interactable to be prescribed.

480 {
481  prescribedAngularVelocity_ = prescribedAngularVelocity;
482 }

References prescribedAngularVelocity_.

◆ setPrescribedOrientation()

void BaseInteractable::setPrescribedOrientation ( const std::function< Quaternion(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.

Parameters
[in]prescribedOrientationstd::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.
453 {
454  prescribedOrientation_ = prescribedOrientation;
455 }

References prescribedOrientation_.

◆ setPrescribedPosition()

void BaseInteractable::setPrescribedPosition ( const 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.

Parameters
[in]prescribedPositionstd::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.
392 {
393  prescribedPosition_ = prescribedPosition;
394 }

References prescribedPosition_.

Referenced by Binary::setupInitialConditions(), my_problem::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), MovingWallPrescribedPosition::setupInitialConditions(), MovingWallPrescribedPositionPrescribedVelocity::setupInitialConditions(), MovingWallTangentialPrescribedPosition::setupInitialConditions(), MovingWallTangentialPrescribedPositionPrescribedVelocity::setupInitialConditions(), and SCoupling< M, O >::updateTriangleWall().

◆ setPrescribedVelocity()

void BaseInteractable::setPrescribedVelocity ( const 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.

Parameters
[in]prescribedVelocitystd::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.
423 {
424  prescribedVelocity_ = prescribedVelocity;
425 }

References prescribedVelocity_.

Referenced by ParticleBeam::ParticleBeam(), BaseWall::setForceControl(), MovingWallPrescribedVelocity::setupInitialConditions(), MovingWallPrescribedPositionPrescribedVelocity::setupInitialConditions(), MovingWallTangentialPrescribedVelocity::setupInitialConditions(), MovingWallTangentialPrescribedPositionPrescribedVelocity::setupInitialConditions(), BaseWall::setVelocityControl(), and SCoupling< M, O >::updateTriangleWall().

◆ setSpecies()

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

Parameters
[in]speciesParticleSpcies pointer which is species holding the physical properties.
164 {
165  logger.assert_debug(species->getHandler() != nullptr && species->getHandler()->getObject(species->getIndex())==species, "Error: Species is not part of any handler yet");
166  species_ = species;
167  indSpecies_ = species->getIndex();
168 }
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:621
SpeciesHandler * getHandler() const
Returns the pointer to the handler to which this species belongs.
Definition: BaseSpecies.cc:78

References BaseSpecies::getHandler(), BaseObject::getIndex(), BaseHandler< T >::getObject(), indSpecies_, logger, and species_.

Referenced by BaseParticle::setSpecies(), and BaseWall::setSpecies().

◆ setTorque()

void BaseInteractable::setTorque ( const Vec3D torque)
inline

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.

Parameters
[in]torqueVec3D which is the force to be applied.
141  { torque_ = torque; }

References torque_.

Referenced by ChangingTOIParticle::actionsAfterTimeStep(), and SmoothChute::actionsBeforeTimeStep().

◆ setVelocity()

void BaseInteractable::setVelocity ( const Vec3D velocity)

set the velocity of the BaseInteractable.

See also BaseInteractable::getVelocity

Parameters
[in]velocityVec3D which is the velocity of the interactable.
329 {
331 }

References Jeffery_Solution::velocity(), and velocity_.

Referenced by ClosedCSCRestart::actionsAfterTimeStep(), ClosedCSCRun::actionsAfterTimeStep(), ClosedCSCWalls::actionsAfterTimeStep(), Slide::actionsBeforeTimeStep(), applyPrescribedVelocity(), LawinenBox::create_inflow_particle(), ChuteWithContraction::create_inflow_particle(), Funnel::create_inflow_particle(), FlowRule::create_inflow_particle(), SilbertPeriodic::create_inflow_particle(), Chute::createBottom(), BaseParticle::fixParticle(), integrateAfterForceComputation(), integrateBeforeForceComputation(), main(), BaseParticle::oldRead(), InfiniteWall::oldRead(), InfiniteWallWithHole::oldRead(), WallHandler::readTriangleWall(), ClosedCSCWalls::saveWalls(), Slide::set_Walls(), SphericalIndenter::setIndenterVelocity(), CFDDEMCoupleTest::setupInitialConditions(), my_problem::setupInitialConditions(), ForceLawsMPI2Test::setupInitialConditions(), TwoByTwoMPIDomainMPI4Test::setupInitialConditions(), ParameterStudy1DDemo::setupInitialConditions(), ParameterStudy2DDemo::setupInitialConditions(), ParameterStudy3DDemo::setupInitialConditions(), Cstatic2d::setupInitialConditions(), Cstatic3D::setupInitialConditions(), statistics_while_running< T >::setupInitialConditions(), HertzSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), GranularCollapse::setupInitialConditions(), SlidingSpheresUnitTest::setupInitialConditions(), Tutorial12::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_MovingReferenceFrame::setupInitialConditions(), MovingWall::setupInitialConditions(), MovingWallReference::setupInitialConditions(), MovingWallSimpleIntegration::setupInitialConditions(), MovingWallTangential::setupInitialConditions(), MovingWallTangentialReference::setupInitialConditions(), MovingWallTangentialSimpleIntegration::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), my_problem_HGRID::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), TangentialSpringUnitTest::setupInitialConditions(), ChuteBottom::setupInitialConditions(), ContactDetectionWithWallTester::setupParticleAndWall(), ContactDetectionTester::setupParticles(), Slide::Slide(), ContactDetectionTester::testSpheresContact(), PeriodicBoundaryHandler::updateParticles(), ClumpParticle::updatePebblesVelPos(), and viscoElasticUnitTest::viscoElasticUnitTest().

◆ sumForceTorqueOMP()

void BaseInteractable::sumForceTorqueOMP ( )
141 {
142  #ifdef MERCURYDPM_USE_OMP
143  for (const auto force : forceOMP_)
144  {
145  force_ += force;
146  }
147 
148  for (const auto torque : torqueOMP_)
149  {
150  torque_ += torque;
151  }
152  #endif
153 }

References force_, forceOMP_, torque_, and torqueOMP_.

Referenced by SphericalIndenter::actionsAfterTimeStep(), and DPMBase::computeAllForces().

◆ write()

void BaseInteractable::write ( std::ostream &  os) const
overridevirtual

Write a BaseInteractable to an output stream.

Parameters
[in]osThe 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

Parameters
[in]osstd::ostream to which the information is written. Note, is any ostream is can be file or screen.
Todo:
take the zero out

Implements BaseObject.

Reimplemented in WearableTriangulatedWall, WearableTriangleMeshWall, WearableNurbsWall, VChute, TriangulatedWall, TriangleWall, TriangleMeshWall, SphericalWall, SineWall, Screw, RestrictedWall, ParabolaChute, NurbsWall, MeshTriangle, IntersectionOfWalls, InfiniteWallWithHole, HorizontalScrew, CylindricalWall, Combtooth, Coil, BasicUnionOfWalls, BasicIntersectionOfWalls, BaseWall, ArcWall, SuperQuadricParticle, ClumpParticle, BaseParticle, SimpleDrumSuperquadrics, ScrewsymmetricIntersectionOfWalls, HorizontalBaseScrew, and AxisymmetricIntersectionOfWalls.

253 {
254  BaseObject::write(os);
255  os << " indSpecies " << indSpecies_
256  << " position " << position_
257  << " orientation " << orientation_
258  //<< " axis " << orientation_.getAxis()
259  << " velocity " << velocity_
260  << " angularVelocity " << angularVelocity_
261  << " force " << force_
262  << " torque " << torque_;
263 }
virtual void write(std::ostream &os) const =0
A purely virtual function which has an implementation which writes the name and the object id_ to the...
Definition: BaseObject.cc:69

References angularVelocity_, force_, indSpecies_, orientation_, position_, torque_, velocity_, and BaseObject::write().

Referenced by BaseParticle::write(), and BaseWall::write().

Member Data Documentation

◆ angularVelocity_

Vec3D BaseInteractable::angularVelocity_
private

Store the angular velocity of the interactable.

Referenced by addAngularVelocity(), BaseInteractable(), getAngularVelocity(), read(), setAngularVelocity(), and write().

◆ force_

Vec3D BaseInteractable::force_
private

Stores the force applied to the interactable.

Referenced by addForce(), BaseInteractable(), getForce(), read(), resetForceTorque(), setForce(), sumForceTorqueOMP(), and write().

◆ forceOMP_

std::vector<Vec3D> BaseInteractable::forceOMP_
private

◆ indSpecies_

unsigned int BaseInteractable::indSpecies_
private

Stores the index on the species associated with this interactable.

Referenced by BaseInteractable(), getIndSpecies(), read(), setIndSpecies(), setSpecies(), and write().

◆ interactions_

std::vector<BaseInteraction*> BaseInteractable::interactions_
private

List of interactions this interactable is involved with.

Referenced by addInteraction(), BaseInteractable(), copyInteractionsForPeriodicParticles(), getInteractions(), removeInteraction(), and ~BaseInteractable().

◆ orientation_

Quaternion BaseInteractable::orientation_
private

Stores the orientation of the interactable. Exactly what is stored depends on the type of interatable

Referenced by BaseInteractable(), getOrientation(), read(), rotate(), setOrientation(), setOrientationViaEuler(), setOrientationViaNormal(), and write().

◆ position_

Vec3D BaseInteractable::position_
private

Stores the position of the interactable. Exactly what is stored depends on the type of interactable.

Referenced by BaseInteractable(), getPosition(), move(), read(), setPosition(), and write().

◆ prescribedAngularVelocity_

std::function<Vec3D(double)> BaseInteractable::prescribedAngularVelocity_
private

User defined functions which if set describes the angular velocity of the interactable.

Referenced by applyPrescribedAngularVelocity(), BaseInteractable(), integrateAfterForceComputation(), integrateBeforeForceComputation(), and setPrescribedAngularVelocity().

◆ prescribedOrientation_

std::function<Quaternion(double)> BaseInteractable::prescribedOrientation_
private

User defined function which if set describes the orientation of the interactable

Referenced by applyPrescribedOrientation(), BaseInteractable(), integrateAfterForceComputation(), integrateBeforeForceComputation(), and setPrescribedOrientation().

◆ prescribedPosition_

std::function<Vec3D(double)> BaseInteractable::prescribedPosition_
private

User defined function which if set describes the position of the interactable

Referenced by applyPrescribedPosition(), BaseInteractable(), integrateAfterForceComputation(), integrateBeforeForceComputation(), and setPrescribedPosition().

◆ prescribedVelocity_

std::function<Vec3D(double)> BaseInteractable::prescribedVelocity_
private

User defined function which if set describes the velocity of the interactable.

Referenced by applyPrescribedVelocity(), BaseInteractable(), integrateAfterForceComputation(), integrateBeforeForceComputation(), and setPrescribedVelocity().

◆ species_

const ParticleSpecies* BaseInteractable::species_
private

Point to the ParticlesSpecies which stores density and other material properties of the interactable.

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

◆ torque_

Vec3D BaseInteractable::torque_
private

Stores the torque applied to the interactable.

Referenced by addTorque(), BaseInteractable(), getTorque(), read(), resetForceTorque(), setTorque(), sumForceTorqueOMP(), and write().

◆ torqueOMP_

std::vector<Vec3D> BaseInteractable::torqueOMP_
private

See BaseInteractable::forceOMP_.

Referenced by addTorque(), resetForceTorque(), and sumForceTorqueOMP().

◆ velocity_

Vec3D BaseInteractable::velocity_
private

Stores the velocity of this interactable.

Referenced by addVelocity(), BaseInteractable(), getVelocity(), read(), setVelocity(), and write().


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