ScrewsymmetricIntersectionOfWalls.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 
5 #ifndef SCREWSYMMETRICINTERSECTIONOFWALLS_H
6 #define SCREWSYMMETRICINTERSECTIONOFWALLS_H
7 
8 #include "IntersectionOfWalls.h"
9 #include "InteractionHandler.h"
10 #include "Math/Vector.h"
11 
105 {
106 public:
111 
116 
120  ScrewsymmetricIntersectionOfWalls(Vec3D position, Vec3D normal, std::vector<normalAndPosition> walls,
121  const ParticleSpecies* species);
122 
127 
132 
137 
143  bool getDistanceAndNormal(const BaseParticle& P, Mdouble& distance, Vec3D& normal_return) const final;
144 
145  void computeNormalRadialDeltaN(const Vec3D& positionLabFrame, Vec3D& normalVector, Vec3D& radialVector, Mdouble& deltaN) const;
146 
147  Mdouble computeDeltaZ(const Vec3D& positionLabFrame, Mdouble h, Mdouble pitch) const;
148 
152  void read(std::istream& is) final;
153 
157  void write(std::ostream& os) const final;
158 
162  std::string getName() const final;
163 
164  void setAxis(Vec3D a);
165 
167  void convertLimits(Vec3D& min, Vec3D& max) const;
168 
169  void writeVTK(VTKContainer& vtk) const override;
170 
171  void setRightHandedness(bool rightHandedness) {rightHandedness_=rightHandedness;}
172  bool getRightHandedness() const {return rightHandedness_;}
173 
174  void setPitch(Mdouble pitch) {pitch_=pitch;}
175  Mdouble getPitch() const {return pitch_;}
176 
177  void setThickness(Mdouble thickness) {thickness_=thickness;}
178  Mdouble getThickness() const {return thickness_;}
179 
180  void setLength(Mdouble length) {length_=length;}
181  Mdouble getLength() const {return length_;}
182 
184  bool rightHandedness_ = true;
185 
186 // void setPointsAndLines(unsigned int n) override {
187 // IntersectionOfWalls::setPointsAndLines(n);
188 // rMax_ = 0;
189 // for (auto p : C_) {
190 // rMax_ = std::max(rMax_,p.X);
191 // }
192 // logger(INFO,"rMax=%",rMax_);
193 // }
194 
195 
196 private:
197 
202 
205 
208 
209 // ///\brief The outer screw blade radius.
210 // Mdouble rMax_ = 0;
211 };
212 
213 
214 #endif
float * p
Definition: Tutorial_Map_using.cpp:9
Definition: BaseParticle.h:33
A IntersectionOfWalls is convex polygon defined as an intersection of InfiniteWall's.
Definition: IntersectionOfWalls.h:38
Definition: ParticleSpecies.h:16
Use ScrewsymmetricIntersectionOfWalls to define screwsymmetric walls, such as cylinders,...
Definition: ScrewsymmetricIntersectionOfWalls.h:105
Mdouble getThickness() const
Definition: ScrewsymmetricIntersectionOfWalls.h:178
~ScrewsymmetricIntersectionOfWalls() override
Destructor.
Definition: ScrewsymmetricIntersectionOfWalls.cc:37
Mdouble pitch_
Definition: ScrewsymmetricIntersectionOfWalls.h:201
Mdouble getLength() const
Definition: ScrewsymmetricIntersectionOfWalls.h:181
void setThickness(Mdouble thickness)
Definition: ScrewsymmetricIntersectionOfWalls.h:177
ScrewsymmetricIntersectionOfWalls * copy() const final
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism.
Definition: ScrewsymmetricIntersectionOfWalls.cc:61
Mdouble getPitch() const
Definition: ScrewsymmetricIntersectionOfWalls.h:175
Mdouble length_
The length of the screw.
Definition: ScrewsymmetricIntersectionOfWalls.h:207
std::string getName() const final
Returns the name of the object.
Definition: ScrewsymmetricIntersectionOfWalls.cc:253
void setRightHandedness(bool rightHandedness)
Definition: ScrewsymmetricIntersectionOfWalls.h:171
ScrewsymmetricIntersectionOfWalls()
Default constructor.
Definition: ScrewsymmetricIntersectionOfWalls.cc:11
ScrewsymmetricIntersectionOfWalls & operator=(const ScrewsymmetricIntersectionOfWalls &other)
Copy assignment operator.
Definition: ScrewsymmetricIntersectionOfWalls.cc:46
Mdouble computeDeltaZ(const Vec3D &positionLabFrame, Mdouble h, Mdouble pitch) const
Definition: ScrewsymmetricIntersectionOfWalls.cc:188
bool rightHandedness_
The right handedness of the screw, i.e. the direction of the screw-blade.
Definition: ScrewsymmetricIntersectionOfWalls.h:184
bool getRightHandedness() const
Definition: ScrewsymmetricIntersectionOfWalls.h:172
void setAxis(Vec3D a)
Definition: ScrewsymmetricIntersectionOfWalls.cc:258
void read(std::istream &is) final
reads wall
Definition: ScrewsymmetricIntersectionOfWalls.cc:236
void setPitch(Mdouble pitch)
Definition: ScrewsymmetricIntersectionOfWalls.h:174
void writeVTK(VTKContainer &vtk) const override
Definition: ScrewsymmetricIntersectionOfWalls.cc:277
void setLength(Mdouble length)
Definition: ScrewsymmetricIntersectionOfWalls.h:180
void computeNormalRadialDeltaN(const Vec3D &positionLabFrame, Vec3D &normalVector, Vec3D &radialVector, Mdouble &deltaN) const
Definition: ScrewsymmetricIntersectionOfWalls.cc:131
void write(std::ostream &os) const final
outputs wall
Definition: ScrewsymmetricIntersectionOfWalls.cc:245
bool getDistanceAndNormal(const BaseParticle &P, Mdouble &distance, Vec3D &normal_return) const final
Computes the distance from the wall for a given BaseParticle and returns true if there is a collision...
Definition: ScrewsymmetricIntersectionOfWalls.cc:76
Mdouble thickness_
The thickness of the screw blade.
Definition: ScrewsymmetricIntersectionOfWalls.h:204
void convertLimits(Vec3D &min, Vec3D &max) const
Definition: ScrewsymmetricIntersectionOfWalls.cc:263
Definition: Kernel/Math/Vector.h:30
#define min(a, b)
Definition: datatypes.h:22
#define max(a, b)
Definition: datatypes.h:23
const Scalar * a
Definition: level2_cplx_impl.h:32
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
Definition: BaseWall.h:17