1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Templated 2D Vector derived from VectorSpace adding construction from
30 2 components, element access using x() and y() member functions and
31 the inner-product (dot-product).
36 \*---------------------------------------------------------------------------*/
41 #include "VectorSpace.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class VectorN Declaration
51 \*---------------------------------------------------------------------------*/
53 template <class Cmpt, int length>
56 public VectorSpace<VectorN<Cmpt, length>, Cmpt, length>
65 rank = 1 // Rank of VectorN is 1
69 // Static data members
71 static const char* const typeName;
72 static const VectorN zero;
73 static const VectorN one;
81 //- Construct given VectorSpace
84 const VectorSpace<VectorN<Cmpt, length>, Cmpt, length>&
87 //- Construct given component value. Special use only!
88 explicit inline VectorN(const Cmpt& vx);
90 //- Construct from Istream
91 inline VectorN(Istream&);
96 //- Return ith component
97 inline const Cmpt& operator()(const direction i) const;
99 //- Return access to ith component
100 inline Cmpt& operator()(const direction i);
102 //- Componentwise multiply
103 inline VectorN<Cmpt, length> cmptMultiply
105 const VectorN<Cmpt, length>&
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 } // End namespace Foam
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 // Include inline implementations
117 #include "VectorNI.H"
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 // ************************************************************************* //