1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 complexVector specific part of 3D complexVector obtained from
28 \*---------------------------------------------------------------------------*/
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
37 inline complexVector operator*(const complex& v1, const complexVector& v2)
48 inline complexVector operator*(const complexVector& v2, const complex& v1)
59 inline complexVector operator/(const complexVector& v1, const complex& v2)
70 inline complexVector operator/(const complex& v1, const complexVector& v2)
81 // complexVector dot product
83 inline complex operator&(const complexVector& v1, const complexVector& v2)
87 v1.x()*v2.x().conjugate()
88 + v1.y()*v2.y().conjugate()
89 + v1.z()*v2.z().conjugate()
94 // complexVector cross product
96 inline complexVector operator^(const complexVector& v1, const complexVector& v2)
100 (v1.y()*v2.z() - v1.z()*v2.y()),
101 (v1.z()*v2.x() - v1.x()*v2.z()),
102 (v1.x()*v2.y() - v1.y()*v2.x())
107 // complexVector cross product
109 inline complexVector operator^(const vector& v1, const complexVector& v2)
113 (v1.y()*v2.z() - v1.z()*v2.y()),
114 (v1.z()*v2.x() - v1.x()*v2.z()),
115 (v1.x()*v2.y() - v1.y()*v2.x())
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 } // End namespace Foam
124 // ************************************************************************* //