subBodyI.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 \*---------------------------------------------------------------------------*/
25 
26 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
27 
29 (
30  const autoPtr<rigidBody>& bodyPtr,
31  const word& masterName,
32  const label masterID,
33  const spatialTransform& masterXT
34 )
35 :
36  body_(bodyPtr),
37  masterName_(masterName),
38  masterID_(masterID),
39  masterXT_(masterXT)
40 {}
41 
42 
44 {
45  return autoPtr<subBody>(new subBody(*this));
46 }
47 
48 
49 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
50 
52 {
53  return body_();
54 }
55 
56 
57 inline const Foam::word& Foam::RBD::subBody::name() const
58 {
59  return body_->name();
60 }
61 
62 
64 {
65  return masterName_;
66 }
67 
68 
70 {
71  return masterID_;
72 }
73 
74 
76 {
77  return masterXT_;
78 }
79 
80 
81 // ************************************************************************* //
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:29
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
label masterID() const
Return the master body Id.
Definition: subBodyI.H:69
const word & masterName() const
Return the master body name.
Definition: subBodyI.H:63
const word & name() const
Return the body name.
Definition: subBodyI.H:57
A class for handling words, derived from string.
Definition: word.H:59
autoPtr< subBody > clone() const
Return clone of this subBody.
Definition: subBodyI.H:43
const spatialTransform & masterXT() const
Return the transform with respect to the master body.
Definition: subBodyI.H:75
const rigidBody & body() const
Return the original body from which this sub-body was constructed.
Definition: subBodyI.H:51
Compact representation of the Plücker spatial transformation tensor in terms of the rotation tensor E...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53