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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::subBody
28 
29 Group
30  grpRigidBodyDynamicsBodies
31 
32 Description
33  This specialized rigidBody holds the original body after it has been merged
34  into a master.
35 
36 SourceFiles
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 
49 namespace Foam
50 {
51 namespace RBD
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class subBody Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class subBody
59 {
60  // Private data
61 
62  //- Original body from which this sub-body was constructed
63  autoPtr<rigidBody> body_;
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 
75 public:
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 // ************************************************************************* //
Foam::RBD::rigidBody
Definition: rigidBody.H:65
Foam::RBD::subBody::body
const rigidBody & body() const
Return the original body from which this sub-body was constructed.
Definition: subBodyI.H:53
Foam::RBD::subBody::subBody
subBody(const autoPtr< rigidBody > &bodyPtr, const word &masterName, const label masterID, const spatialTransform &masterXT)
Construct a merged version of the given rigidBody.
Definition: subBodyI.H:31
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::spatialTransform
Compact representation of the Plücker spatial transformation tensor in terms of the rotation tensor E...
Definition: spatialTransform.H:70
Foam::RBD::subBody::masterID
label masterID() const
Return the master body Id.
Definition: subBodyI.H:71
subBodyI.H
Foam::RBD::subBody
Definition: subBody.H:57
rigidBody.H
Foam::RBD::subBody::masterName
const word & masterName() const
Return the master body name.
Definition: subBodyI.H:65
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::RBD::subBody::clone
autoPtr< subBody > clone() const
Return clone of this subBody.
Definition: subBodyI.H:45
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::RBD::subBody::masterXT
const spatialTransform & masterXT() const
Return the transform with respect to the master body.
Definition: subBodyI.H:77
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::RBD::subBody::write
void write(Ostream &) const
Write.
Definition: subBody.C:32
Foam::RBD::subBody::name
const word & name() const
Return the body name.
Definition: subBodyI.H:59