1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Compute rotation tensor base on Rodrigues' Rotation Formula
29 http://mathworld.wolfram.com/RodriguesRotationFormula.html
30 http://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula
33 Martin Beaudoin, Hydro-Quebec, (2008, 2011)
38 \*---------------------------------------------------------------------------*/
40 #ifndef RodriguesRotation_H
41 #define RodriguesRotation_H
46 #include "tensorField.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 // Compute rotation tensor using Rodrigues' Rotation Formula
54 // Formulation taken from:
55 // http://mathworld.wolfram.com/RodriguesRotationFormula.html
57 // Requires: rotation axis + rotation angle
58 tensor RodriguesRotation
60 const vector& rotationAxis,
61 const scalar& rotationAngle,
62 const bool inDegrees = true
65 // Compute rotation tensor using Rodrigues' Rotation Formula
66 // Slightly different formulation taken from:
67 // http://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula
69 // Requires: rotation axis + rotation angle
70 tensor RodriguesRotation2
72 const vector& rotationAxis,
73 const scalar& rotationAngle,
74 const bool inDegrees = true
77 // Compute rotation tensor using Rodrigues' Rotation Formula
78 // http://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula
80 // Requires: rotation axis + initial vector + final vector
82 tensor RodriguesRotation
84 const vector& rotationAxis,
89 // Compute rotation tensorField using Rodrigues' Rotation Formula
90 // http://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula
92 // Requires: rotation axis + initial vectorField + final vectorField
93 Foam::tensorField RodriguesRotation
95 const vector& rotationAxis,
96 const vectorField& vi,
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 } // End namespace Foam
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 // ************************************************************************* //