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 \*---------------------------------------------------------------------------*/
26 #include "transformField.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 // * * * * * * * * * * * * * * * global functions * * * * * * * * * * * * * //
40 const tensorField& trf,
46 return transform(rtf, trf[0], tf);
50 TFOR_ALL_F_OP_FUNC_F_F
52 Type, rtf, =, transform, tensor, trf, Type, tf
59 tmp<Field<Type> > transform
61 const tensorField& trf,
65 tmp<Field<Type> > tranf(new Field<Type> (tf.size()));
66 transform(tranf(), trf, tf);
72 tmp<Field<Type> > transform
74 const tensorField& trf,
75 const tmp<Field<Type> >& ttf
78 tmp<Field<Type> > tranf = reuseTmp<Type, Type>::New(ttf);
79 transform(tranf(), trf, ttf());
80 reuseTmp<Type, Type>::clear(ttf);
86 tmp<Field<Type> > transform
88 const tmp<tensorField>& ttrf,
92 tmp<Field<Type> > tranf(new Field<Type> (tf.size()));
93 transform(tranf(), ttrf(), tf);
100 tmp<Field<Type> > transform
102 const tmp<tensorField>& ttrf,
103 const tmp<Field<Type> >& ttf
106 tmp<Field<Type> > tranf = reuseTmp<Type, Type>::New(ttf);
107 transform(tranf(), ttrf(), ttf());
108 reuseTmp<Type, Type>::clear(ttf);
119 const Field<Type>& tf
122 TFOR_ALL_F_OP_FUNC_S_F(Type, rtf, =, transform, tensor, t, Type, tf)
127 tmp<Field<Type> > transform
130 const Field<Type>& tf
133 tmp<Field<Type> > tranf(new Field<Type>(tf.size()));
134 transform(tranf(), t, tf);
140 tmp<Field<Type> > transform
143 const tmp<Field<Type> >& ttf
146 tmp<Field<Type> > tranf = reuseTmp<Type, Type>::New(ttf);
147 transform(tranf(), t, ttf());
148 reuseTmp<Type, Type>::clear(ttf);
153 template<class Type1, class Type2>
154 tmp<Field<Type1> > transformFieldMask(const Field<Type2>& f)
159 template<class Type1, class Type2>
160 tmp<Field<Type1> > transformFieldMask(const tmp<Field<Type2> >& tf)
162 return tmp<Field<Type1> >(tf.ptr());
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 } // End namespace Foam
170 // ************************************************************************* //