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 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 max;
79 static const SphericalTensor min;
80 static const SphericalTensor I;
81 static const SphericalTensor oneThirdI;
82 static const SphericalTensor twoThirdsI;
85 //- Component labeling enumeration
86 enum components { II };
92 inline SphericalTensor();
94 //- Construct given VectorSpace
95 inline SphericalTensor
97 const VectorSpace<SphericalTensor<Cmpt>, Cmpt, 1>&
100 //- Construct given the component
101 inline SphericalTensor(const Cmpt& tii);
103 //- Construct from Istream
104 inline SphericalTensor(Istream&);
111 inline const Cmpt& ii() const;
116 inline const SphericalTensor<Cmpt>& T() const;
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 } // End namespace Foam
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 // Include inline implementations
127 #include "SphericalTensorI.H"
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 // ************************************************************************* //