Loading...
Searching...
No Matches
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{
50namespace RBD
51{
52
53// Forward Declarations
55Istream& operator>>(Istream&, rigidBodyModelState&);
56Ostream& operator<<(Ostream&, const rigidBodyModelState&);
57
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
83public:
84
85 // Constructors
86
87 //- Construct for the given rigidBodyModel
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
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// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
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.
rigidBodyModelState(const rigidBodyModel &model)
Construct for the given rigidBodyModel.
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:133
Ostream & operator<<(Ostream &, const rigidBody &)
Definition rigidBodyI.H:68
Istream & operator>>(Istream &, rigidBodyInertia &)
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
runTime write()
dictionary dict