SimpleDrumSuperquadrics.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 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
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ INFO
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
virtual BaseInteraction * getInteractionWithSuperQuad(SuperQuadricParticle *p, unsigned timeStamp, InteractionHandler *interactionHandler)
Definition: BaseWall.cc:524
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:48
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.
Definition: InfiniteWall.cc:312
Container to store Interaction objects.
Definition: InteractionHandler.h:45
A drum in xz-direction with centre at the origin with a certain radius. Usable with superquadric part...
Definition: SimpleDrumSuperquadrics.h:45
InfiniteWall wall
Definition: SimpleDrumSuperquadrics.h:118
SimpleDrumSuperquadrics * copy() const final
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism.
Definition: SimpleDrumSuperquadrics.cc:73
BaseInteraction * getInteractionWithSuperQuad(SuperQuadricParticle *p, unsigned timeStamp, InteractionHandler *interactionHandler) override
Definition: SimpleDrumSuperquadrics.h:106
bool getDistanceNormalOverlapSuperquadric(const SuperQuadricParticle &p, Mdouble &distance, Vec3D &normal_return, Mdouble &overlap) const override
Definition: SimpleDrumSuperquadrics.cc:102
void setAxis(Vec3D a)
Definition: SimpleDrumSuperquadrics.cc:145
std::string getName() const final
Returns the name of the object.
Definition: SimpleDrumSuperquadrics.cc:140
void setRadius(const Mdouble &radius)
Definition: SimpleDrumSuperquadrics.h:100
SimpleDrumSuperquadrics()
Default constructor.
Definition: SimpleDrumSuperquadrics.cc:31
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...
Definition: SimpleDrumSuperquadrics.cc:88
void read(std::istream &is) final
reads wall
Definition: SimpleDrumSuperquadrics.cc:119
Vec3D getFurthestPointSuperQuadric(const Vec3D &normalBodyFixed, const Vec3D &axes, Mdouble eps1, Mdouble eps2) const override
Definition: SimpleDrumSuperquadrics.h:112
Mdouble radius_
Definition: SimpleDrumSuperquadrics.h:119
~SimpleDrumSuperquadrics() override
Destructor.
Definition: SimpleDrumSuperquadrics.cc:49
void write(std::ostream &os) const final
outputs wall
Definition: SimpleDrumSuperquadrics.cc:130
SimpleDrumSuperquadrics & operator=(const SimpleDrumSuperquadrics &other)
Copy assignment operator.
Definition: SimpleDrumSuperquadrics.cc:58
Definition: SuperQuadricParticle.h:57
Definition: Vector.h:51
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73