37 radius_ = std::numeric_limits<double>::quiet_NaN();
38 logger(
DEBUG,
"SphericalWall::SphericalWall ) finished");
50 logger(
DEBUG,
"SphericalWall::SphericalWall(const SphericalWall &p) finished");
60 logger(
DEBUG,
"SphericalWall::~SphericalWall finished");
79 logger.assert(radius>=0,
"radius=% cannot be negative",radius);
118 normal_return/=distance+
radius_;
147 return "SphericalWall";
SphericalWall * copy() const override
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism.
void write(std::ostream &os) const override
Writes the SphericalWall to an output stream, usually a restart file.
This is a class defining walls.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
SphericalWall()
Default constructor, the normal is infinitely long.
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Mdouble getWallInteractionRadius() const
Returns the interaction radius for interaction with walls. See also BaseParticle::getInteractionRadiu...
void setRadius(Mdouble radius)
Defines a spherical wall with radius r.
std::string getName() const override
Returns the name of the object, in this case the string "SphericalWall".
Mdouble getRadius() const
Returns the distance of the wall to the particle.
bool getDistanceAndNormal(const BaseParticle &p, Mdouble &distance, Vec3D &normal_return) const override
Compute the distance from the wall for a given BaseParticle and return if there is a collision...
Mdouble getLength() const
Calculates the length of this Vec3D: .
Implementation of a 3D vector (by Vitaliy).
virtual ~SphericalWall()
Default destructor.
void write(std::ostream &os) const
Function that writes a BaseWall to an output stream, usually a restart file.
Mdouble getDistance(const Vec3D &otherPosition) const
Returns the distance of the wall to the particle.
void read(std::istream &is)
Function that reads a BaseWall from an input stream, usually a restart file.
void read(std::istream &is) override
Reads SphericalWall from a restart file.