50 #ifdef DEBUG_CONSTRUCTOR
51 std::cout<<
"BaseInteractable::BaseInteractable() finished"<<std::endl;
75 #ifdef DEBUG_CONSTRUCTOR
76 std::cout<<
"BaseInteractable::BaseInteractable(const BaseInteractable &p finished"<<std::endl;
90 #ifdef DEBUG_DESTRUCTOR
91 std::cout<<
"BaseInteractable::~BaseInteractable() finished"<<std::endl;
371 std::cerr <<
"Error in BaseInteractable::removeInteraction: Interaction could not be removed" << std::endl;
450 for (std::list<BaseInteraction*>::const_iterator it = pOriginal.
interactions_.begin(); it != pOriginal.
interactions_.end(); ++it)
453 (*it)->copySwitchPointer(&pOriginal,
this);
unsigned int getIndex() const
Returns the index of the object in the handler.
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.
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.
void setForce(Vec3D force)
Sets the force on this BaseInteractable.
It is an abstract base class due to the purely virtual functions declared below. Even if the function...
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 setPrescribedPosition(std::function< Vec3D(double)> prescribedPosition)
Allows the position of an infinite mass interactable to be prescribed.
void integrateBeforeForceComputation(double time, double timeStep)
This is part of integrate routine for objects with infinite mass.
void setZero()
Sets all elements to zero.
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.
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 ...
#define MERCURY_DEPRECATED
void setPrescribedOrientation(std::function< Vec3D(double)> prescribedOrientation)
Allows the orientation of the infinite mass interactbale to be prescribed.
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_
void setPrescribedVelocity(std::function< Vec3D(double)> prescribedVelocity)
Allows the velocity of an infinite mass interactable to be prescribed.
const Vec3D & getTorque() const
Returns the torque on this BaseInteractable.
std::list< BaseInteraction * > interactions_
std::function< Vec3D(double)> prescribedOrientation_
static Vec3D cross(const Vec3D &a, const Vec3D &b)
Calculates the cross product of two Vec3D: .
void addTorque(Vec3D addTorque)
Adds an amount to the torque on this BaseInteractable.
virtual void read(std::istream &is)=0
A purely virtual method with an implementation which reads the index from the stream and assigns it t...
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.
Defines the basic properties that a interactable object can have.
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.
void setPrescribedAngularVelocity(std::function< Vec3D(double)> prescribedAngularVelocity)
Allows the angular velocity of the infinite mass interactable to be prescribed.
Implementation of a 3D vector (by Vitaliy).
virtual void move(const Vec3D &move)
Moves this BaseInteractable by adding an amount to the position.
void addForce(Vec3D addForce)
Adds an amount to the force on this BaseInteractable.
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
void setTorque(Vec3D torque)
Sets the torque on this BaseInteractable.
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...
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.