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 -------------------------------------------------------------------------------
11 License
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  (
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 // ************************************************************************* //
Foam::Tensor::I
static const Tensor I
Definition: Tensor.H:85
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::VectorSpace< Vector< scalar >, scalar, 3 >::zero
static const Vector< scalar > zero
Definition: VectorSpace.H:115
Foam::dictionary::getOrDefault
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:148
Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState
sixDoFRigidBodyMotionState()
Default construct, zero-initialized with identity transformation.
Definition: sixDoFRigidBodyMotionState.C:33
sixDoFRigidBodyMotionState.H
Foam::I
static const Identity< scalar > I
Definition: Identity.H:95