Rz.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 "Rz.H"
27 #include "rigidBodyModel.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace RBD
35 {
36 namespace joints
37 {
39 
41  (
42  joint,
43  Rz,
44  dictionary
45  );
46 }
47 }
48 }
49 
50 
51 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
52 
54 :
55  joint(1)
56 {
57  S_[0] = spatialVector(0, 0, 1, 0, 0, 0);
58 }
59 
60 
62 :
63  joint(1)
64 {
65  S_[0] = spatialVector(0, 0, 1, 0, 0, 0);
66 }
67 
68 
70 {
71  return autoPtr<joint>(new Rz(*this));
72 }
73 
74 
75 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
76 
78 {}
79 
80 
81 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
82 
84 (
85  joint::XSvc& J,
86  const scalarField& q,
87  const scalarField& qDot
88 ) const
89 {
90  J.X = Xrz(q[qIndex_]);
91  J.S1 = S_[0];
92  J.v = Zero;
93  J.v.wz() = qDot[qIndex_];
94  J.c = Zero;
95 }
96 
97 
98 // ************************************************************************* //
Abstract base-class for all rigid-body joints.
Definition: joint.H:79
dictionary dict
Rz()
Construct for given model.
Definition: Rz.C:53
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
spatialVector v
The constrained joint velocity.
Definition: joint.H:133
spatialVector S1
The joint motion sub-space (1-DoF)
Definition: joint.H:130
label qIndex_
Index of this joints data in the rigidBodyModel state.
Definition: joint.H:93
defineTypeNameAndDebug(composite, 0)
spatialTransform Xrz(const scalar &omega)
Rotational spatial transformation tensor about the z-axis by omega radians.
addToRunTimeSelectionTable(joint, composite, dictionary)
spatialVector c
The constrained joint acceleration correction.
Definition: joint.H:137
Macros for easy insertion into run-time selection tables.
const Cmpt & wz() const
Joint state returned by jcalc.
Definition: joint.H:119
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
Definition: spatialVector.H:47
static const zero Zero
Definition: zero.H:91
List< spatialVector > S_
Joint motion sub-space.
Definition: joint.H:87
virtual void jcalc(joint::XSvc &J, const scalarField &q, const scalarField &qDot) const
Update the model state for this joint.
Definition: Rz.C:84
spatialTransform X
The joint transformation.
Definition: joint.H:124
virtual ~Rz()
Destructor.
Definition: Rz.C:77
tensor Rz(const scalar &omega)
Rotational transformation tensor about the z-axis by omega radians.
Definition: transform.H:109
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
virtual autoPtr< joint > clone() const
Clone this joint.
Definition: Rz.C:69
Namespace for OpenFOAM.