rigidBodyModelState.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-2017 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::RBD::rigidBodyModelState
28 
29 Description
30  Holds the motion state of rigid-body model.
31 
32 SourceFiles
33  rigidBodyModelStateI.H
34  rigidBodyModelState.C
35  rigidBodyModelStateIO.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef rigidBodyModelState_H
40 #define rigidBodyModelState_H
41 
42 #include "rigidBodyModel.H"
43 #include "scalarField.H"
44 #include "dictionary.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward declaration of classes
52 class Istream;
53 class Ostream;
54 
55 namespace RBD
56 {
57 
58 // Forward declaration of friend functions and operators
59 class rigidBodyModelState;
60 Istream& operator>>(Istream&, rigidBodyModelState&);
61 Ostream& operator<<(Ostream&, const rigidBodyModelState&);
62 
63 
64 /*---------------------------------------------------------------------------*\
65  Class rigidBodyModelState Declaration
66 \*---------------------------------------------------------------------------*/
67 
69 {
70  // Private data
71 
72  //- Joint position and orientation
73  scalarField q_;
74 
75  //- Joint velocity
76  scalarField qDot_;
77 
78  //- Joint acceleration
79  scalarField qDdot_;
80 
81  //- The time
82  scalar t_;
83 
84  //- The time-step used to integrate to this state
85  scalar deltaT_;
86 
87 
88 public:
89 
90  // Constructors
91 
92  //- Construct for the given rigidBodyModel
93  rigidBodyModelState(const rigidBodyModel& model);
94 
95  //- Construct from dictionary for the given rigidBodyModel
97  (
98  const rigidBodyModel& model,
99  const dictionary& dict
100  );
101 
102 
103  // Member Functions
104 
105  // Access
106 
107  //- Return access to the joint position and orientation
108  inline const scalarField& q() const;
109 
110  //- Return access to the joint velocity
111  inline const scalarField& qDot() const;
112 
113  //- Return access to the joint acceleration
114  inline const scalarField& qDdot() const;
115 
116  //- Return access to the time
117  inline scalar t() const;
118 
119  //- Return access to the time-step
120  inline scalar deltaT() const;
121 
122 
123  // Edit
124 
125  //- Return access to the joint position and orientation
126  inline scalarField& q();
127 
128  //- Return access to the joint velocity
129  inline scalarField& qDot();
130 
131  //- Return access to the joint acceleration
132  inline scalarField& qDdot();
133 
134  //- Return access to the time
135  inline scalar& t();
136 
137  //- Return access to the time-step
138  inline scalar& deltaT();
139 
140 
141  //- Write to dictionary
142  void write(dictionary& dict) const;
143 
144  //- Write to stream
145  void write(Ostream&) const;
146 
147 
148  // IOstream Operators
149 
151  friend Ostream& operator<<(Ostream&, const rigidBodyModelState&);
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace RBD
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #include "rigidBodyModelStateI.H"
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
Foam::RBD::rigidBodyModelState
Holds the motion state of rigid-body model.
Definition: rigidBodyModelState.H:67
Foam::RBD::rigidBodyModelState::qDdot
const scalarField & qDdot() const
Return access to the joint acceleration.
Definition: rigidBodyModelStateI.H:42
scalarField.H
Foam::RBD::operator>>
Istream & operator>>(Istream &, rigidBodyInertia &)
Definition: rigidBodyInertiaI.H:142
Foam::RBD::operator<<
Ostream & operator<<(Ostream &, const rigidBody &)
Definition: rigidBodyI.H:75
Foam::RBD::rigidBodyModelState::qDot
const scalarField & qDot() const
Return access to the joint velocity.
Definition: rigidBodyModelStateI.H:36
rigidBodyModel.H
Foam::RBD::rigidBodyModelState::t
scalar t() const
Return access to the time.
Definition: rigidBodyModelStateI.H:48
Foam::Field< scalar >
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::RBD::rigidBodyModelState::write
void write(dictionary &dict) const
Write to dictionary.
Definition: rigidBodyModelStateIO.C:33
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::RBD::rigidBodyModel
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints.
Definition: rigidBodyModel.H:83
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
rigidBodyModelStateI.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::RBD::rigidBodyModelState::q
const scalarField & q() const
Return access to the joint position and orientation.
Definition: rigidBodyModelStateI.H:30
Foam::RBD::rigidBodyModelState::operator>>
friend Istream & operator>>(Istream &, rigidBodyModelState &)
dictionary.H
Foam::RBD::rigidBodyModelState::deltaT
scalar deltaT() const
Return access to the time-step.
Definition: rigidBodyModelStateI.H:54
Foam::RBD::rigidBodyModelState::rigidBodyModelState
rigidBodyModelState(const rigidBodyModel &model)
Construct for the given rigidBodyModel.
Definition: rigidBodyModelState.C:34
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::RBD::rigidBodyModelState::operator<<
friend Ostream & operator<<(Ostream &, const rigidBodyModelState &)