FreeFOAM The Cross-Platform CFD Toolkit
sixDoFRigidBodyMotionRestraint.H
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) 1991-2010 OpenCFD Ltd.
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 Namespace
25  Foam::sixDoFRigidBodyMotionRestraints
26 
27 Description
28  Namespace for six DoF motion restraints
29 
30 
31 Class
32  Foam::sixDoFRigidBodyMotionRestraint
33 
34 Description
35  Base class for defining restraints for sixDoF motions
36 
37 SourceFiles
38  sixDoFRigidBodyMotionRestraint.C
39  newDynamicFvMesh.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef sixDoFRigidBodyMotionRestraint_H
44 #define sixDoFRigidBodyMotionRestraint_H
45 
46 #include <OpenFOAM/Time.H>
47 #include <OpenFOAM/dictionary.H>
48 #include <OpenFOAM/autoPtr.H>
49 #include <OpenFOAM/vector.H>
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 // Forward declaration of classes
58 class sixDoFRigidBodyMotion;
59 
60 
61 /*---------------------------------------------------------------------------*\
62  Class sixDoFRigidBodyMotionRestraint Declaration
63 \*---------------------------------------------------------------------------*/
64 
66 {
67 
68 protected:
69 
70  // Protected data
71 
72  //- Restraint model specific coefficient dictionary
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("sixDoFRigidBodyMotionRestraint");
80 
81 
82  // Declare run-time constructor selection table
83 
85  (
86  autoPtr,
88  dictionary,
89  (const dictionary& sDoFRBMRDict),
90  (sDoFRBMRDict)
91  );
92 
93 
94  // Constructors
95 
96  //- Construct from the sDoFRBMRDict dictionary and Time
98  (
99  const dictionary& sDoFRBMRDict
100  );
101 
102  //- Construct and return a clone
104 
105 
106  // Selectors
107 
108  //- Select constructed from the sDoFRBMRDict dictionary and Time
110  (
111  const dictionary& sDoFRBMRDict
112  );
113 
114 
115  // Destructor
116 
118 
119 
120  // Member Functions
121 
122  //- Calculate the restraint position, force and moment.
123  // Global reference frame vectors.
124  virtual void restrain
125  (
126  const sixDoFRigidBodyMotion& motion,
127  vector& restraintPosition,
128  vector& restraintForce,
129  vector& restraintMoment
130  ) const = 0;
131 
132  //- Update properties from given dictionary
133  virtual bool read(const dictionary& sDoFRBMRDict);
134 
135  // Access
136 
137  // Return access to sDoFRBMRCoeffs
138  inline const dictionary& coeffDict() const
139  {
140  return sDoFRBMRCoeffs_;
141  }
142 
143  //- Write
144  virtual void write(Ostream&) const = 0;
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************ vim: set sw=4 sts=4 et: ************************ //