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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::RBD::rigidBodyModelState
28
29Description
30 Holds the motion state of rigid-body model.
31
32SourceFiles
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
48namespace Foam
49{
50
51// Forward declaration of classes
52class Istream;
53class Ostream;
54
55namespace RBD
56{
57
58// Forward declaration of friend functions and operators
59class rigidBodyModelState;
60Istream& operator>>(Istream&, rigidBodyModelState&);
61Ostream& operator<<(Ostream&, const rigidBodyModelState&);
62
63
64/*---------------------------------------------------------------------------*\
65 Class rigidBodyModelState Declaration
66\*---------------------------------------------------------------------------*/
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
88public:
89
90 // Constructors
91
92 //- Construct for the given rigidBodyModel
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
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// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Holds the motion state of rigid-body model.
scalar t() const
Return access to the time.
friend Istream & operator>>(Istream &, rigidBodyModelState &)
const scalarField & qDdot() const
Return access to the joint acceleration.
const scalarField & qDot() const
Return access to the joint velocity.
scalar deltaT() const
Return access to the time-step.
friend Ostream & operator<<(Ostream &, const rigidBodyModelState &)
const scalarField & q() const
Return access to the joint position and orientation.
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Ostream & operator<<(Ostream &, const rigidBody &)
Definition: rigidBodyI.H:75
Istream & operator>>(Istream &, rigidBodyInertia &)
Namespace for OpenFOAM.
runTime write()
dictionary dict