SphericalWall.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
9 
10 #ifndef SphericalWall_H
11 #define SphericalWall_H
12 
13 #include "BaseWall.h"
14 #include "Math/Vector.h"
15 
26 class SphericalWall : public BaseWall
27 {
28 public:
29 
33  SphericalWall();
34 
39 
40 
45 
49  ~SphericalWall() override;
50 
54  SphericalWall* copy() const override;
55 
59  void setRadius(Mdouble radius);
60 
61  using BaseWall::move;
62 
66  Mdouble getDistance(const Vec3D& otherPosition) const;
67 
71  Mdouble getRadius() const;
72 
76  bool getDistanceAndNormal(const BaseParticle& p, Mdouble& distance, Vec3D& normal_return) const override;
77 
81  void read(std::istream& is) override;
82 
86  void write(std::ostream& os) const override;
87 
91  std::string getName() const override;
92 
93 private:
99 };
100 
101 #endif
RowVector3d w
Definition: Matrix_resize_int.cpp:3
float * p
Definition: Tutorial_Map_using.cpp:9
virtual void move(const Vec3D &move)
Moves this BaseInteractable by adding an amount to the position.
Definition: BaseInteractable.cc:193
Definition: BaseParticle.h:33
Basic class for walls.
Definition: BaseWall.h:28
Definition: ParticleSpecies.h:16
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: SphericalWall.h:27
std::string getName() const override
Returns the name of the object, in this case the string "SphericalWall".
Definition: SphericalWall.cc:123
void read(std::istream &is) override
Reads SphericalWall from a restart file.
Definition: SphericalWall.cc:104
void write(std::ostream &os) const override
Writes the SphericalWall to an output stream, usually a restart file.
Definition: SphericalWall.cc:114
~SphericalWall() override
Default destructor.
Definition: SphericalWall.cc:36
SphericalWall * copy() const override
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism.
Definition: SphericalWall.cc:44
void setRadius(Mdouble radius)
Defines a spherical wall with radius r.
Definition: SphericalWall.cc:55
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....
Definition: SphericalWall.cc:90
Mdouble radius_
Definition: SphericalWall.h:98
SphericalWall()
Default constructor, the normal is infinitely long.
Definition: SphericalWall.cc:13
Mdouble getDistance(const Vec3D &otherPosition) const
Returns the distance of the wall to the particle.
Definition: SphericalWall.cc:65
Mdouble getRadius() const
Returns the distance of the wall to the particle.
Definition: SphericalWall.cc:73
Definition: Kernel/Math/Vector.h:30
radius
Definition: UniformPSDSelfTest.py:15
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286