initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / primitives / SphericalTensor2D / SphericalTensor2D.H
blob03ba8598012aa39f95ee879682c9a7860c4c4e4b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::SphericalTensor2D
28 Description
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.
33 SourceFiles
34     SphericalTensor2DI.H
36 \*---------------------------------------------------------------------------*/
38 #ifndef SphericalTensor2D_H
39 #define SphericalTensor2D_H
41 #include "VectorSpace.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                            Class SphericalTensor2D Declaration
50 \*---------------------------------------------------------------------------*/
52 template<class Cmpt>
53 class SphericalTensor2D
55     public VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>
58 public:
60     // Member constants
62         enum
63         {
64             rank = 2 // Rank of SphericalTensor2D is 2
65         };
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 };
85     // Constructors
87         //- Construct null
88         inline SphericalTensor2D();
90         //- Construct given VectorSpace
91         inline SphericalTensor2D
92         (
93             const VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>&
94         );
96         //- Construct given the component
97         inline SphericalTensor2D(const Cmpt& tii);
99         //- Construct from Istream
100         inline SphericalTensor2D(Istream&);
103     // Member Functions
105         // Access
107             inline const Cmpt& ii() const;
108             inline Cmpt& ii();
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 } // End namespace Foam
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 // Include inline implementations
119 #include "SphericalTensor2DI.H"
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 #endif
125 // ************************************************************************* //