ArcWall.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2023, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef ARCWALL_H
27 #define ARCWALL_H
28 
29 #include "Walls/BaseWall.h"
30 #include <cmath>
31 
32 class WallHandler;
33 
34 class BaseParticle;
35 
36 class BaseWall;
37 
51 class ArcWall : public BaseWall
52 {
53 public:
57  ArcWall();
58 
62  ArcWall(const ArcWall& aw);
63 
67  ~ArcWall() override = default;
68 
82  void set(Vec3D axis, Vec3D pos, Mdouble radius, Vec3D centreline, Mdouble semiangle);
83 
84  ArcWall* copy() const override;
85 
86  bool getDistanceAndNormal(const BaseParticle& p,
87  Mdouble& distance,
88  Vec3D& normal) const override;
89 
91  unsigned timeStamp,
92  InteractionHandler* interactionHandler) override;
93 
94  void read(std::istream& is) override;
95 
96  void write(std::ostream& os) const override;
97 
98  std::string getName() const override;
99 
100 private:
106 };
107 
108 #endif
A wall that is the inside (concave side) of an arc of a cylinder, like a pipe or half-pipe.
Definition: ArcWall.h:52
Mdouble radius_
Definition: ArcWall.h:103
Vec3D pos_
Definition: ArcWall.h:102
~ArcWall() override=default
Default destructor.
std::string getName() const override
A purely virtual function.
Definition: ArcWall.cc:134
Vec3D centreline_
Definition: ArcWall.h:104
void write(std::ostream &os) const override
Write a BaseInteractable to an output stream.
Definition: ArcWall.cc:124
Mdouble semiangle_
Definition: ArcWall.h:105
void set(Vec3D axis, Vec3D pos, Mdouble radius, Vec3D centreline, Mdouble semiangle)
Set parameters of the ArcWall.
Definition: ArcWall.cc:49
void read(std::istream &is) override
Reads a BaseInteractable from an input stream.
Definition: ArcWall.cc:113
Vec3D axis_
Definition: ArcWall.h:101
BaseInteraction * getInteractionWith(BaseParticle *p, unsigned timeStamp, InteractionHandler *interactionHandler) override
Returns the interaction between this object and a given BaseParticle.
Definition: ArcWall.cc:93
ArcWall * copy() const override
Pure virtual function that can be overwritten in inherited classes in order to copy a BaseWall.
Definition: ArcWall.cc:63
ArcWall()
Default constructor.
Definition: ArcWall.cc:31
bool getDistanceAndNormal(const BaseParticle &p, Mdouble &distance, Vec3D &normal) const override
Pure virtual function that computes the distance of a BaseParticle to this wall and returns the norma...
Definition: ArcWall.cc:68
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
Definition: BaseParticle.h:54
Basic class for walls.
Definition: BaseWall.h:49
Container to store Interaction objects.
Definition: InteractionHandler.h:45
Definition: Vector.h:51
Container to store all BaseWall.
Definition: WallHandler.h:44