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
26 Global functions for expansion and contraction of tensor field
30 Hrvoje Jasak, Wikki Ltd. All rights reserved
35 \*---------------------------------------------------------------------------*/
37 #ifndef expandTensorNField_H
38 #define expandTensorNField_H
41 #include "VectorNFieldTypes.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 #define UNARY_FUNCTION(typeF1, typeF2, FUNC) \
46 void FUNC(Field<typeF1>& f1, const UList<typeF2>& f2); \
47 void FUNC(Field<typeF1>& f1, const tmp<Field<typeF2> >& tf2);
50 #define ExpandFieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
51 vectorType, cmptType, args...) \
53 UNARY_FUNCTION(cmptType, tensorType, contractScalar) \
54 UNARY_FUNCTION(cmptType, diagTensorType, contractScalar) \
55 UNARY_FUNCTION(cmptType, sphericalTensorType, contractScalar) \
56 UNARY_FUNCTION(cmptType, vectorType, contractScalar) \
58 UNARY_FUNCTION(vectorType, tensorType, contractLinear) \
59 UNARY_FUNCTION(vectorType, diagTensorType, contractLinear) \
60 UNARY_FUNCTION(vectorType, sphericalTensorType, contractLinear) \
62 UNARY_FUNCTION(vectorType, cmptType, expandScalar) \
63 UNARY_FUNCTION(tensorType, cmptType, expandScalar) \
64 UNARY_FUNCTION(diagTensorType, cmptType, expandScalar) \
65 UNARY_FUNCTION(sphericalTensorType, cmptType, expandScalar) \
67 UNARY_FUNCTION(tensorType, vectorType, expandLinear) \
68 UNARY_FUNCTION(diagTensorType, vectorType, expandLinear) \
69 UNARY_FUNCTION(sphericalTensorType, vectorType, expandLinear)
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
78 forAllVectorTensorNTypes(ExpandFieldFunctions)
81 // template <class Cmpt, int length>
82 // void contractScalar
85 // const UList<TensorN<Cmpt, length> >& f
88 // template <class Cmpt, int length>
89 // void contractScalar
92 // const UList<DiagTensorN<Cmpt, length> >& f
95 // template <class Cmpt, int length>
96 // void contractScalar
99 // const UList<SphericalTensorN<Cmpt, length> >& f
102 // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 // template <class Cmpt, int length>
105 // void contractLinear
107 // Field<VectorN<Cmpt, length> >& res,
108 // const UList<TensorN<Cmpt, length> >& f
111 // template <class Cmpt, int length>
112 // void contractLinear
114 // Field<VectorN<Cmpt, length> >& res,
115 // const UList<DiagTensorN<Cmpt, length> >& f
118 // template <class Cmpt, int length>
119 // void contractLinear
121 // Field<VectorN<Cmpt, length> >& res,
122 // const UList<SphericalTensorN<Cmpt, length> >& f
125 // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 // template <class Cmpt, int length>
130 // Field<VectorN<Cmpt, length> >& res,
131 // const UList<Cmpt>& f
134 // template <class Cmpt, int length>
137 // Field<TensorN<Cmpt, length> >& res,
138 // const UList<Cmpt>& f
141 // template <class Cmpt, int length>
144 // Field<DiagTensorN<Cmpt, length> >& res,
145 // const UList<Cmpt>& f
148 // template <class Cmpt, int length>
151 // Field<SphericalTensorN<Cmpt, length> >& res,
152 // const UList<Cmpt>& f
155 // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 // template <class Cmpt, int length>
160 // Field<TensorN<Cmpt, length> >& res,
161 // const UList<VectorN<Cmpt, length> >& f
164 // template <class Cmpt, int length>
167 // Field<DiagTensorN<Cmpt, length> >& res,
168 // const UList<VectorN<Cmpt, length> >& f
171 // template <class Cmpt, int length>
174 // Field<SphericalTensorN<Cmpt, length> >& res,
175 // const UList<VectorN<Cmpt, length> >& f
178 } // End namespace Foam
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 #undef UNARY_FUNCTION
183 #undef ExpandFieldFunctions
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 // #ifdef NoRepository
188 // # include "ExpandTensorNField.C"
191 // ************************************************************************* //