1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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 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
25 \*---------------------------------------------------------------------------*/
27 #include "transformField.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 // * * * * * * * * * * * * * * * global functions * * * * * * * * * * * * * //
41 const tensorField& trf,
47 return transform(rtf, trf[0], tf);
51 TFOR_ALL_F_OP_FUNC_F_F
53 Type, rtf, =, transform, tensor, trf, Type, tf
60 tmp<Field<Type> > transform
62 const tensorField& trf,
66 tmp<Field<Type> > tranf(new Field<Type> (tf.size()));
67 transform(tranf(), trf, tf);
73 tmp<Field<Type> > transform
75 const tensorField& trf,
76 const tmp<Field<Type> >& ttf
79 tmp<Field<Type> > tranf = reuseTmp<Type, Type>::New(ttf);
80 transform(tranf(), trf, ttf());
81 reuseTmp<Type, Type>::clear(ttf);
87 tmp<Field<Type> > transform
89 const tmp<tensorField>& ttrf,
93 tmp<Field<Type> > tranf(new Field<Type> (tf.size()));
94 transform(tranf(), ttrf(), tf);
101 tmp<Field<Type> > transform
103 const tmp<tensorField>& ttrf,
104 const tmp<Field<Type> >& ttf
107 tmp<Field<Type> > tranf = reuseTmp<Type, Type>::New(ttf);
108 transform(tranf(), ttrf(), ttf());
109 reuseTmp<Type, Type>::clear(ttf);
120 const Field<Type>& tf
123 TFOR_ALL_F_OP_FUNC_S_F(Type, rtf, =, transform, tensor, t, Type, tf)
128 tmp<Field<Type> > transform
131 const Field<Type>& tf
134 tmp<Field<Type> > tranf(new Field<Type>(tf.size()));
135 transform(tranf(), t, tf);
141 tmp<Field<Type> > transform
144 const tmp<Field<Type> >& ttf
147 tmp<Field<Type> > tranf = reuseTmp<Type, Type>::New(ttf);
148 transform(tranf(), t, ttf());
149 reuseTmp<Type, Type>::clear(ttf);
154 template<class Type1, class Type2>
155 tmp<Field<Type1> > transformFieldMask(const Field<Type2>& f)
160 template<class Type1, class Type2>
161 tmp<Field<Type1> > transformFieldMask(const tmp<Field<Type2> >& tf)
163 return tmp<Field<Type1> >(tf.ptr());
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 } // End namespace Foam
171 // ************************************************************************* //