FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

sixDoFRigidBodyMotionState.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 2009-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "sixDoFRigidBodyMotionState.H"
00027 
00028 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00029 
00030 Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState()
00031 :
00032     centreOfMass_(vector::zero),
00033     Q_(I),
00034     v_(vector::zero),
00035     a_(vector::zero),
00036     pi_(vector::zero),
00037     tau_(vector::zero)
00038 {}
00039 
00040 
00041 Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState
00042 (
00043     const point& centreOfMass,
00044     const tensor& Q,
00045     const vector& v,
00046     const vector& a,
00047     const vector& pi,
00048     const vector& tau
00049 )
00050 :
00051     centreOfMass_(centreOfMass),
00052     Q_(Q),
00053     v_(v),
00054     a_(a),
00055     pi_(pi),
00056     tau_(tau)
00057 {}
00058 
00059 
00060 Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState
00061 (
00062     const dictionary& dict
00063 )
00064 :
00065     centreOfMass_(dict.lookup("centreOfMass")),
00066     Q_(dict.lookupOrDefault("orientation", tensor(I))),
00067     v_(dict.lookupOrDefault("velocity", vector::zero)),
00068     a_(dict.lookupOrDefault("acceleration", vector::zero)),
00069     pi_(dict.lookupOrDefault("angularMomentum", vector::zero)),
00070     tau_(dict.lookupOrDefault("torque", vector::zero))
00071 {}
00072 
00073 
00074 Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState
00075 (
00076     const sixDoFRigidBodyMotionState& sDoFRBMS
00077 )
00078 :
00079     centreOfMass_(sDoFRBMS.centreOfMass()),
00080     Q_(sDoFRBMS.Q()),
00081     v_(sDoFRBMS.v()),
00082     a_(sDoFRBMS.a()),
00083     pi_(sDoFRBMS.pi()),
00084     tau_(sDoFRBMS.tau())
00085 {}
00086 
00087 
00088 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00089 
00090 Foam::sixDoFRigidBodyMotionState::~sixDoFRigidBodyMotionState()
00091 {}
00092 
00093 
00094 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines