MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VChute.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2020, 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 VCHUTE_H
27 #define VCHUTE_H
28 
29 #include "BaseWall.h"
30 #include "Math/Vector.h"
31 
32 /* A finite-length V-chute. */
33 
34 class VChute : public BaseWall
35 {
36 public:
37  VChute();
38 
39  VChute(const VChute& other);
40 
41  VChute(Mdouble length, Mdouble width, Mdouble alpha);
42 
43  ~VChute() override;
44 
45  void set(Mdouble length, Mdouble width, Mdouble alpha);
46 
47  VChute* copy() const override;
48 
49  // wheeee virtual mc virty-virtual
50  bool getDistanceAndNormal(const BaseParticle& p, Mdouble& distance, Vec3D& normal_return) const override;
51 
53  getInteractionWith(BaseParticle* p, unsigned timeStamp, InteractionHandler* interactionHandler) override;
54 
55  void read(std::istream& is) override;
56 
57  void write(std::ostream& os) const override;
58 
59  std::string getName() const override;
60 
61 private:
62  Mdouble l_; // length
63  Mdouble w_; // width
64  Mdouble alpha_; // alpha, in radians (V-ness)
65 };
66 
67 #endif
BaseInteraction * getInteractionWith(BaseParticle *p, unsigned timeStamp, InteractionHandler *interactionHandler) override
Returns the interaction between this wall and a given particle, nullptr if there is no interaction...
Definition: VChute.cc:148
double Mdouble
Definition: GeneralDefine.h:34
void set(Mdouble length, Mdouble width, Mdouble alpha)
Definition: VChute.cc:56
std::string getName() const override
Definition: VChute.cc:192
Stores information about interactions between two interactable objects; often particles but could be ...
Mdouble l_
Definition: VChute.h:62
Definition: VChute.h:34
Container to store Interaction objects.
Mdouble alpha_
Definition: VChute.h:64
Basic class for walls.
Definition: BaseWall.h:47
VChute * copy() const override
Pure virtual function that can be overwritten in inherited classes in order to copy a BaseWall...
Definition: VChute.cc:63
VChute()
Definition: VChute.cc:33
void read(std::istream &is) override
Definition: VChute.cc:169
Mdouble w_
Definition: VChute.h:63
bool getDistanceAndNormal(const BaseParticle &p, Mdouble &distance, Vec3D &normal_return) const override
Pure virtual function that computes the distance of a BaseParticle to this wall and returns the norma...
Definition: VChute.cc:68
Definition: Vector.h:49
~VChute() override
void write(std::ostream &os) const override
Definition: VChute.cc:181