MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HorizontalScrew.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 HorizontalScrew_H
27 #define HorizontalScrew_H
28 
29 #include "Walls/BaseWall.h"
30 #include "Math/Vector.h"
31 
38 class HorizontalScrew : public BaseWall
39 {
40 public:
41 
46 
50  HorizontalScrew(const HorizontalScrew& other);
51 
55  HorizontalScrew(Vec3D start, Mdouble l, Mdouble minR, Mdouble lowerR, Mdouble diffR, Mdouble n, Mdouble omega, Mdouble thickness, const ParticleSpecies* s);
56 
61 
65  HorizontalScrew* copy() const final;
66 
70  bool getDistanceAndNormal(const BaseParticle& P, Mdouble& distance, Vec3D& normal_return) const final;
71 
75  Mdouble getLength() const;
76 
80  Vec3D getStart() const;
81 
85  void move_time(Mdouble dt);
86 
90  void read(std::istream& is) override;
91 
95  void write(std::ostream& os) const override;
96 
100  std::string getName() const final;
101 
102  void writeVTK (VTKContainer& vtk) const override;
103 
104  void setBlades(const Mdouble bladeWidth, const Mdouble bladeLength,const std::vector<Mdouble> bladeMounts);
105 
106 private:
118  Mdouble minR_; // min max radius
119  Mdouble lowerR_; // max Radius at the base
120  Mdouble diffR_; // max radius at the top
148  std::vector<Mdouble> bladeMounts_;
149 };
150 
151 #endif
~HorizontalScrew()
Default destructor.
Mdouble bladeLength_
The length of a blade (in the q-coordinate, which is a linear mapping from start.Z
void read(std::istream &is) override
Reads a HorizontalScrew from an input stream, for example a restart file.
double Mdouble
Definition: GeneralDefine.h:34
HorizontalScrew * copy() const final
Copy this screw and return a pointer to the copy.
HorizontalScrew()
Default constructor: make a screw with default parameters.
Vec3D getStart() const
Returns the starting position of the HorizontalScrew.
bool getDistanceAndNormal(const BaseParticle &P, Mdouble &distance, Vec3D &normal_return) const final
Compute the distance from the HorizontalScrew for a given BaseParticle and return if there is a colli...
Mdouble bladeWidth_
The maximum radial width of a blade (in r).
void writeVTK(VTKContainer &vtk) const override
Mdouble offset_
The angle that describes how much the HorizontalScrew has turned, going from 0 to 1 for a rotation...
void setBlades(const Mdouble bladeWidth, const Mdouble bladeLength, const std::vector< Mdouble > bladeMounts)
Mdouble getLength() const
Returns the length of the HorizontalScrew.
Mdouble l_
The length of the HorizontalScrew.
Mdouble thickness_
The thickness of the HorizontalScrew.
This function defines an Archimedes' screw in the z-direction from a (constant) starting point...
Basic class for walls.
Definition: BaseWall.h:47
void write(std::ostream &os) const override
Writes this HorizontalScrew to an output stream, for example a restart file.
void move_time(Mdouble dt)
Rotate the HorizontalScrew for a period dt, so that the offset_ changes with omega_*dt.
std::vector< Mdouble > bladeMounts_
The starting point of a blade (in the q-coordinate, which is a linear mapping from start...
Vec3D start_
The centre of the lower end of the screw.
Mdouble omega_
Rotation speed in rev/s.
Mdouble n_
The number of revelations.
Definition: Vector.h:49
Mdouble minR_
The outer radius of the HorizontalScrew.
std::string getName() const final
Returns the name of the object, here the string "HorizontalScrew".