OpenFOAM
v2406
The open source CFD toolbox
rigidBodyModelStateIO.C
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
\*---------------------------------------------------------------------------*/
27
28
#include "
rigidBodyModelState.H
"
29
#include "
IOstreams.H
"
30
31
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
32
33
void
Foam::RBD::rigidBodyModelState::write
(
dictionary
&
dict
)
const
34
{
35
dict
.add(
"q"
, q_);
36
dict
.add(
"qDot"
, qDot_);
37
dict
.add(
"qDdot"
, qDdot_);
38
dict
.add(
"t"
, t_);
39
dict
.add(
"deltaT"
, deltaT_);
40
}
41
42
43
void
Foam::RBD::rigidBodyModelState::write
(
Ostream
&
os
)
const
44
{
45
os
.writeEntry(
"q"
, q_);
46
os
.writeEntry(
"qDot"
, qDot_);
47
os
.writeEntry(
"qDdot"
, qDdot_);
48
os
.writeEntry(
"t"
, t_);
49
os
.writeEntry(
"deltaT"
, deltaT_);
50
}
51
52
53
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
54
55
Foam::Istream
& Foam::RBD::operator>>
56
(
57
Istream
& is,
58
rigidBodyModelState& state
59
)
60
{
61
is >> state.q_
62
>> state.qDot_
63
>> state.qDdot_
64
>> state.t_
65
>> state.deltaT_;
66
67
is.
check
(
FUNCTION_NAME
);
68
return
is;
69
}
70
71
72
Foam::Ostream
& Foam::RBD::operator<<
73
(
74
Ostream
&
os
,
75
const
rigidBodyModelState& state
76
)
77
{
78
os
<< state.q_
79
<<
token::SPACE
<< state.qDot_
80
<<
token::SPACE
<< state.qDdot_
81
<<
token::SPACE
<< state.t_
82
<<
token::SPACE
<< state.deltaT_;
83
84
os
.check(
FUNCTION_NAME
);
85
return
os
;
86
}
87
88
89
// ************************************************************************* //
dict
dictionary dict
Definition:
searchingEngine.H:11
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition:
dictionary.H:129
Foam::IOstream::check
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition:
IOstream.C:45
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition:
Istream.H:57
rigidBodyModelState.H
IOstreams.H
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Foam::RBD::rigidBodyModelState::write
void write(dictionary &dict) const
Write to dictionary.
Definition:
rigidBodyModelStateIO.C:26
Foam::token::SPACE
Space [isspace].
Definition:
token.H:131
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition:
Ostream.H:56
os
OBJstream os(runTime.globalPath()/outputName)
FUNCTION_NAME
#define FUNCTION_NAME
Definition:
messageStream.H:399
src
rigidBodyDynamics
rigidBodyModelState
rigidBodyModelStateIO.C
Generated by
1.8.14