OpenFOAM
12
The OpenFOAM Foundation
rigidBodyModelStateIO.C
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-2024 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
\*---------------------------------------------------------------------------*/
25
26
#include "
rigidBodyModelState.H
"
27
#include "
IOstreams.H
"
28
29
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
30
31
void
Foam::RBD::rigidBodyModelState::write
(
dictionary
&
dict
)
const
32
{
33
dict
.add(
"q"
, q_);
34
dict
.add(
"qDot"
, qDot_);
35
dict
.add(
"qDdot"
, qDdot_);
36
dict
.add(
"t"
, t_);
37
dict
.add(
"deltaT"
, deltaT_);
38
}
39
40
41
void
Foam::RBD::rigidBodyModelState::write
(
Ostream
& os)
const
42
{
43
writeEntry
(os,
"q"
, q_);
44
writeEntry
(os,
"qDot"
, qDot_);
45
writeEntry
(os,
"qDdot"
, qDdot_);
46
writeEntry
(os,
"t"
, t_);
47
writeEntry
(os,
"deltaT"
, deltaT_);
48
}
49
50
51
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
52
53
Foam::Istream
& Foam::RBD::operator>>
54
(
55
Istream
& is,
56
rigidBodyModelState
& state
57
)
58
{
59
is >> state.q_
60
>> state.qDot_
61
>> state.qDdot_
62
>> state.t_
63
>> state.deltaT_;
64
65
// Check state of Istream
66
is.
check
67
(
68
"Foam::Istream& Foam::operator>>"
69
"(Foam::Istream&, Foam::RBD::rigidBodyModelState&)"
70
);
71
72
return
is;
73
}
74
75
76
Foam::Ostream
& Foam::RBD::operator<<
77
(
78
Ostream
& os,
79
const
rigidBodyModelState
& state
80
)
81
{
82
os << state.q_
83
<<
token::SPACE
<< state.qDot_
84
<<
token::SPACE
<< state.qDdot_
85
<<
token::SPACE
<< state.t_
86
<<
token::SPACE
<< state.deltaT_;
87
88
// Check state of Ostream
89
os.check
90
(
91
"Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
92
"const Foam::RBD::rigidBodyModelState&)"
93
);
94
95
return
os;
96
}
97
98
99
// ************************************************************************* //
IOstreams.H
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Foam::IOstream::check
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition:
IOstream.C:92
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition:
Istream.H:60
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition:
Ostream.H:57
Foam::RBD::rigidBodyModelState
Holds the motion state of rigid-body model.
Definition:
rigidBodyModelState.H:66
Foam::RBD::rigidBodyModelState::write
void write(dictionary &dict) const
Write to dictionary.
Definition:
rigidBodyModelStateIO.C:31
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition:
dictionary.H:162
Foam::token::SPACE
@ SPACE
Definition:
token.H:104
Foam::writeEntry
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition:
HashTableIO.C:96
rigidBodyModelState.H
dict
dictionary dict
Definition:
searchingEngine.H:14
src
rigidBodyMotion
rigidBodyDynamics
rigidBodyModelState
rigidBodyModelStateIO.C
Generated by
1.9.1