OpenFOAM
v2312
The open source CFD toolbox
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
29
#include "
sixDoFRigidBodyMotionState.H
"
30
31
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
33
Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState
()
34
:
35
centreOfRotation_(
Zero
),
36
Q_(
I
),
37
v_(
Zero
),
38
a_(
Zero
),
39
pi_(
Zero
),
40
tau_(
Zero
)
41
{}
42
43
44
Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState
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
// ************************************************************************* //
dict
dictionary dict
Definition:
searchingEngine.H:11
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition:
dictionary.H:129
Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState
sixDoFRigidBodyMotionState()
Default construct, zero-initialized with identity transformation.
Definition:
sixDoFRigidBodyMotionState.C:26
sixDoFRigidBodyMotionState.H
Foam::I
static const Identity< scalar > I
Definition:
Identity.H:100
Foam::vector
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition:
zero.H:57
Foam::tensor
Tensor of scalars, i.e. Tensor<scalar>.
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition:
zero.H:127
src
sixDoFRigidBodyMotion
sixDoFRigidBodyMotion
sixDoFRigidBodyMotionState.C
Generated by
1.8.14