sixDoFMotion: Adding restraints and constraints to the motion of objects.
[OpenFOAM-1.6.x.git] / src / postProcessing / functionObjects / forces / pointPatchFields / derived / sixDoFRigidBodyMotion / sixDoFRigidBodyMotionConstraint / fixedAxis / fixedAxis.H
blobed9f103a098ddc3840b41862def5f4ebaeccedb5
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::sixDoFRigidBodyMotionConstraints::fixedAxis
28 Description
29     sixDoFRigidBodyMotionConstraint.  Axis of body fixed global
30     space.
32 SourceFiles
33     fixedAxis.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef fixedAxis_H
38 #define fixedAxis_H
40 #include "sixDoFRigidBodyMotionConstraint.H"
41 #include "point.H"
42 #include "tensor.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 namespace sixDoFRigidBodyMotionConstraints
52 /*---------------------------------------------------------------------------*\
53                             Class fixedAxis Declaration
54 \*---------------------------------------------------------------------------*/
56 class fixedAxis
58     public sixDoFRigidBodyMotionConstraint
61     // Private data
63         //- Reference axis in global space
64         vector fixedAxis_;
67 public:
69     //- Runtime type information
70     TypeName("fixedAxis");
73     // Constructors
75         //- Construct from components
76         fixedAxis
77         (
78             const dictionary& sDoFRBMCDict
79         );
81         //- Construct and return a clone
82         virtual autoPtr<sixDoFRigidBodyMotionConstraint> clone() const
83         {
84             return autoPtr<sixDoFRigidBodyMotionConstraint>
85             (
86                 new fixedAxis(*this)
87             );
88         }
91     // Destructor
93         virtual ~fixedAxis();
96     // Member Functions
98         //- Calculate the constraint position, force and moment.
99         //  Global reference frame vectors.  Returns boolean stating
100         //  whether the constraint been converged to tolerance.
101         virtual bool constrain
102         (
103             const sixDoFRigidBodyMotion& motion,
104             const vector& existingConstraintForce,
105             const vector& existingConstraintMoment,
106             scalar deltaT,
107             vector& constraintPosition,
108             vector& constraintForceIncrement,
109             vector& constraintMomentIncrement
110         ) const;
112         //- Update properties from given dictionary
113         virtual bool read(const dictionary& sDoFRBMCCoeff);
115         //- Write
116         virtual void write(Ostream&) const;
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 } // End namespace solidBodyMotionFunctions
123 } // End namespace Foam
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 #endif
129 // ************************************************************************* //