1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
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 \*---------------------------------------------------------------------------*/
26 #ifndef FieldFieldReuseFunctions_H
27 #define FieldFieldReuseFunctions_H
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 template<template<class> class Field, class TypeR, class Type1>
37 class reuseTmpFieldField
41 static tmp<FieldField<Field, TypeR> > New
43 const tmp<FieldField<Field, Type1> >& tf1
46 return tmp<FieldField<Field, TypeR> >
48 FieldField<Field, TypeR>::NewCalculatedType(tf1())
52 static void clear(const tmp<FieldField<Field, Type1> >& tf1)
59 template<template<class> class Field, class TypeR>
60 class reuseTmpFieldField<Field, TypeR, TypeR>
64 static tmp<FieldField<Field, TypeR> > New
66 const tmp<FieldField<Field, TypeR> >& tf1
75 return tmp<FieldField<Field, TypeR> >
77 FieldField<Field, TypeR>::NewCalculatedType(tf1())
82 static void clear(const tmp<FieldField<Field, TypeR> >& tf1)
94 template<class> class Field,
100 class reuseTmpTmpFieldField
104 static tmp<FieldField<Field, TypeR> > New
106 const tmp<FieldField<Field, Type1> >& tf1,
107 const tmp<FieldField<Field, Type2> >& tf2
110 return tmp<FieldField<Field, TypeR> >
112 FieldField<Field, TypeR>::NewCalculatedType(tf1())
118 const tmp<FieldField<Field, Type1> >& tf1,
119 const tmp<FieldField<Field, Type2> >& tf2
128 template<template<class> class Field, class TypeR, class Type1, class Type12>
129 class reuseTmpTmpFieldField<Field, TypeR, Type1, Type12, TypeR>
133 static tmp<FieldField<Field, TypeR> > New
135 const tmp<FieldField<Field, Type1> >& tf1,
136 const tmp<FieldField<Field, TypeR> >& tf2
145 return tmp<FieldField<Field, TypeR> >
147 FieldField<Field, TypeR>::NewCalculatedType(tf1())
154 const tmp<FieldField<Field, Type1> >& tf1,
155 const tmp<FieldField<Field, TypeR> >& tf2
167 template<template<class> class Field, class TypeR, class Type2>
168 class reuseTmpTmpFieldField<Field, TypeR, TypeR, TypeR, Type2>
172 static tmp<FieldField<Field, TypeR> > New
174 const tmp<FieldField<Field, TypeR> >& tf1,
175 const tmp<FieldField<Field, Type2> >& tf2
184 return tmp<FieldField<Field, TypeR> >
186 FieldField<Field, TypeR>::NewCalculatedType(tf1())
193 const tmp<FieldField<Field, TypeR> >& tf1,
194 const tmp<FieldField<Field, Type2> >& tf2
206 template<template<class> class Field, class TypeR>
207 class reuseTmpTmpFieldField<Field, TypeR, TypeR, TypeR, TypeR>
211 static tmp<FieldField<Field, TypeR> > New
213 const tmp<FieldField<Field, TypeR> >& tf1,
214 const tmp<FieldField<Field, TypeR> >& tf2
221 else if (tf2.isTmp())
227 return tmp<FieldField<Field, TypeR> >
229 FieldField<Field, TypeR>::NewCalculatedType(tf1())
236 const tmp<FieldField<Field, TypeR> >& tf1,
237 const tmp<FieldField<Field, TypeR> >& tf2
245 else if (tf2.isTmp())
254 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256 } // End namespace Foam
258 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
262 // ************************************************************************* //