59 logger(
DEBUG,
"Coil(const Coil&) copy constructor finished");
81 logger(
DEBUG,
"Coil(params) constructor with parameters finished.");
107 n_ = numberOfRevelations;
118 return new Coil(*
this);
136 if (Rsqr > pow(
r_ + interactionRadius, 2) ||
137 Rsqr < pow(
r_ - interactionRadius, 2) ||
176 2.0 *
l_ * (dz - q *
l_);
180 }
while (fabs(dd / ddd) > 1e-14);
202 distance = sqrt(distanceSquared) -
thickness_;
207 normal_return /= normal_return.
getLength();
243 >> dummy >>
r_ >> dummy >>
n_
257 <<
" Revolutions " <<
n_
~Coil() override
Default destructor.
Vec3D start_
The centre of the lower end of the Coil.
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Mdouble X
the vector components
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here...
void setZero()
Sets all elements to zero.
void write(std::ostream &os) const override
Function that writes a BaseWall to an output stream, usually a restart file.
void set(Vec3D Start, Mdouble length, Mdouble radius, Mdouble numberOfRevelations, Mdouble omega, Mdouble thickness)
Set all parameters of this Coil.
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Mdouble getWallInteractionRadius(const BaseWall *wall) const
returns the radius plus the interactionDistance
void read(std::istream &is) override
Reads a Coil from an input stream, for example a restart file.
void write(std::ostream &os) const override
Writes a Coil to an output stream, for example a restart file.
bool getDistanceAndNormal(const BaseParticle &P, Mdouble &distance, Vec3D &normal_return) const override
Compute the distance from the Coil for a given BaseParticle and return if there is a collision...
void read(std::istream &is) override
Function that reads a BaseWall from an input stream, usually a restart file.
Mdouble l_
The length of the Coil.
Mdouble round(const Mdouble value, unsigned precision)
void move_time(Mdouble dt)
Rotate the Coil for a period dt, so that the offset_ changes with omega_*dt.
Coil * copy() const override
Copy this Coil and return a pointer to the copy, useful for polymorphism.
Coil()
Default constructor, sets a coil with default parameters.
T square(const T val)
squares a number
MERCURY_DEPRECATED void oldRead(std::istream &is)
Reads an old-style Coil from an input stream, for example an old restart file.
This class defines a coil in the z-direction from a (constant) starting point, a (constant) length L...
std::string getName() const override
Returns the name of the object, in this case the string "Coil".