MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Coil.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 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
~Coil() override
Default destructor.
Definition: Coil.cc:84
Vec3D start_
The centre of the lower end of the Coil.
Definition: Coil.h:111
double Mdouble
Definition: GeneralDefine.h:34
void set(Vec3D Start, Mdouble length, Mdouble radius, Mdouble numberOfRevelations, Mdouble omega, Mdouble thickness)
Set all parameters of this Coil.
Definition: Coil.cc:102
#define MERCURY_DEPRECATED
Definition: GeneralDefine.h:37
Mdouble offset_
Definition: Coil.h:136
void read(std::istream &is) override
Reads a Coil from an input stream, for example a restart file.
Definition: Coil.cc:222
void write(std::ostream &os) const override
Writes a Coil to an output stream, for example a restart file.
Definition: Coil.cc:251
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
Basic class for walls.
Definition: BaseWall.h:47
Mdouble l_
The length of the Coil.
Definition: Coil.h:116
Mdouble n_
Definition: Coil.h:126
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 r_
Definition: Coil.h:121
Coil * copy() const override
Copy this Coil and return a pointer to the copy, useful for polymorphism.
Definition: Coil.cc:116
Coil()
Default constructor, sets a coil with default parameters.
Definition: Coil.cc:35
Mdouble thickness_
Definition: Coil.h:141
Definition: Vector.h:49
MERCURY_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
This class defines a coil in the z-direction from a (constant) starting point, a (constant) length L...
Definition: Coil.h:40
Mdouble omega_
Definition: Coil.h:131
std::string getName() const override
Returns the name of the object, in this case the string "Coil".
Definition: Coil.cc:266