1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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
26 Foam::SphericalTensor2D
29 Templated 2D sphericalTensor derived from VectorSpace adding construction
30 from 1 component, element access using ii() member function and the
31 inner-product (dot-product) and outer-product operators.
36 \*---------------------------------------------------------------------------*/
38 #ifndef SphericalTensor2D_H
39 #define SphericalTensor2D_H
41 #include "VectorSpace.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class SphericalTensor2D Declaration
50 \*---------------------------------------------------------------------------*/
53 class SphericalTensor2D
55 public VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>
64 rank = 2 // Rank of SphericalTensor2D is 2
68 // Static data members
70 static const char* const typeName;
71 static const char* componentNames[];
72 static const SphericalTensor2D zero;
73 static const SphericalTensor2D one;
74 static const SphericalTensor2D max;
75 static const SphericalTensor2D min;
76 static const SphericalTensor2D I;
77 static const SphericalTensor2D oneThirdI;
78 static const SphericalTensor2D twoThirdsI;
81 //- Component labeling enumeration
82 enum components { II };
88 inline SphericalTensor2D();
90 //- Construct given VectorSpace
91 inline SphericalTensor2D
93 const VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>&
96 //- Construct given the component
97 inline SphericalTensor2D(const Cmpt& tii);
99 //- Construct from Istream
100 inline SphericalTensor2D(Istream&);
107 inline const Cmpt& ii() const;
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 } // End namespace Foam
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 // Include inline implementations
119 #include "SphericalTensor2DI.H"
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 // ************************************************************************* //