Screw.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 SCREW_H
6 #define SCREW_H
7 
8 #include "BaseWall.h"
9 #include "Math/Vector.h"
10 
14 enum class ScrewType {singleHelix = 1, doubleHelix = 2};
15 
22 class Screw : public BaseWall
23 {
24 public:
25 
29  Screw();
30 
34  Screw(const Screw& other);
35 
40 
44  ~Screw() override;
45 
49  Screw* copy() const final;
50 
54  bool getDistanceAndNormal(const BaseParticle& P, Mdouble& distance, Vec3D& normal_return) const final;
55 
56  bool getDistanceAndNormalLabCoordinates(Vec3D position, Mdouble wallInteractionRadius, Mdouble& distance,
57  Vec3D& normal_return) const;
58 
62  void move_time(Mdouble dt);
63 
64  //MERCURYDPM_DEPRECATED
65  void rotate(const Vec3D& angularVelocityDt) override;
66 
70  void read(std::istream& is) override;
71 
75  void oldRead(std::istream& is);
76 
80  void write(std::ostream& os) const override;
81 
85  std::string getName() const final;
86 
87  void writeVTK(VTKContainer& vtk) const override;
88 
89  void writeVTK(std::string filename) const;
90 
91 private:
124 };
125 
126 #endif
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
ScrewType
Definition: Screw.h:14
Definition: BaseParticle.h:33
Basic class for walls.
Definition: BaseWall.h:28
This function defines an Archimedes' screw in the z-direction from a (constant) starting point,...
Definition: Screw.h:23
Mdouble thickness_
The thickness of the Screw.
Definition: Screw.h:119
void writeVTK(VTKContainer &vtk) const override
Definition: Screw.cc:344
Vec3D start_
The centre of the lower end of the screw.
Definition: Screw.h:95
Mdouble l_
The length of the Screw.
Definition: Screw.h:99
void oldRead(std::istream &is)
Reads a Screw in the old style from an input stream, for example a restart file old style.
Definition: Screw.cc:309
bool getDistanceAndNormal(const BaseParticle &P, Mdouble &distance, Vec3D &normal_return) const final
Compute the distance from the Screw for a given BaseParticle and return if there is a collision....
Definition: Screw.cc:87
void write(std::ostream &os) const override
Writes this Screw to an output stream, for example a restart file.
Definition: Screw.cc:323
Mdouble maxR_
The outer radius of the Screw.
Definition: Screw.h:103
std::string getName() const final
Returns the name of the object, here the string "Screw".
Definition: Screw.cc:339
Mdouble n_
The number of revelations.
Definition: Screw.h:107
ScrewType screwType_
Single or double helix screw.
Definition: Screw.h:123
Mdouble omega_
Rotation speed in rev/s.
Definition: Screw.h:111
Screw * copy() const final
Copy this screw and return a pointer to the copy.
Definition: Screw.cc:82
Screw()
Default constructor: make a screw with default parameters.
Definition: Screw.cc:20
void move_time(Mdouble dt)
Rotate the Screw for a period dt, so that the offset_ changes with omega_*dt.
Definition: Screw.cc:268
bool getDistanceAndNormalLabCoordinates(Vec3D position, Mdouble wallInteractionRadius, Mdouble &distance, Vec3D &normal_return) const
Definition: Screw.cc:117
Mdouble offset_
The angle that describes how much the Screw has turned, going from 0 to 1 for a rotation.
Definition: Screw.h:115
~Screw() override
Default destructor.
Definition: Screw.cc:74
void rotate(const Vec3D &angularVelocityDt) override
Definition: Screw.cc:277
void read(std::istream &is) override
Reads a Screw from an input stream, for example a restart file.
Definition: Screw.cc:287
Definition: Kernel/Math/Vector.h:30
Vector::Scalar omega(const Vector &t, const Vector &s, RealScalar angle)
Definition: IDRS.h:36
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77
string filename
Definition: MergeRestartFiles.py:39
r
Definition: UniformPSDSelfTest.py:20
void start(const unsigned &i)
(Re-)start i-th timer
Definition: oomph_utilities.cc:243
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
Definition: BaseWall.h:17