26 #ifndef BASEINTERACTABLE_H
27 #define BASEINTERACTABLE_H
75 virtual void read(std::istream& is) = 0;
81 virtual void write(std::ostream& os)
const = 0;
void setPrescribedVelocity(const std::function< Vec3D(double)> &prescribedVelocity)
Allows the velocity of an infinite mass interactable to be prescribed.
void rotate(const Vec3D &rotate)
Rotates this BaseInteractable.
std::function< Vec3D(double)> prescribedPosition_
void addVelocity(const Vec3D &velocity)
adds an increment to the velocity.
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 Vec3D & getForce() const
Returns the force on this BaseInteractable.
void addForce(const Vec3D &addForce)
Adds an amount to the force on this BaseInteractable.
std::function< Vec3D(double)> prescribedVelocity_
void setOrientation(const Vec3D &orientation)
Sets the orientation of this BaseInteractable.
bool removeInteraction(BaseInteraction *I)
Removes an interaction from this BaseInteractable.
void addInteraction(BaseInteraction *I)
Adds an interaction to this BaseInteractable.
const ParticleSpecies * getSpecies() const
Returns a pointer to the species of 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.
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.
virtual const Vec3D & getAngularVelocity() const
Returns the angular velocity of this interactable.
virtual ~BaseInteractable()
Destructor, it simply destructs the BaseInteractable and all the objects it contains.
virtual std::vector< BaseInteraction * > getInteractionWith(BaseParticle *P, Mdouble timeStamp, InteractionHandler *interactionHandler)=0
Returns the interaction between this object and a given BaseParticle.
void setPrescribedPosition(const std::function< Vec3D(double)> &prescribedPosition)
Allows the position of an infinite mass interactable to be prescribed.
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
const Vec3D & getOrientation() const
Returns the orientation of this BaseInteractable.
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.
virtual void read(std::istream &is)=0
Reads a BaseInteractable from an input stream.
const ParticleSpecies * species_
Container to store Interaction objects.
const Vec3D & getTorque() const
Returns the torque on this BaseInteractable.
std::list< BaseInteraction * > interactions_
std::function< Vec3D(double)> prescribedOrientation_
void copyInteractionsForPeriodicParticles(const BaseInteractable &p)
Copies interactions to this BaseInteractable whenever a periodic copy made.
virtual void setIndSpecies(unsigned int indSpecies)
Sets the index of the Species of this BaseInteractable.
void setPosition(const Vec3D &position)
Sets the position of 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.
void setTorque(const Vec3D &torque)
Sets the torque on this BaseInteractable.
Defines the basic properties that a interactable object can have.
void addTorque(const Vec3D &addTorque)
Adds an amount to the torque on this BaseInteractable.
std::function< Vec3D(double)> prescribedAngularVelocity_
const std::list< BaseInteraction * > & getInteractions() const
Returns a reference to the list of interactions in this BaseInteractable.
unsigned int getIndSpecies() const
Returns the index of the Species of this BaseInteractable.
virtual void write(std::ostream &os) const =0
Write a BaseInteractable to an output stream.
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Implementation of a 3D vector (by Vitaliy).
virtual void move(const Vec3D &move)
Moves this BaseInteractable by adding an amount to the position.
void setPrescribedOrientation(const std::function< Vec3D(double)> &prescribedOrientation)
Allows the orientation of the infinite mass interactbale to be prescribed.
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
BaseInteractable()
Default BaseInteractable constructor, it simply creates an empty BaseInteractable.
void integrateAfterForceComputation(double time, double timeStep)
This is part of the integration routine for objects with infinite mass.