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/>.
25 Global functions for expansion and contraction of tensorN coefficient
26 to diagonal and scalar type
29 Hrvoje Jasak, Wikki Ltd. All rights reserved
31 \*---------------------------------------------------------------------------*/
33 #ifndef expandTensorN_H
34 #define expandTensorN_H
37 #include "VectorNFieldTypes.H"
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 #define UNARY_TEMPLATE_FUNCTION(ReturnType, Type, Func) \
42 template<class Cmpt, int length> \
43 inline void Func(ReturnType<Cmpt, length>&, const Type<Cmpt, length>&);
45 #define UNARY_TEMPLATE_FUNCTION_VS(ReturnType, Func) \
46 template<class Cmpt, int length> \
47 inline void Func(ReturnType<Cmpt, length>&, const Cmpt&);
49 #define UNARY_TEMPLATE_FUNCTION_SV(Type, Func) \
50 template<class Cmpt, int length> \
51 inline void Func(Cmpt&, const Type<Cmpt, length>&);
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 UNARY_TEMPLATE_FUNCTION_SV(TensorN, contractScalar)
61 UNARY_TEMPLATE_FUNCTION_SV(DiagTensorN, contractScalar)
62 UNARY_TEMPLATE_FUNCTION_SV(SphericalTensorN, contractScalar)
63 UNARY_TEMPLATE_FUNCTION_SV(VectorN, contractScalar)
65 UNARY_TEMPLATE_FUNCTION(VectorN, TensorN, contractLinear)
66 UNARY_TEMPLATE_FUNCTION(VectorN, DiagTensorN, contractLinear)
67 UNARY_TEMPLATE_FUNCTION(VectorN, SphericalTensorN, contractLinear)
69 UNARY_TEMPLATE_FUNCTION_VS(VectorN, expandScalar)
70 UNARY_TEMPLATE_FUNCTION_VS(TensorN, expandScalar)
71 UNARY_TEMPLATE_FUNCTION_VS(DiagTensorN, expandScalar)
72 UNARY_TEMPLATE_FUNCTION_VS(SphericalTensorN, expandScalar)
74 UNARY_TEMPLATE_FUNCTION(TensorN, VectorN, expandLinear)
75 UNARY_TEMPLATE_FUNCTION(DiagTensorN, VectorN, expandLinear)
76 UNARY_TEMPLATE_FUNCTION(SphericalTensorN, VectorN, expandLinear)
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 } // End namespace Foam
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 #include "ExpandTensorNI.H"
86 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88 #undef UNARY_TEMPLATE_FUNCTION
89 #undef UNARY_TEMPLATE_FUNCTION_VS
90 #undef UNARY_TEMPLATE_FUNCTION_SV
94 // ************************************************************************* //