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 SphericalTensorN of 2 scalars.
31 \*---------------------------------------------------------------------------*/
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
43 //- Inner-product between two spherical tensors
44 inline sphericalTensor2
45 operator&(const sphericalTensor2& st1, const sphericalTensor2& st2)
47 return sphericalTensor2(st1[0]*st2[0]);
51 //- Inner-product between a spherical tensor and a vector
53 operator&(const sphericalTensor2& st, const vector2& v)
57 result[0] = st[0]*v[0];
58 result[1] = st[0]*v[1];
64 //- Inner-product between a vector and a spherical tensor
66 operator&(const vector2& v, const sphericalTensor2& st)
70 result[0] = v[0]*st[0];
71 result[1] = v[1]*st[0];
77 //- Return the inverse of a tensor given the determinant
78 inline sphericalTensor2 inv(const sphericalTensor2& st)
80 return sphericalTensor2(1/st[0]);
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86 } // End namespace Foam
88 // ************************************************************************* //