26 #ifndef BASEINTERACTABLE_H
27 #define BASEINTERACTABLE_H
76 void read(std::istream& is)
override;
82 void write(std::ostream& os)
const override;
271 virtual void rotate(
const Vec3D& angularVelocityDt);
405 virtual bool isFixed()
const =0;
void setPrescribedVelocity(const std::function< Vec3D(double)> &prescribedVelocity)
Allows the velocity of an infinite mass interactable to be prescribed.
Implementation of a 3D quaternion (by Vitaliy).
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
void addVelocity(const Vec3D &velocity)
adds an increment to the velocity.
std::function< Vec3D(double)> prescribedAngularVelocity_
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
void applyPrescribedPosition(double time)
Computes the position from the user defined prescribed position function.
const ParticleSpecies * getSpecies() const
Returns a pointer to the species of this BaseInteractable.
void addForce(const Vec3D &addForce)
Adds an amount to the force on this BaseInteractable.
void resetForceTorque(int numberOfOMPthreads)
bool removeInteraction(BaseInteraction *I)
Removes an interaction from this BaseInteractable.
void addInteraction(BaseInteraction *I)
Adds an interaction to this BaseInteractable.
void applyPrescribedAngularVelocity(double time)
Computes the angular velocity from the user defined prescribed angular velocity.
It is an abstract base class due to the purely virtual functions declared below. Even if the function...
void setPrescribedAngularVelocity(const std::function< Vec3D(double)> &prescribedAngularVelocity)
Allows the angular velocity of the infinite mass interactable to be prescribed.
virtual const Vec3D getVelocityAtContact(const Vec3D &contact) const
Returns the velocity at the contact point, use by many force laws.
virtual BaseInteraction * getInteractionWith(BaseParticle *P, unsigned timeStamp, InteractionHandler *interactionHandler)=0
Returns the interaction between this object and a given BaseParticle.
virtual bool isFixed() const =0
void applyPrescribedOrientation(double time)
Computes the orientation from the user defined prescribed orientation function.
void integrateBeforeForceComputation(double time, double timeStep)
This is part of integrate routine for objects with infinite mass.
std::function< Quaternion(double)> prescribedOrientation_
void setOrientationViaEuler(Vec3D eulerAngle)
Sets the orientation of this BaseInteractable by defining the euler angles.
void setPrescribedOrientation(const std::function< Quaternion(double)> &prescribedOrientation)
Allows the orientation of the infinite mass interactbale to be prescribed.
virtual const Vec3D & getAngularVelocity() const
Returns the angular velocity of this interactable.
const Vec3D & getForce() const
Returns the force on this BaseInteractable.
std::function< Vec3D(double)> prescribedPosition_
void setPrescribedPosition(const std::function< Vec3D(double)> &prescribedPosition)
Allows the position of an infinite mass interactable to be prescribed.
Stores information about interactions between two interactable objects; often particles but could be ...
void addAngularVelocity(const Vec3D &angularVelocity)
add an increment to the angular velocity.
void setSpecies(const ParticleSpecies *species)
Sets the species of this BaseInteractable.
void write(std::ostream &os) const override
Write a BaseInteractable to an output stream.
const ParticleSpecies * species_
std::vector< Vec3D > torqueOMP_
std::function< Vec3D(double)> prescribedVelocity_
std::vector< BaseInteraction * > interactions_
Container to store Interaction objects.
void copyInteractionsForPeriodicParticles(const BaseInteractable &p)
Copies interactions to this BaseInteractable whenever a periodic copy made.
std::vector< Vec3D > forceOMP_
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
const Vec3D & getTorque() const
Returns the torque on this BaseInteractable.
virtual void rotate(const Vec3D &angularVelocityDt)
Rotates this BaseInteractable.
void applyPrescribedVelocity(double time)
Computes the velocity from the user defined prescribed velocity function.
void setForce(const Vec3D &force)
Sets the force on this BaseInteractable.
const std::vector< BaseInteraction * > & getInteractions() const
Returns a list of interactions which belong to this interactable.
void setOrientationViaNormal(Vec3D normal)
Sets the orientation of this BaseInteractable by defining the vector that results from the rotation o...
void setTorque(const Vec3D &torque)
Sets the torque on this BaseInteractable.
Defines the basic properties that a interactable object can have.
void setOrientation(const Quaternion &orientation)
Sets the orientation of this BaseInteractable.
void addTorque(const Vec3D &addTorque)
Adds an amount to the torque on this BaseInteractable.
unsigned int getIndSpecies() const
Returns the index of the species associated with the interactable object.
virtual Mdouble getCurvature(const Vec3D &labFixedCoordinates) const
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
virtual void move(const Vec3D &move)
Moves this BaseInteractable by adding an amount to the position.
const Quaternion & getOrientation() const
Returns the orientation of this BaseInteractable.
virtual Mdouble getInvMass() const
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
void read(std::istream &is) override
Reads a BaseInteractable from an input stream.
BaseInteractable()
Default BaseInteractable constructor.
void integrateAfterForceComputation(double time, double timeStep)
This is part of the integration routine for objects with infinite mass.
virtual void setIndSpecies(unsigned int indSpecies)
Sets the index of the Species of this BaseInteractable.
~BaseInteractable() override
Destructor, it simply destructs the BaseInteractable and all the objects it contains.