1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
29 /* * * * * * * * * * * * * * * * Global functions * * * * * * * * * * * * * */
34 pointPatchField<typename Field<Type>::cmptType>& sf,
35 const pointPatchField<Type>& f,
44 pointPatchField<Type>& f1,
45 const pointPatchField<Type>& f2
50 template<class Type, int r>
53 Field<typename powProduct<Type, r>::type>& f,
54 const pointPatchField<Type>& vf
62 Field<typename outerProduct<Type, Type>::type>& f,
63 const pointPatchField<Type>& vf
71 pointPatchField<scalar>& sf,
72 const pointPatchField<Type>& f
80 pointPatchField<scalar>& sf,
81 const pointPatchField<Type>& f
89 pointPatchField<typename Field<Type>::cmptType>& cf,
90 const pointPatchField<Type>& f
98 pointPatchField<Type>& cf,
99 const pointPatchField<Type>& f
104 #define BINARY_FUNCTION(func) \
106 template<class Type> \
109 pointPatchField<Type>& f, \
110 const pointPatchField<Type>& f1, \
111 const pointPatchField<Type>& f2 \
115 template<class Type> \
118 pointPatchField<Type>& f, \
119 const pointPatchField<Type>& f1, \
126 BINARY_FUNCTION(cmptMultiply)
127 BINARY_FUNCTION(cmptDivide)
130 /* * * * * * * * * * * * * * * * Global operators * * * * * * * * * * * * * */
132 #define UNARY_OPERATOR(op, opFunc) \
134 template<class Type> \
137 pointPatchField<Type>& f, \
138 const pointPatchField<Type>& f1 \
142 UNARY_OPERATOR(-, negate)
144 #define BINARY_OPERATOR(Type1, Type2, op, opFunc) \
146 template<class Type> \
149 pointPatchField<Type>& f, \
150 const pointPatchField<Type1>& f1, \
151 const pointPatchField<Type2>& f2 \
155 BINARY_OPERATOR(scalar, Type, *, multiply)
156 BINARY_OPERATOR(Type, scalar, *, multiply)
157 BINARY_OPERATOR(Type, scalar, /, divide)
159 #define BINARY_TYPE_OPERATOR_SF(TYPE, op, opFunc) \
161 template<class Type> \
164 pointPatchField<Type>& f, \
166 const pointPatchField<Type>& f1 \
171 #define BINARY_TYPE_OPERATOR_FS(TYPE, op, opFunc) \
173 template<class Type> \
176 pointPatchField<Type>& f, \
177 const pointPatchField<Type>& f1, \
183 BINARY_TYPE_OPERATOR_SF(scalar, *, multiply)
184 BINARY_TYPE_OPERATOR_FS(scalar, *, multiply)
185 BINARY_TYPE_OPERATOR_FS(scalar, /, divide)
188 #define PRODUCT_OPERATOR(product, op, opFunc) \
198 <typename product<Type1, Type2>::type>& f, \
199 const pointPatchField<Type1>& f1, \
200 const pointPatchField<Type2>& f2 \
214 <typename product<Type, Form>::type>& f, \
215 const pointPatchField<Type>& f1, \
216 const VectorSpace<Form,Cmpt,nCmpt>& vs \
230 <typename product<Form, Type>::type>& f, \
231 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
232 const pointPatchField<Type>& f1 \
236 PRODUCT_OPERATOR(typeOfSum, +, add)
237 PRODUCT_OPERATOR(typeOfSum, -, subtract)
239 PRODUCT_OPERATOR(outerProduct, *, outer)
240 PRODUCT_OPERATOR(crossProduct, ^, cross)
241 PRODUCT_OPERATOR(innerProduct, &, dot)
242 PRODUCT_OPERATOR(scalarProduct, &&, dotdot)
244 #undef PRODUCT_OPERATOR
249 pointPatchField<vector>&,
250 const pointPatchField<tensor>&
256 pointPatchField<tensor>&,
257 const pointPatchField<vector>&
263 pointPatchField<vector>&,
264 const pointPatchField<tensor>&
270 pointPatchField<scalar>&,
271 const pointPatchField<tensor>&
277 pointPatchField<tensor>&,
278 const pointPatchField<tensor>&
284 pointPatchField<tensor>&,
285 const pointPatchField<tensor>&
291 pointPatchField<scalar>&,
292 const pointPatchField<tensor>&
298 pointPatchField<tensor>&,
299 const pointPatchField<tensor>&
305 pointPatchField<tensor>&,
306 const pointPatchField<tensor>&
312 pointPatchField<tensor>&,
313 const pointPatchField<tensor>&
319 pointPatchField<tensor>&,
320 const pointPatchField<tensor>&
324 inline void eigenValues
326 pointPatchField<vector>&,
327 const pointPatchField<tensor>&
331 inline void eigenVectors
333 pointPatchField<tensor>&,
334 const pointPatchField<tensor>&
339 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
341 } // End namespace Foam
343 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
345 #include "undefFieldFunctionsM.H"
347 // ************************************************************************* //