1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Templated 3D DiagTensor derived from VectorSpace.
30 Adding construction from 3 components, element access using xx(), yy()
31 and zz() member functions and the inner-product (dot-product) and
32 outer-product operators.
37 \*---------------------------------------------------------------------------*/
39 #ifndef DiagTensorTemplate_H
40 #define DiagTensorTemplate_H
42 #include "TensorTemplate.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class DiagTensor Declaration
51 \*---------------------------------------------------------------------------*/
56 public VectorSpace<DiagTensor<Cmpt>, Cmpt, 3>
65 rank = 2 // Rank of DiagTensor is 2
69 // Static data members
71 static const char* const typeName;
72 static const char* componentNames[];
73 static const DiagTensor zero;
74 static const DiagTensor one;
75 static const DiagTensor max;
76 static const DiagTensor min;
79 //- Component labeling enumeration
80 enum components { XX, YY, ZZ };
88 //- Construct given VectorSpace
89 inline DiagTensor(const VectorSpace<DiagTensor<Cmpt>, Cmpt, 3>&);
91 //- Construct given three components
92 inline DiagTensor(const Cmpt& txx, const Cmpt& tyy, const Cmpt& tzz);
94 //- Construct from Istream
95 inline DiagTensor(Istream&);
102 inline const Cmpt& xx() const;
103 inline const Cmpt& yy() const;
104 inline const Cmpt& zz() const;
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 } // End namespace Foam
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 // Include inline implementations
119 #include "DiagTensorTemplateI.H"
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 // ************************************************************************* //