sixDoFRigidBodyMotionState.C
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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
34:
35 centreOfRotation_(Zero),
36 Q_(I),
37 v_(Zero),
38 a_(Zero),
39 pi_(Zero),
40 tau_(Zero)
41{}
42
43
45(
46 const dictionary& dict
47)
48:
49 centreOfRotation_
50 (
51 dict.getOrDefault
52 (
53 "centreOfRotation",
54 dict.getOrDefault("centreOfMass", vector::zero)
55 )
56 ),
57 Q_(dict.getOrDefault("orientation", tensor::I)),
58 v_(dict.getOrDefault("velocity", vector::zero)),
59 a_(dict.getOrDefault("acceleration", vector::zero)),
60 pi_(dict.getOrDefault("angularMomentum", vector::zero)),
61 tau_(dict.getOrDefault("torque", vector::zero))
62{}
63
64
65// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
sixDoFRigidBodyMotionState()
Default construct, zero-initialized with identity transformation.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
static const Identity< scalar > I
Definition: Identity.H:94
dictionary dict