rigidBodyModelState.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2016-2020 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
80  scalar t_;
81 
82  //- The time-step used to integrate to this state
83  scalar deltaT_;
84 
85 
86 public:
87 
88  // Constructors
89 
90  //- Construct for the given rigidBodyModel
91  rigidBodyModelState(const rigidBodyModel& model);
92 
93  //- Construct from dictionary for the given rigidBodyModel
95  (
96  const rigidBodyModel& model,
97  const dictionary& dict
98  );
99 
100 
101  // Member Functions
102 
103  // Access
104 
105  //- Return access to the joint position and orientation
106  inline const scalarField& q() const;
107 
108  //- Return access to the joint velocity
109  inline const scalarField& qDot() const;
110 
111  //- Return access to the joint acceleration
112  inline const scalarField& qDdot() const;
113 
114  //- Return access to the time
115  inline scalar t() const;
116 
117  //- Return access to the time-step
118  inline scalar deltaT() const;
119 
120 
121  // Edit
122 
123  //- Return access to the joint position and orientation
124  inline scalarField& q();
125 
126  //- Return access to the joint velocity
127  inline scalarField& qDot();
128 
129  //- Return access to the joint acceleration
130  inline scalarField& qDdot();
131 
132  //- Return access to the time
133  inline scalar& t();
134 
135  //- Return access to the time-step
136  inline scalar& deltaT();
137 
138 
139  //- Write to dictionary
140  void write(dictionary& dict) const;
141 
142  //- Write to stream
143  void write(Ostream&) const;
144 
145 
146  // IOstream Operators
147 
149  friend Ostream& operator<<(Ostream&, const rigidBodyModelState&);
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace RBD
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #include "rigidBodyModelStateI.H"
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
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:156
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:54
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.