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 "transformList.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 Foam::List<T> Foam::transform
34 const tensor& rotTensor,
38 List<T> newField(field.size());
42 newField[i] = transform(rotTensor, field[i]);
50 void Foam::transformList
52 const tensorField& rotTensor,
56 if (rotTensor.size() == 1)
60 field[i] = transform(rotTensor[0], field[i]);
63 else if (rotTensor.size() == field.size())
67 field[i] = transform(rotTensor[i], field[i]);
74 "transformList(const tensorField&, UList<T>&)"
75 ) << "Sizes of field and transformation not equal. field:"
76 << field.size() << " transformation:" << rotTensor.size()
83 void Foam::transformList
85 const tensorField& rotTensor,
89 if (rotTensor.size() == 1)
91 forAllIter(typename Map<T>, field, iter)
93 iter() = transform(rotTensor[0], iter());
100 "transformList(const tensorField&, Map<T>&)"
101 ) << "Multiple transformation tensors not supported. field:"
102 << field.size() << " transformation:" << rotTensor.size()
103 << abort(FatalError);
109 void Foam::transformList
111 const tensorField& rotTensor,
115 if (rotTensor.size() == 1)
117 forAllIter(typename EdgeMap<T>, field, iter)
119 iter() = transform(rotTensor[0], iter());
126 "transformList(const tensorField&, EdgeMap<T>&)"
127 ) << "Multiple transformation tensors not supported. field:"
128 << field.size() << " transformation:" << rotTensor.size()
129 << abort(FatalError);
134 // ************************************************************************* //