compositeJoint.H
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 Class
25  Foam::RBD::joints::composite
26 
27 Description
28  Prismatic joint for translation along the specified arbitrary axis.
29 
30  Reference:
31  \verbatim
32  Featherstone, R. (2008).
33  Rigid body dynamics algorithms.
34  Springer.
35  Chapter 4.
36  \endverbatim
37 
38 SourceFiles
39  composite.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef RBD_joints_composite_H
44 #define RBD_joints_composite_H
45 
46 #include "joint.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace RBD
53 {
54 
55 // Forward declaration of classes
56 class rigidBodyModel;
57 
58 namespace joints
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class composite Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class composite
66 :
67  public PtrList<joint>,
68  public joint
69 {
70  // Private member functions
71 
72  //- Set the properties of the last joint following construction
73  // of the body containing the joint
74  void setLastJoint();
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("composite");
81 
82  //- Allow the rigidBodyModel class to set the last joint state
83  friend class Foam::RBD::rigidBodyModel;
84 
85 
86  // Constructors
87 
88  //- Construct for given PtrList<joint>
90 
91  //- Construct for given model from dictionary
92  composite(const dictionary& dict);
93 
94  //- Clone this joint
95  virtual autoPtr<joint> clone() const;
96 
97 
98  //- Destructor
99  virtual ~composite();
100 
101 
102  // Member Functions
103 
104  //- Update the model state for this joint
105  virtual void jcalc
106  (
107  joint::XSvc& J,
108  const scalarField& q,
109  const scalarField& qDot
110  ) const;
111 
112  //- Write
113  virtual void write(Ostream&) const;
114 };
115 
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 } // End namespace joints
120 } // End namespace RBD
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
virtual void write(Ostream &) const
Write.
Abstract base-class for all rigid-body joints.
Definition: joint.H:79
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual ~composite()
Destructor.
const PtrList< joint > & joints() const
Return the list of joints in the model.
Prismatic joint for translation along the specified arbitrary axis.
Joint state returned by jcalc.
Definition: joint.H:119
virtual void jcalc(joint::XSvc &J, const scalarField &q, const scalarField &qDot) const
Update the model state for this joint.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:62
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
composite(const PtrList< joint > &joints)
Construct for given PtrList<joint>
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints...
TypeName("composite")
Runtime type information.
Namespace for OpenFOAM.
virtual autoPtr< joint > clone() const
Clone this joint.