OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

pointPatchFieldFunctions.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2007 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 namespace Foam
00028 {
00029 
00030 /* * * * * * * * * * * * * * * * Global functions  * * * * * * * * * * * * * */
00031 
00032 template<class Type>
00033 inline void component
00034 (
00035     pointPatchField<typename Field<Type>::cmptType>& sf,
00036     const pointPatchField<Type>& f,
00037     const direction d
00038 )
00039 {}
00040 
00041 
00042 template<class Type>
00043 inline void T
00044 (
00045     pointPatchField<Type>& f1,
00046     const pointPatchField<Type>& f2
00047 )
00048 {}
00049 
00050 
00051 template<class Type, int r>
00052 inline void pow
00053 (
00054     Field<typename powProduct<Type, r>::type>& f,
00055     const pointPatchField<Type>& vf
00056 )
00057 {}
00058 
00059 
00060 template<class Type>
00061 inline void sqr
00062 (
00063     Field<typename outerProduct<Type, Type>::type>& f,
00064     const pointPatchField<Type>& vf
00065 )
00066 {}
00067 
00068 
00069 template<class Type>
00070 inline void magSqr
00071 (
00072     pointPatchField<scalar>& sf,
00073     const pointPatchField<Type>& f
00074 )
00075 {}
00076 
00077 
00078 template<class Type>
00079 inline void mag
00080 (
00081     pointPatchField<scalar>& sf,
00082     const pointPatchField<Type>& f
00083 )
00084 {}
00085 
00086 
00087 template<class Type>
00088 inline void cmptAv
00089 (
00090     pointPatchField<typename Field<Type>::cmptType>& cf,
00091     const pointPatchField<Type>& f
00092 )
00093 {}
00094 
00095 
00096 template<class Type>
00097 inline void cmptMag
00098 (
00099     pointPatchField<Type>& cf,
00100     const pointPatchField<Type>& f
00101 )
00102 {}
00103 
00104 
00105 #define BINARY_FUNCTION(func)                                                 \
00106                                                                               \
00107 template<class Type>                                                          \
00108 inline void func                                                              \
00109 (                                                                             \
00110     pointPatchField<Type>& f,                                                 \
00111     const pointPatchField<Type>& f1,                                          \
00112     const pointPatchField<Type>& f2                                           \
00113 )                                                                             \
00114 {}                                                                            \
00115                                                                               \
00116 template<class Type>                                                          \
00117 inline void func                                                              \
00118 (                                                                             \
00119     pointPatchField<Type>& f,                                                 \
00120     const pointPatchField<Type>& f1,                                          \
00121     const Type& s                                                             \
00122 )                                                                             \
00123 {}
00124 
00125 BINARY_FUNCTION(max)
00126 BINARY_FUNCTION(min)
00127 BINARY_FUNCTION(scale)
00128 
00129 #undef BINARY_FUNCTION
00130 
00131 
00132 /* * * * * * * * * * * * * * * * Global operators  * * * * * * * * * * * * * */
00133 
00134 #define UNARY_OPERATOR(op, opFunc)                                            \
00135                                                                               \
00136 template<class Type>                                                          \
00137 inline void opFunc                                                            \
00138 (                                                                             \
00139     pointPatchField<Type>& f,                                                 \
00140     const pointPatchField<Type>& f1                                           \
00141 )                                                                             \
00142 {}
00143 
00144 UNARY_OPERATOR(-, negate)
00145 
00146 #undef UNARY_OPERATOR
00147 
00148 
00149 #define BINARY_OPERATOR_FF(Type1, Type2, op, opFunc)                          \
00150                                                                               \
00151 template<class Type>                                                          \
00152 inline void opFunc                                                            \
00153 (                                                                             \
00154     pointPatchField<Type>& f,                                                 \
00155     const pointPatchField<Type1>& f1,                                         \
00156     const pointPatchField<Type2>& f2                                          \
00157 )                                                                             \
00158 {}
00159 
00160 #define BINARY_OPERATOR_R(Type1, Type2, op, opFunc)                           \
00161     BINARY_OPERATOR_FF(Type1, Type2, op, opFunc)
00162 
00163 BINARY_OPERATOR_R(Type, Type, +, add)
00164 BINARY_OPERATOR_R(Type, Type, -, subtract)
00165 BINARY_OPERATOR_FF(scalar, Type, *, multiply)
00166 BINARY_OPERATOR_FF(Type, scalar, /, divide)
00167 
00168 #undef BINARY_OPERATOR_R
00169 #undef BINARY_OPERATOR_FF
00170 #undef BINARY_OPERATOR_FTR
00171 #undef BINARY_OPERATOR_TF
00172 #undef BINARY_OPERATOR_TTR
00173 #undef BINARY_OPERATOR_FT
00174 #undef BINARY_OPERATOR_TRF
00175 #undef BINARY_OPERATOR_TRT
00176 
00177 
00178 #define BINARY_TYPE_OPERATOR_TF(TYPE, op, opFunc)                             \
00179                                                                               \
00180 template<class Type>                                                          \
00181 inline void opFunc                                                            \
00182 (                                                                             \
00183     pointPatchField<Type>& f,                                                 \
00184     const TYPE& s,                                                            \
00185     const pointPatchField<Type>& f1                                           \
00186 )                                                                             \
00187 {}
00188 
00189 
00190 #define BINARY_TYPE_OPERATOR_FT(TYPE, op, opFunc)                             \
00191                                                                               \
00192 template<class Type>                                                          \
00193 inline void opFunc                                                            \
00194 (                                                                             \
00195     pointPatchField<Type>& f,                                                 \
00196     const pointPatchField<Type>& f1,                                          \
00197     const TYPE& s                                                             \
00198 )                                                                             \
00199 {}
00200 
00201 
00202 #define BINARY_TYPE_OPERATOR(TYPE, op, opFunc)                                \
00203     BINARY_TYPE_OPERATOR_TF(TYPE, op, opFunc)                                 \
00204     BINARY_TYPE_OPERATOR_FT(TYPE, op, opFunc)
00205 
00206 BINARY_TYPE_OPERATOR(Type, +, add)
00207 BINARY_TYPE_OPERATOR(Type, -, subtract)
00208 
00209 BINARY_TYPE_OPERATOR(scalar, *, multiply)
00210 BINARY_TYPE_OPERATOR_FT(scalar, /, divide)
00211 
00212 #undef BINARY_TYPE_OPERATOR
00213 #undef BINARY_TYPE_OPERATOR_TF
00214 #undef BINARY_TYPE_OPERATOR_FT
00215 
00216 
00217 #define PRODUCT_OPERATOR(product, op, opFunc)                                 \
00218                                                                               \
00219 template                                                                      \
00220 <                                                                             \
00221     template<class> class PatchField,                                         \
00222     class pointPatch,                                                         \
00223     class Type1,                                                              \
00224     class Type2                                                               \
00225 >                                                                             \
00226 inline void opFunc                                                            \
00227 (                                                                             \
00228     pointPatchField                                                           \
00229     <typename product<Type1, Type2>::type>& f,                                \
00230     const pointPatchField<Type1>& f1,                                         \
00231     const pointPatchField<Type2>& f2                                          \
00232 )                                                                             \
00233 {}                                                                            \
00234                                                                               \
00235 template                                                                      \
00236 <                                                                             \
00237     template<class> class PatchField,                                         \
00238     class pointPatch,                                                         \
00239     class Type,                                                               \
00240     class Form,                                                               \
00241     class Cmpt,                                                               \
00242     int nCmpt                                                                 \
00243 >                                                                             \
00244 inline void opFunc                                                            \
00245 (                                                                             \
00246     pointPatchField                                                           \
00247     <typename product<Type, Form>::type>& f,                                  \
00248     const pointPatchField<Type>& f1,                                          \
00249     const VectorSpace<Form,Cmpt,nCmpt>& vs                                    \
00250 )                                                                             \
00251 {}                                                                            \
00252                                                                               \
00253 template                                                                      \
00254 <                                                                             \
00255     template<class> class PatchField,                                         \
00256     class pointPatch,                                                         \
00257     class Form,                                                               \
00258     class Cmpt,                                                               \
00259     int nCmpt,                                                                \
00260     class Type                                                                \
00261 >                                                                             \
00262 inline void opFunc                                                            \
00263 (                                                                             \
00264     pointPatchField                                                           \
00265     <typename product<Form, Type>::type>& f,                                  \
00266     const VectorSpace<Form,Cmpt,nCmpt>& vs,                                   \
00267     const pointPatchField<Type>& f1                                           \
00268 )                                                                             \
00269 {}
00270 
00271 PRODUCT_OPERATOR(outerProduct, *, outer)
00272 PRODUCT_OPERATOR(crossProduct, ^, cross)
00273 PRODUCT_OPERATOR(innerProduct, &, dot)
00274 PRODUCT_OPERATOR(scalarProduct, &&, dotdot)
00275 
00276 #undef PRODUCT_OPERATOR
00277 
00278 
00279 template<template<class> class PatchField, class pointPatch>
00280 void hdual
00281 (
00282     pointPatchField<vector>&,
00283     const pointPatchField<tensor>&
00284 )
00285 {}
00286 
00287 template<template<class> class PatchField, class pointPatch>
00288 void hdual
00289 (
00290     pointPatchField<tensor>&,
00291     const pointPatchField<vector>&
00292 )
00293 {}
00294 
00295 template<template<class> class PatchField, class pointPatch>
00296 void diag
00297 (
00298     pointPatchField<vector>&,
00299     const pointPatchField<tensor>&
00300 )
00301 {}
00302 
00303 template<template<class> class PatchField, class pointPatch>
00304 void tr
00305 (
00306     pointPatchField<scalar>&,
00307     const pointPatchField<tensor>&
00308 )
00309 {}
00310 
00311 template<template<class> class PatchField, class pointPatch>
00312 void dev
00313 (
00314     pointPatchField<tensor>&,
00315     const pointPatchField<tensor>&
00316 )
00317 {}
00318 
00319 template<template<class> class PatchField, class pointPatch>
00320 void dev2
00321 (
00322     pointPatchField<tensor>&,
00323     const pointPatchField<tensor>&
00324 )
00325 {}
00326 
00327 template<template<class> class PatchField, class pointPatch>
00328 void det
00329 (
00330     pointPatchField<scalar>&,
00331     const pointPatchField<tensor>&
00332 )
00333 {}
00334 
00335 template<template<class> class PatchField, class pointPatch>
00336 void inv
00337 (
00338     pointPatchField<tensor>&,
00339     const pointPatchField<tensor>&
00340 )
00341 {}
00342 
00343 template<template<class> class PatchField, class pointPatch>
00344 void symm
00345 (
00346     pointPatchField<tensor>&,
00347     const pointPatchField<tensor>&
00348 )
00349 {}
00350 
00351 template<template<class> class PatchField, class pointPatch>
00352 void twoSymm
00353 (
00354     pointPatchField<tensor>&,
00355     const pointPatchField<tensor>&
00356 )
00357 {}
00358 
00359 template<template<class> class PatchField, class pointPatch>
00360 void skew
00361 (
00362     pointPatchField<tensor>&,
00363     const pointPatchField<tensor>&
00364 )
00365 {}
00366 
00367 template<template<class> class PatchField, class pointPatch>
00368 void eigenValues
00369 (
00370     pointPatchField<vector>&,
00371     const pointPatchField<tensor>&
00372 )
00373 {}
00374 
00375 template<template<class> class PatchField, class pointPatch>
00376 void eigenVectors
00377 (
00378     pointPatchField<tensor>&,
00379     const pointPatchField<tensor>&
00380 )
00381 {}
00382 
00383 
00384 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00385 
00386 } // End namespace Foam
00387 
00388 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Copyright © 2000-2007 OpenCFD Ltd