subBody.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::subBody
28
29Group
30 grpRigidBodyDynamicsBodies
31
32Description
33 This specialized rigidBody holds the original body after it has been merged
34 into a master.
35
36SourceFiles
37 subBodyI.H
38 subBody.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef RBD_subBody_H
43#define RBD_subBody_H
44
45#include "rigidBody.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51namespace RBD
52{
53
54/*---------------------------------------------------------------------------*\
55 Class subBody Declaration
56\*---------------------------------------------------------------------------*/
58class subBody
59{
60 // Private data
61
62 //- Original body from which this sub-body was constructed
64
65 //- Master body name
66 word masterName_;
67
68 //- Master body ID
69 label masterID_;
70
71 //- Transform with respect to master body
72 spatialTransform masterXT_;
73
74
75public:
76
77 // Constructors
78
79 //- Construct a merged version of the given rigidBody
80 // providing the ID of the master body to which this will be merged
81 // and the transform relative to the master
82 inline subBody
83 (
84 const autoPtr<rigidBody>& bodyPtr,
85 const word& masterName,
86 const label masterID,
88 );
89
90 //- Return clone of this subBody
91 inline autoPtr<subBody> clone() const;
92
93
94 // Member Functions
95
96 //- Return the original body from which this sub-body was constructed
97 inline const rigidBody& body() const;
98
99 //- Return the body name
100 inline const word& name() const;
101
102 //- Return the master body name
103 inline const word& masterName() const;
104
105 //- Return the master body Id
106 inline label masterID() const;
107
108 //- Return the transform with respect to the master body
109 inline const spatialTransform& masterXT() const;
110
111 //- Write
112 void write(Ostream&) const;
113};
114
115
116// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117
118} // End namespace RBD
119} // End namespace Foam
120
121// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122
123#include "subBodyI.H"
124
125// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126
127#endif
128
129// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
autoPtr< subBody > clone() const
Return clone of this subBody.
Definition: subBodyI.H:45
const spatialTransform & masterXT() const
Return the transform with respect to the master body.
Definition: subBodyI.H:77
const word & masterName() const
Return the master body name.
Definition: subBodyI.H:65
const rigidBody & body() const
Return the original body from which this sub-body was constructed.
Definition: subBodyI.H:53
label masterID() const
Return the master body Id.
Definition: subBodyI.H:71
const word & name() const
Return the body name.
Definition: subBodyI.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Compact representation of the Plücker spatial transformation tensor in terms of the rotation tensor E...
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
runTime write()