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/>.
24 \*---------------------------------------------------------------------------*/
26 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35 inline Vector<Cmpt>::Vector()
39 // Construct given VectorSpace
41 inline Vector<Cmpt>::Vector(const VectorSpace<Vector<Cmpt>, Cmpt, 3>& vs)
43 VectorSpace<Vector<Cmpt>, Cmpt, 3>(vs)
47 // Construct given three Cmpts
49 inline Vector<Cmpt>::Vector(const Cmpt& vx, const Cmpt& vy, const Cmpt& vz)
57 // Construct from Istream
59 inline Vector<Cmpt>::Vector(Istream& is)
61 VectorSpace<Vector<Cmpt>, Cmpt, 3>(is)
65 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
68 inline const Cmpt& Vector<Cmpt>::x() const
74 inline const Cmpt& Vector<Cmpt>::y() const
80 inline const Cmpt& Vector<Cmpt>::z() const
87 inline Cmpt& Vector<Cmpt>::x()
93 inline Cmpt& Vector<Cmpt>::y()
99 inline Cmpt& Vector<Cmpt>::z()
105 template <class Cmpt>
106 inline const Cmpt& Vector<Cmpt>::operator()
111 return this->operator[](i);
115 template <class Cmpt>
116 inline Cmpt& Vector<Cmpt>::operator()
121 return this->operator[](i);
125 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
127 template <class Cmpt>
128 inline const Vector<Cmpt>& Vector<Cmpt>::centre
130 const Foam::List<Vector<Cmpt> >&
137 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
139 template <class Cmpt>
140 inline typename innerProduct<Vector<Cmpt>, Vector<Cmpt> >::type
141 operator&(const Vector<Cmpt>& v1, const Vector<Cmpt>& v2)
143 return Cmpt(v1.x()*v2.x() + v1.y()*v2.y() + v1.z()*v2.z());
147 template <class Cmpt>
148 inline Vector<Cmpt> operator^(const Vector<Cmpt>& v1, const Vector<Cmpt>& v2)
152 (v1.y()*v2.z() - v1.z()*v2.y()),
153 (v1.z()*v2.x() - v1.x()*v2.z()),
154 (v1.x()*v2.y() - v1.y()*v2.x())
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 } // End namespace Foam
163 // ************************************************************************* //