1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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
29 Templated 3D SphericalTensor derived from VectorSpace adding construction
30 from 1 component, element access using th ii() member function and the
31 inner-product (dot-product) and outer-product operators.
36 \*---------------------------------------------------------------------------*/
38 #ifndef SphericalTensor_H
39 #define SphericalTensor_H
41 #include "VectorSpace.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class SphericalTensor Declaration
50 \*---------------------------------------------------------------------------*/
55 public VectorSpace<SphericalTensor<Cmpt>, Cmpt, 1>
60 //- Equivalent type of labels used for valid component indexing
61 typedef SphericalTensor<label> labelType;
68 rank = 2 // Rank of SphericalTensor is 2
72 // Static data members
74 static const char* const typeName;
75 static const char* componentNames[];
76 static const SphericalTensor zero;
77 static const SphericalTensor one;
78 static const SphericalTensor I;
79 static const SphericalTensor oneThirdI;
80 static const SphericalTensor twoThirdsI;
83 //- Component labeling enumeration
84 enum components { II };
90 inline SphericalTensor();
92 //- Construct given VectorSpace
93 inline SphericalTensor
95 const VectorSpace<SphericalTensor<Cmpt>, Cmpt, 1>&
98 //- Construct given the component
99 inline SphericalTensor(const Cmpt& tii);
101 //- Construct from Istream
102 inline SphericalTensor(Istream&);
109 inline const Cmpt& ii() const;
114 inline const SphericalTensor<Cmpt>& T() const;
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 } // End namespace Foam
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 // Include inline implementations
125 #include "SphericalTensorI.H"
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 // ************************************************************************* //