OpenFOAM
12
The OpenFOAM Foundation
floatingJoint.C
Go to the documentation of this file.
1
/*---------------------------------------------------------------------------*\
2
========= |
3
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
\\ / O peration | Website: https://openfoam.org
5
\\ / A nd | Copyright (C) 2016-2024 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
"
28
#include "
addToRunTimeSelectionTable.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
44
addToRunTimeSelectionTable
45
(
46
joint
,
47
floating
,
48
dictionary
49
);
50
}
51
}
52
}
53
54
55
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
56
57
Foam::autoPtr<Foam::RBD::joints::composite>
58
Foam::RBD::joints::floating::sixDoF(
const
rigidBodyModel& model)
59
{
60
PtrList<joint> cj(2);
61
cj.set(0,
new
joints::Pxyz(model));
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(model));
66
67
// Alternatively the Euler-angle joint can be used
68
cj.set(1,
new
joints::Rzyx(model));
69
70
return
autoPtr<composite>(
new
composite
(cj));
71
}
72
73
74
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
75
76
Foam::RBD::joints::floating::floating
(
const
rigidBodyModel
& model)
77
:
78
composite
(sixDoF(model))
79
{}
80
81
82
Foam::RBD::joints::floating::floating
83
(
84
const
rigidBodyModel
& model,
85
const
dictionary
&
dict
86
)
87
:
88
composite
(sixDoF(model))
89
{}
90
91
92
Foam::autoPtr<Foam::RBD::joint>
Foam::RBD::joints::floating::clone
()
const
93
{
94
return
autoPtr<joint>
(
new
floating
(*
this
));
95
}
96
97
98
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
99
100
Foam::RBD::joints::floating::~floating
()
101
{}
102
103
104
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
105
106
void
Foam::RBD::joints::floating::write
(
Ostream
& os)
const
107
{
108
joint::write
(os);
109
}
110
111
112
// ************************************************************************* //
Pxyz.H
Rs.H
Rzyx.H
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition:
Ostream.H:57
Foam::RBD::joint
Abstract base-class for all rigid-body joints.
Definition:
joint.H:81
Foam::RBD::joint::write
virtual void write(Ostream &) const
Write.
Definition:
joint.C:82
Foam::RBD::joints::composite
Prismatic joint for translation along the specified arbitrary axis.
Definition:
compositeJoint.H:68
Foam::RBD::joints::composite::composite
composite(const PtrList< joint > &joints)
Construct for given PtrList<joint>
Definition:
compositeJoint.C:61
Foam::RBD::joints::floating
Prismatic joint for translation along the specified arbitrary axis.
Definition:
floatingJoint.H:63
Foam::RBD::joints::floating::write
virtual void write(Ostream &) const
Write.
Definition:
floatingJoint.C:106
Foam::RBD::joints::floating::floating
floating(const rigidBodyModel &model)
Construct.
Definition:
floatingJoint.C:76
Foam::RBD::joints::floating::clone
virtual autoPtr< joint > clone() const
Clone this joint.
Definition:
floatingJoint.C:92
Foam::RBD::joints::floating::~floating
virtual ~floating()
Destructor.
Definition:
floatingJoint.C:100
Foam::RBD::rigidBodyModel
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints.
Definition:
rigidBodyModel.H:77
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition:
autoPtr.H:51
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition:
dictionary.H:162
floatingJoint.H
Foam::RBD::joints::defineTypeNameAndDebug
defineTypeNameAndDebug(composite, 0)
Foam::RBD::joints::addToRunTimeSelectionTable
addToRunTimeSelectionTable(joint, composite, dictionary)
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.H:214
rigidBodyModel.H
dict
dictionary dict
Definition:
searchingEngine.H:14
src
rigidBodyMotion
rigidBodyDynamics
joints
floating
floatingJoint.C
Generated by
1.9.1