OpenFOAM
5.0
The OpenFOAM Foundation
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
w
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
v
w
+
Enumerations
a
b
c
d
e
f
g
i
k
l
m
o
p
r
s
t
v
w
+
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Related Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
+
Files
File List
+
File Members
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Typedefs
b
c
d
f
g
k
l
m
p
r
s
t
v
w
+
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
src
sixDoFRigidBodyMotion
sixDoFRigidBodyMotion
sixDoFRigidBodyMotionStateIO.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 | Copyright (C) 2011-2014 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 "
sixDoFRigidBodyMotionState.H
"
27
#include "
IOstreams.H
"
28
29
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
30
31
void
Foam::sixDoFRigidBodyMotionState::write
(
dictionary
&
dict
)
const
32
{
33
dict.
add
(
"centreOfRotation"
, centreOfRotation_);
34
dict.
add
(
"orientation"
, Q_);
35
dict.
add
(
"velocity"
, v_);
36
dict.
add
(
"acceleration"
, a_);
37
dict.
add
(
"angularMomentum"
, pi_);
38
dict.
add
(
"torque"
, tau_);
39
}
40
41
42
void
Foam::sixDoFRigidBodyMotionState::write
(
Ostream
& os)
const
43
{
44
os.
writeKeyword
(
"centreOfRotation"
)
45
<< centreOfRotation_ <<
token::END_STATEMENT
<<
nl
;
46
os.
writeKeyword
(
"orientation"
)
47
<< Q_ <<
token::END_STATEMENT
<<
nl
;
48
os.
writeKeyword
(
"velocity"
)
49
<< v_ <<
token::END_STATEMENT
<<
nl
;
50
os.
writeKeyword
(
"acceleration"
)
51
<< a_ <<
token::END_STATEMENT
<<
nl
;
52
os.
writeKeyword
(
"angularMomentum"
)
53
<< pi_ <<
token::END_STATEMENT
<<
nl
;
54
os.
writeKeyword
(
"torque"
)
55
<< tau_ <<
token::END_STATEMENT
<<
nl
;
56
}
57
58
59
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
60
61
Foam::Istream
& Foam::operator>>
62
(
63
Istream
& is,
sixDoFRigidBodyMotionState
& sDoFRBMS
64
)
65
{
66
is >> sDoFRBMS.centreOfRotation_
67
>> sDoFRBMS.Q_
68
>> sDoFRBMS.v_
69
>> sDoFRBMS.a_
70
>> sDoFRBMS.pi_
71
>> sDoFRBMS.tau_;
72
73
// Check state of Istream
74
is.
check
75
(
76
"Foam::Istream& Foam::operator>>"
77
"(Foam::Istream&, Foam::sixDoFRigidBodyMotionState&)"
78
);
79
80
return
is;
81
}
82
83
84
Foam::Ostream
& Foam::operator<<
85
(
86
Ostream
& os,
87
const
sixDoFRigidBodyMotionState
& sDoFRBMS
88
)
89
{
90
os <<
token::SPACE
<< sDoFRBMS.centreOfRotation()
91
<<
token::SPACE
<< sDoFRBMS.Q()
92
<<
token::SPACE
<< sDoFRBMS.v()
93
<<
token::SPACE
<< sDoFRBMS.a()
94
<<
token::SPACE
<< sDoFRBMS.pi()
95
<<
token::SPACE
<< sDoFRBMS.tau();
96
97
// Check state of Ostream
98
os.
check
99
(
100
"Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
101
"const Foam::sixDoFRigidBodyMotionState&)"
102
);
103
104
return
os;
105
}
106
107
108
// ************************************************************************* //
dict
dictionary dict
Definition:
searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition:
dictionary.H:137
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:57
Foam::sixDoFRigidBodyMotionState::write
void write(dictionary &dict) const
Write to dictionary.
Definition:
sixDoFRigidBodyMotionStateIO.C:31
Foam::token::SPACE
Definition:
token.H:97
Foam::token::END_STATEMENT
Definition:
token.H:101
Foam::dictionary::add
bool add(entry *, bool mergeEntry=false)
Add a new entry.
Definition:
dictionary.C:814
IOstreams.H
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
sixDoFRigidBodyMotionState.H
Foam::sixDoFRigidBodyMotionState
Holds the motion state of sixDoF object. Wrapped up together to allow rapid scatter to other processo...
Definition:
sixDoFRigidBodyMotionState.H:66
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition:
Ostream.H:53
Foam::nl
static const char nl
Definition:
Ostream.H:262
Foam::Ostream::writeKeyword
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
Definition:
Ostream.C:54
Generated by
1.8.13