/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
Class
Foam::RBD::rigidBodyModel
Description
Basic rigid-body model representing a system of rigid-bodies connected by
1-6 DoF joints.
This class holds various body and joint state fields needed by the
kinematics and forward-dynamics algorithms presented in
reference:
\verbatim
Featherstone, R. (2008).
Rigid body dynamics algorithms.
Springer.
Chapter 4.
\endverbatim
SourceFiles
rigidBodyModel.C
kinematics.C
forwardDynamics.C
\*---------------------------------------------------------------------------*/
#ifndef RBD_rigidBodyModel_H
#define RBD_rigidBodyModel_H
#include "rigidBody.H"
#include "subBody.H"
#include "joint.H"
#include "compositeJoint.H"
#include "PtrList.H"
#include "HashTable.H"
namespace Foam
{
namespace RBD
{
// Forward declaration of friend functions and operators
class rigidBodyModel;
Ostream& operator<<(Ostream&, const rigidBodyModel&);
class rigidBodyModelState;
class restraint;
/*---------------------------------------------------------------------------*\
Class rigidBodyModel Declaration
\*---------------------------------------------------------------------------*/
class rigidBodyModel
{
// Private member functions
//- Initialize the model with the root-body
// which is a fixed massless bodyat the origin.
void initializeRootBody();
//- Resize the state fields following the joining of a body
void resizeState();
//- Convert the body with given ID into a composite-body
void makeComposite(const label bodyID);
//- Add restraints to the motion
void addRestraints(const dictionary& dict);
protected:
// Protected data representing the model structure
//- List of the bodies.
// The 0'th body represents the fixed origin and is constructed
// automatically. The subsequent (moving) bodies are appended by the
// join member function.
PtrList bodies_;
//- Bodies may be merged into existing bodies, the inertia of which is
// updated to represent the combined body which is more efficient than
// attaching them with fixed joints. These 'merged' bodies are held on
// this list.
PtrList mergedBodies_;
//- Lookup-table of the IDs of the bodies
HashTable