Coil.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 COIL_H
27 #define COIL_H
28 
29 #include "BaseWall.h"
30 #include "Math/Vector.h"
31 
40 class Coil : public BaseWall
41 {
42 public:
46  Coil();
47 
51  Coil(const Coil& other);
52 
56  Coil(Vec3D Start, Mdouble L, Mdouble r, Mdouble N, Mdouble omega, Mdouble thickness);
57 
61  ~Coil() override;
62 
66  void
67  set(Vec3D Start, Mdouble length, Mdouble radius, Mdouble numberOfRevelations, Mdouble omega, Mdouble thickness);
68 
72  Coil* copy() const override;
73 
77  bool getDistanceAndNormal(const BaseParticle& P, Mdouble& distance, Vec3D& normal_return) const override;
78 
82  void move_time(Mdouble dt);
83 
87  void read(std::istream& is) override;
88 
95  void oldRead(std::istream& is);
96 
100  void write(std::ostream& os) const override;
101 
105  std::string getName() const override;
106 
107 private:
112 
117 
122 
127 
132 
137 
142 };
143 
144 #endif
#define MERCURYDPM_DEPRECATED
Definition: GeneralDefine.h:37
Definition: BaseParticle.h:54
Basic class for walls.
Definition: BaseWall.h:49
This class defines a coil in the z-direction from a (constant) starting point, a (constant) length L,...
Definition: Coil.h:41
bool getDistanceAndNormal(const BaseParticle &P, Mdouble &distance, Vec3D &normal_return) const override
Compute the distance from the Coil for a given BaseParticle and return if there is a collision....
Definition: Coil.cc:132
Coil()
Default constructor, sets a coil with default parameters.
Definition: Coil.cc:35
void write(std::ostream &os) const override
Writes a Coil to an output stream, for example a restart file.
Definition: Coil.cc:251
Coil * copy() const override
Copy this Coil and return a pointer to the copy, useful for polymorphism.
Definition: Coil.cc:116
MERCURYDPM_DEPRECATED void oldRead(std::istream &is)
Reads an old-style Coil from an input stream, for example an old restart file.
Definition: Coil.cc:238
Mdouble n_
Definition: Coil.h:126
Mdouble thickness_
Definition: Coil.h:141
void set(Vec3D Start, Mdouble length, Mdouble radius, Mdouble numberOfRevelations, Mdouble omega, Mdouble thickness)
Set all parameters of this Coil.
Definition: Coil.cc:102
Mdouble omega_
Definition: Coil.h:131
~Coil() override
Default destructor.
Definition: Coil.cc:84
Mdouble l_
The length of the Coil.
Definition: Coil.h:116
std::string getName() const override
Returns the name of the object, in this case the string "Coil".
Definition: Coil.cc:266
void read(std::istream &is) override
Reads a Coil from an input stream, for example a restart file.
Definition: Coil.cc:222
Mdouble r_
Definition: Coil.h:121
Vec3D start_
The centre of the lower end of the Coil.
Definition: Coil.h:111
void move_time(Mdouble dt)
Rotate the Coil for a period dt, so that the offset_ changes with omega_*dt.
Definition: Coil.cc:214
Mdouble offset_
Definition: Coil.h:136
Definition: Vector.h:51
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73