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