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 namespace RBD
51 {
52 
53 // Forward Declarations
54 class rigidBodyModelState;
55 Istream& operator>>(Istream&, rigidBodyModelState&);
56 Ostream& operator<<(Ostream&, const rigidBodyModelState&);
57 
58 
59 /*---------------------------------------------------------------------------*\
60  Class rigidBodyModelState Declaration
61 \*---------------------------------------------------------------------------*/
62 
64 {
65  // Private data
66 
67  //- Joint position and orientation
68  scalarField q_;
69 
70  //- Joint velocity
71  scalarField qDot_;
72 
73  //- Joint acceleration
74  scalarField qDdot_;
75 
76  //- The time
77  scalar t_;
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 velocity
106  inline const scalarField& qDot() const;
107 
108  //- Return access to the joint acceleration
109  inline const scalarField& qDdot() const;
110 
111  //- Return access to the time
112  inline scalar t() const;
113 
114  //- Return access to the time-step
115  inline scalar deltaT() const;
116 
117 
118  // Edit
119 
120  //- Return access to the joint position and orientation
121  inline scalarField& q();
122 
123  //- Return access to the joint velocity
124  inline scalarField& qDot();
125 
126  //- Return access to the joint acceleration
127  inline scalarField& qDdot();
128 
129  //- Return access to the time
130  inline scalar& t();
131 
132  //- Return access to the time-step
133  inline scalar& deltaT();
134 
135 
136  //- Write to dictionary
137  void write(dictionary& dict) const;
138 
139  //- Write to stream
140  void write(Ostream&) const;
141 
142 
143  // IOstream Operators
144 
146  friend Ostream& operator<<(Ostream&, const rigidBodyModelState&);
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace RBD
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #include "rigidBodyModelStateI.H"
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
rigidBodyModelState(const rigidBodyModel &model)
Construct for the given rigidBodyModel.
Ostream & operator<<(Ostream &, const rigidBody &)
Definition: rigidBodyI.H:68
Istream & operator>>(Istream &, rigidBodyInertia &)
dictionary dict
friend Ostream & operator<<(Ostream &, const rigidBodyModelState &)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
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.
scalar t() const
Return access to the time.
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 velocity.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
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.