1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "sixDoFRigidBodyMotionState.H"
27 #include "IOstreams.H"
29 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
31 void Foam::sixDoFRigidBodyMotionState::write(Ostream& os) const
33 os.writeKeyword("centreOfMass")
34 << centreOfMass_ << token::END_STATEMENT << nl;
35 os.writeKeyword("orientation")
36 << Q_ << token::END_STATEMENT << nl;
37 os.writeKeyword("velocity")
38 << v_ << token::END_STATEMENT << nl;
39 os.writeKeyword("acceleration")
40 << a_ << token::END_STATEMENT << nl;
41 os.writeKeyword("angularMomentum")
42 << pi_ << token::END_STATEMENT << nl;
43 os.writeKeyword("torque")
44 << tau_ << token::END_STATEMENT << nl;
48 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
50 Foam::Istream& Foam::operator>>
52 Istream& is, sixDoFRigidBodyMotionState& sDoFRBMS
55 is >> sDoFRBMS.centreOfMass_
62 // Check state of Istream
65 "Foam::Istream& Foam::operator>>"
66 "(Foam::Istream&, Foam::sixDoFRigidBodyMotionState&)"
73 Foam::Ostream& Foam::operator<<
76 const sixDoFRigidBodyMotionState& sDoFRBMS
79 os << token::SPACE << sDoFRBMS.centreOfMass()
80 << token::SPACE << sDoFRBMS.Q()
81 << token::SPACE << sDoFRBMS.v()
82 << token::SPACE << sDoFRBMS.a()
83 << token::SPACE << sDoFRBMS.pi()
84 << token::SPACE << sDoFRBMS.tau();
86 // Check state of Ostream
89 "Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
90 "const Foam::sixDoFRigidBodyMotionState&)"
97 // ************************************************************************* //