ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / OpenFOAM / fields / pointPatchFields / pointPatchField / pointPatchFieldFunctions.H
blob9331774db25ce229fb95625c140bba0f512456be
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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 \*---------------------------------------------------------------------------*/
26 namespace Foam
29 /* * * * * * * * * * * * * * * * Global functions  * * * * * * * * * * * * * */
31 template<class Type>
32 inline void component
34     pointPatchField<typename Field<Type>::cmptType>& sf,
35     const pointPatchField<Type>& f,
36     const direction d
41 template<class Type>
42 inline void T
44     pointPatchField<Type>& f1,
45     const pointPatchField<Type>& f2
50 template<class Type, int r>
51 inline void pow
53     Field<typename powProduct<Type, r>::type>& f,
54     const pointPatchField<Type>& vf
59 template<class Type>
60 inline void sqr
62     Field<typename outerProduct<Type, Type>::type>& f,
63     const pointPatchField<Type>& vf
68 template<class Type>
69 inline void magSqr
71     pointPatchField<scalar>& sf,
72     const pointPatchField<Type>& f
77 template<class Type>
78 inline void mag
80     pointPatchField<scalar>& sf,
81     const pointPatchField<Type>& f
86 template<class Type>
87 inline void cmptAv
89     pointPatchField<typename Field<Type>::cmptType>& cf,
90     const pointPatchField<Type>& f
95 template<class Type>
96 inline void cmptMag
98     pointPatchField<Type>& cf,
99     const pointPatchField<Type>& f
104 #define BINARY_FUNCTION(func)                                                 \
105                                                                               \
106 template<class Type>                                                          \
107 inline void func                                                              \
108 (                                                                             \
109     pointPatchField<Type>& f,                                                 \
110     const pointPatchField<Type>& f1,                                          \
111     const pointPatchField<Type>& f2                                           \
112 )                                                                             \
113 {}                                                                            \
114                                                                               \
115 template<class Type>                                                          \
116 inline void func                                                              \
117 (                                                                             \
118     pointPatchField<Type>& f,                                                 \
119     const pointPatchField<Type>& f1,                                          \
120     const Type& s                                                             \
121 )                                                                             \
124 BINARY_FUNCTION(max)
125 BINARY_FUNCTION(min)
126 BINARY_FUNCTION(cmptMultiply)
127 BINARY_FUNCTION(cmptDivide)
130 /* * * * * * * * * * * * * * * * Global operators  * * * * * * * * * * * * * */
132 #define UNARY_OPERATOR(op, opFunc)                                            \
133                                                                               \
134 template<class Type>                                                          \
135 inline void opFunc                                                            \
136 (                                                                             \
137     pointPatchField<Type>& f,                                                 \
138     const pointPatchField<Type>& f1                                           \
139 )                                                                             \
142 UNARY_OPERATOR(-, negate)
144 #define BINARY_OPERATOR(Type1, Type2, op, opFunc)                             \
145                                                                               \
146 template<class Type>                                                          \
147 inline void opFunc                                                            \
148 (                                                                             \
149     pointPatchField<Type>& f,                                                 \
150     const pointPatchField<Type1>& f1,                                         \
151     const pointPatchField<Type2>& f2                                          \
152 )                                                                             \
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)                             \
160                                                                               \
161 template<class Type>                                                          \
162 inline void opFunc                                                            \
163 (                                                                             \
164     pointPatchField<Type>& f,                                                 \
165     const TYPE& s,                                                            \
166     const pointPatchField<Type>& f1                                           \
167 )                                                                             \
171 #define BINARY_TYPE_OPERATOR_FS(TYPE, op, opFunc)                             \
172                                                                               \
173 template<class Type>                                                          \
174 inline void opFunc                                                            \
175 (                                                                             \
176     pointPatchField<Type>& f,                                                 \
177     const pointPatchField<Type>& f1,                                          \
178     const TYPE& s                                                             \
179 )                                                                             \
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)                                 \
189                                                                               \
190 template                                                                      \
191 <                                                                             \
192     class Type1,                                                              \
193     class Type2                                                               \
194 >                                                                             \
195 inline void opFunc                                                            \
196 (                                                                             \
197     pointPatchField                                                           \
198     <typename product<Type1, Type2>::type>& f,                                \
199     const pointPatchField<Type1>& f1,                                         \
200     const pointPatchField<Type2>& f2                                          \
201 )                                                                             \
202 {}                                                                            \
203                                                                               \
204 template                                                                      \
205 <                                                                             \
206     class Type,                                                               \
207     class Form,                                                               \
208     class Cmpt,                                                               \
209     int nCmpt                                                                 \
210 >                                                                             \
211 inline void opFunc                                                            \
212 (                                                                             \
213     pointPatchField                                                           \
214     <typename product<Type, Form>::type>& f,                                  \
215     const pointPatchField<Type>& f1,                                          \
216     const VectorSpace<Form,Cmpt,nCmpt>& vs                                    \
217 )                                                                             \
218 {}                                                                            \
219                                                                               \
220 template                                                                      \
221 <                                                                             \
222     class Form,                                                               \
223     class Cmpt,                                                               \
224     int nCmpt,                                                                \
225     class Type                                                                \
226 >                                                                             \
227 inline void opFunc                                                            \
228 (                                                                             \
229     pointPatchField                                                           \
230     <typename product<Form, Type>::type>& f,                                  \
231     const VectorSpace<Form,Cmpt,nCmpt>& vs,                                   \
232     const pointPatchField<Type>& f1                                           \
233 )                                                                             \
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
247 inline void hdual
249     pointPatchField<vector>&,
250     const pointPatchField<tensor>&
254 inline void hdual
256     pointPatchField<tensor>&,
257     const pointPatchField<vector>&
261 inline void diag
263     pointPatchField<vector>&,
264     const pointPatchField<tensor>&
268 inline void tr
270     pointPatchField<scalar>&,
271     const pointPatchField<tensor>&
275 inline void dev
277     pointPatchField<tensor>&,
278     const pointPatchField<tensor>&
282 inline void dev2
284     pointPatchField<tensor>&,
285     const pointPatchField<tensor>&
289 inline void det
291     pointPatchField<scalar>&,
292     const pointPatchField<tensor>&
296 inline void inv
298     pointPatchField<tensor>&,
299     const pointPatchField<tensor>&
303 inline void symm
305     pointPatchField<tensor>&,
306     const pointPatchField<tensor>&
310 inline void twoSymm
312     pointPatchField<tensor>&,
313     const pointPatchField<tensor>&
317 inline void skew
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 // ************************************************************************* //