rigidBodySolver.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::RBD::rigidBodySolver
28
29Description
30
31SourceFiles
32 rigidBodySolver.C
33 newSixDoFSolver.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef RBD_rigidBodySolver_H
38#define RBD_rigidBodySolver_H
39
40// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41
42#include "rigidBodyMotion.H"
44
45namespace Foam
46{
47namespace RBD
48{
49
50/*---------------------------------------------------------------------------*\
51 Class rigidBodySolver Declaration
52\*---------------------------------------------------------------------------*/
55{
56protected:
57
58 // Protected data
59
60 //- The rigid-body model
62
63
64 //- Return the motion state
65 inline rigidBodyModelState& state();
66
67 //- Return the current joint position and orientation
68 inline scalarField& q();
69
70 //- Return the current joint quaternion
71
72 //- Return the current joint velocity
73 inline scalarField& qDot();
74
75 //- Return the current joint acceleration
76 inline scalarField& qDdot();
77
78 //- Return the current time-step
79 inline scalar deltaT() const;
80
81
82 //- Return the previous motion state
83 inline const rigidBodyModelState& state0() const;
84
85 //- Return the current joint position and orientation
86 inline const scalarField& q0() const;
87
88 //- Return the current joint quaternion
89
90 //- Return the current joint velocity
91 inline const scalarField& qDot0() const;
92
93 //- Return the current joint acceleration
94 inline const scalarField& qDdot0() const;
95
96 //- Return the previous time-step
97 inline scalar deltaT0() const;
98
99 //- Correct the quaternion joints based on the current change in q
101
102
103public:
104
105 //- Runtime type information
106 TypeName("rigidBodySolver");
107
108
109 // Declare runtime construction
112 (
113 autoPtr,
116 (
117 rigidBodyMotion& body,
118 const dictionary& dict
119 ),
120 (body, dict)
121 );
122
123
124 // Constructors
125
126 // Construct for given body
128
129
130 //- Destructor
131 virtual ~rigidBodySolver();
132
133
134 // Selectors
135
137 (
138 rigidBodyMotion& body,
139 const dictionary& dict
140 );
141
142
143 // Member Functions
144
145 //- Integrate the rigid-body motion for one time-step
146 virtual void solve
147 (
148 const scalarField& tau,
149 const Field<spatialVector>& fx
150 ) = 0;
151};
152
153
154// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155
156} // End namespace RBD
157} // End namespace Foam
158
159// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160
161#include "rigidBodySolverI.H"
162
163// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164
165#endif
166
167// ************************************************************************* //
Holds the motion state of rigid-body model.
Six degree of freedom motion for a rigid body.
void correctQuaternionJoints()
Correct the quaternion joints based on the current change in q.
TypeName("rigidBodySolver")
Runtime type information.
virtual ~rigidBodySolver()
Destructor.
rigidBodyMotion & model_
The rigid-body model.
scalarField & qDot()
Return the current joint quaternion.
const scalarField & qDot0() const
Return the current joint quaternion.
scalar deltaT0() const
Return the previous time-step.
static autoPtr< rigidBodySolver > New(rigidBodyMotion &body, const dictionary &dict)
rigidBodyModelState & state()
Return the motion state.
scalar deltaT() const
Return the current time-step.
const rigidBodyModelState & state0() const
Return the previous motion state.
const scalarField & q0() const
Return the current joint position and orientation.
const scalarField & qDdot0() const
Return the current joint acceleration.
declareRunTimeSelectionTable(autoPtr, rigidBodySolver, dictionary,(rigidBodyMotion &body, const dictionary &dict),(body, dict))
scalarField & q()
Return the current joint position and orientation.
scalarField & qDdot()
Return the current joint acceleration.
virtual void solve(const scalarField &tau, const Field< spatialVector > &fx)=0
Integrate the rigid-body motion for one time-step.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
CEqn solve()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73