floatingJoint.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "floatingJoint.H"
27 #include "rigidBodyModel.H"
29 
30 #include "Rs.H"
31 #include "Rzyx.H"
32 #include "Pxyz.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 namespace RBD
39 {
40 namespace joints
41 {
42  defineTypeNameAndDebug(floating, 0);
43 
45  (
46  joint,
47  floating,
48  dictionary
49  );
50 }
51 }
52 }
53 
54 
55 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
56 
58 Foam::RBD::joints::floating::sixDoF()
59 {
60  PtrList<joint> cj(2);
61  cj.set(0, new joints::Pxyz());
62 
63  // The quaternion-based spherical joint could be used
64  // but then w must be set appropriately
65  //cj.set(1, new joints::Rs());
66 
67  // Alternatively the Euler-angle joint can be used
68  cj.set(1, new joints::Rzyx());
69 
70  return autoPtr<composite>(new composite(cj));
71 }
72 
73 
74 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
75 
77 :
78  composite(sixDoF())
79 {}
80 
81 
83 :
84  composite(sixDoF())
85 {}
86 
87 
89 {
90  return autoPtr<joint>(new floating(*this));
91 }
92 
93 
94 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
95 
97 {}
98 
99 
100 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
101 
103 {
104  joint::write(os);
105 }
106 
107 
108 // ************************************************************************* //
dictionary dict
virtual ~floating()
Destructor.
Definition: floatingJoint.C:96
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual autoPtr< joint > clone() const
Clone this joint.
Definition: floatingJoint.C:88
defineTypeNameAndDebug(composite, 0)
virtual void write(Ostream &) const
Write.
addToRunTimeSelectionTable(joint, composite, dictionary)
Macros for easy insertion into run-time selection tables.
Prismatic joint for translation along the specified arbitrary axis.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual void write(Ostream &) const
Write.
Definition: joint.C:81
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Namespace for OpenFOAM.