MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SimpleDrumSuperquadrics.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 AXISYMMETRICWALL_H
27 #define AXISYMMETRICWALL_H
28 
29 #include "Math/Vector.h"
30 #include "Walls/InfiniteWall.h"
31 
45 {
46 public:
51 
56 
57 
61  ~SimpleDrumSuperquadrics() override;
62 
67 
71  SimpleDrumSuperquadrics* copy() const final;
72 
78  bool getDistanceAndNormal(const BaseParticle& P, Mdouble& distance, Vec3D& normal_return) const override;
79 
80  bool getDistanceNormalOverlapSuperquadric(const SuperQuadricParticle& p, Mdouble& distance, Vec3D& normal_return,
81  Mdouble& overlap) const override;
82 
86  void read(std::istream& is) final;
87 
91  void write(std::ostream& os) const final;
92 
96  std::string getName() const final;
97 
98  void setAxis(Vec3D a);
99 
100  void setRadius(const Mdouble& radius)
101  {
102  radius_ = radius;
103  logger(INFO, "setting drum radius to %", radius_);
104  }
105 
107  InteractionHandler* interactionHandler) override
108  {
109  return wall.getInteractionWithSuperQuad(p, timeStamp, interactionHandler);
110  }
111 
112  Vec3D getFurthestPointSuperQuadric(const Vec3D& normalBodyFixed, const Vec3D& axes, Mdouble eps1, Mdouble eps2) const override
113  {
114  return wall.getFurthestPointSuperQuadric(normalBodyFixed, axes, eps1, eps2);
115  }
116 
117 private:
120 };
121 
122 
123 #endif
void write(std::ostream &os) const final
outputs wall
~SimpleDrumSuperquadrics() override
Destructor.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
double Mdouble
Definition: GeneralDefine.h:34
SimpleDrumSuperquadrics & operator=(const SimpleDrumSuperquadrics &other)
Copy assignment operator.
Vec3D getFurthestPointSuperQuadric(const Vec3D &normalBodyFixed, const Vec3D &axes, Mdouble eps1, Mdouble eps2) const override
bool getDistanceNormalOverlapSuperquadric(const SuperQuadricParticle &p, Mdouble &distance, Vec3D &normal_return, Mdouble &overlap) const override
Stores information about interactions between two interactable objects; often particles but could be ...
std::string getName() const final
Returns the name of the object.
BaseInteraction * getInteractionWithSuperQuad(SuperQuadricParticle *p, unsigned timeStamp, InteractionHandler *interactionHandler) override
Container to store Interaction objects.
A drum in xz-direction with centre at the origin with a certain radius. Usable with superquadric part...
void read(std::istream &is) final
reads wall
SimpleDrumSuperquadrics()
Default constructor.
Basic class for walls.
Definition: BaseWall.h:47
virtual BaseInteraction * getInteractionWithSuperQuad(SuperQuadricParticle *p, unsigned timeStamp, InteractionHandler *interactionHandler)
Definition: BaseWall.cc:494
Vec3D getFurthestPointSuperQuadric(const Vec3D &normalBodyFixed, const Vec3D &axes, Mdouble eps1, Mdouble eps2) const override
Largely untested, use at your own risk for anything other than ellipsoids.
This is a class defining walls.
Definition: InfiniteWall.h:47
Definition: Vector.h:49
bool getDistanceAndNormal(const BaseParticle &P, Mdouble &distance, Vec3D &normal_return) const override
Computes the distance from the wall for a given BaseParticle and returns true if there is a collision...
void setRadius(const Mdouble &radius)
SimpleDrumSuperquadrics * copy() const final
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism.