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 NXN DiagTensor derived from VectorSpace adding construction from
29 N components, and the inner-product (dot-product) and outer-product operators.
34 \*---------------------------------------------------------------------------*/
40 #include "SphericalTensorN.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class DiagTensor Declaration
49 \*---------------------------------------------------------------------------*/
51 template <class Cmpt, int length>
54 public VectorSpace<DiagTensorN<Cmpt, length>, Cmpt, length>
63 rank = 2, // Rank of DiagTensor is 2
68 // Static data members
70 static const char* const typeName;
71 static const char* componentNames[];
72 static const DiagTensorN zero;
73 static const DiagTensorN one;
74 static const DiagTensorN I;
82 //- Construct given VectorSpace
83 inline DiagTensorN(const VectorSpace<DiagTensorN<Cmpt, length>, Cmpt, length>&);
85 //- Construct from Istream
86 inline DiagTensorN(Istream&);
88 //- Construct given component value. Special use only!
89 explicit inline DiagTensorN(const Cmpt& tx);
95 inline DiagTensorN<Cmpt, length> diag() const;
98 inline DiagTensorN<Cmpt, length> T() const;
102 //- Assign to a SphericalTensorN
103 inline void operator=(const SphericalTensorN<Cmpt, length>&);
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 } // End namespace Foam
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 // Include inline implementations
115 #include "DiagTensorNI.H"
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 // ************************************************************************* //