61 logger(
DEBUG,
"Screw(const Screw&) copy constructor finished.");
83 logger(
DEBUG,
"Screw(Vec3D, Mdouble, Mdouble, Mdouble, Mdouble, Mdouble) constructor finished.");
88 logger(
DEBUG,
"~Screw() finished, destroyed the Screw.");
96 return new Screw(*
this);
160 }
while (fabs(dd / ddd) > 1e-14);
170 unsigned int steps = 0;
178 }
while (fabs(dd / ddd) > 1e-14);
213 normal_return /= normal_return.
getLength();
266 <<
" Radius " <<
maxR_
267 <<
" Revolutions " <<
n_
void setNormal(Vec3D normal)
Sets the normal vector between the two interacting objects.
Mdouble X
the vector components
void read(std::istream &is) override
Reads a Screw from an input stream, for example a restart file.
Mdouble maxR_
The outer radius of the Screw.
This function defines an Archimedes' screw in the z-direction from a (constant) starting point...
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void setOverlap(Mdouble overlap)
Set the overlap between the two interacting object.
bool getDistanceAndNormal(const BaseParticle &P, Mdouble &distance, Vec3D &normal_return) const final
Compute the distance from the Screw for a given BaseParticle and return if there is a collision...
BaseInteraction * getInteraction(BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp)
Returns the Interaction between the BaseInteractable's P and I.
~Screw()
Default destructor.
void setZero()
Sets all elements to zero.
void setContactPoint(Vec3D contactPoint)
Set the location of the contact point between the two interacting objects.
int sign(T val)
This is a sign function, it returns -1 for negative numbers, 1 for positive numbers and 0 for 0...
void move_time(Mdouble dt)
Rotate the Screw for a period dt, so that the offset_ changes with omega_*dt.
void setDistance(Mdouble distance)
Sets the interaction distance between the two interacting objects.
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Stores information about interactions between two interactable objects; often particles but could be ...
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Mdouble getWallInteractionRadius() const
Returns the interaction radius for interaction with walls. See also BaseParticle::getInteractionRadiu...
std::string getName() const final
Returns the name of the object, here the string "Screw".
Vec3D start_
The centre of the lower end of the screw.
Mdouble offset_
The angle that describes how much the Screw has turned, going from 0 to 1 for a rotation.
Container to store Interaction objects.
const Vec3D & getNormal() const
Gets the normal vector between the two interacting objects.
Mdouble l_
The length of the Screw.
Screw * copy() const final
Copy this screw and return a pointer to the copy.
Mdouble getRadius() const
Returns the particle's radius_.
Mdouble getOverlap() const
Returns a Mdouble with the current overlap between the two interacting objects.
void write(std::ostream &os) const override
Writes this Screw to an output stream, for example a restart file.
BaseInteraction * getInteractionWith(BaseParticle *p, Mdouble timeStamp, InteractionHandler *interactionHandler) final
Get the interaction between this Screw and given BaseParticle at a given time.
Mdouble n_
The number of revelations.
Screw()
Default constructor: make a screw with default parameters.
Mdouble thickness_
The thickness of the Screw.
Mdouble omega_
Rotation speed in rev/s.
Implementation of a 3D vector (by Vitaliy).
void write(std::ostream &os) const
Function that writes a BaseWall to an output stream, usually a restart file.
void oldRead(std::istream &is)
Reads a Screw in the old style from an input stream, for example a restart file old style...
void read(std::istream &is)
Function that reads a BaseWall from an input stream, usually a restart file.