transformList.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2018 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 InClass
28  Foam
29 
30 Description
31  Spatial transformation functions for list of values and primitive fields.
32 
33 SourceFiles
34  transformList.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef transformList_H
39 #define transformList_H
40 
41 #include "transform.H"
42 #include "List.H"
43 #include "Map.H"
44 #include "edgeHashes.H"
45 #include "tensorField.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 //- Apply transform to a list of elements, returning a copy.
55 template<class T>
56 List<T> transform(const tensor& rotTensor, const UList<T>& field);
57 
58 //- Inplace transform a list of elements.
59 template<class T>
60 void transformList(const tensor& rotTensor, UList<T>& field);
61 
62 //- Inplace transform a list of elements using one tensor per element.
63 template<class T>
64 void transformList(const tensorField& rotTensor, UList<T>& field);
65 
66 //- Inplace transform a Map of elements.
67 template<class T>
68 void transformList(const tensor& rotTensor, Map<T>& field);
69 
70 //- Inplace transform a Map of elements using one tensor per element.
71 // Using multiple tensors is ill-defined (Fatal).
72 template<class T>
73 void transformList(const tensorField& rotTensor, Map<T>& field);
74 
75 //- Inplace transform a Map of elements.
76 // Using multiple tensors is ill-defined (Fatal).
77 template<class T>
78 void transformList(const tensor& rotTensor, EdgeMap<T>& field);
79 
80 //- Inplace transform a Map of elements using one tensor per element.
81 // Using multiple tensors is ill-defined (Fatal).
82 template<class T>
83 void transformList(const tensorField& rotTensor, EdgeMap<T>& field);
84 
85 
86 // Specialisations for bool (no-op)
87 template<> inline void transformList(const tensor&, UList<bool>&) {}
88 template<> inline void transformList(const tensorField&, UList<bool>&) {}
89 template<> inline void transformList(const tensor&, Map<bool>&) {}
90 template<> inline void transformList(const tensorField&, Map<bool>&) {}
91 template<> inline void transformList(const tensor&, EdgeMap<bool>&) {}
92 template<> inline void transformList(const tensorField&, EdgeMap<bool>&) {}
93 
94 
95 // Specialisations for label (no-op)
96 template<> inline void transformList(const tensor&, labelUList&) {}
97 template<> inline void transformList(const tensorField&, labelUList&) {}
98 template<> inline void transformList(const tensor&, Map<label>&) {}
99 template<> inline void transformList(const tensorField&, Map<label>&) {}
100 template<> inline void transformList(const tensor&, EdgeMap<label>&) {}
101 template<> inline void transformList(const tensorField&, EdgeMap<label>&) {}
102 
103 
104 // Specialisations for scalar (no-op)
105 template<> inline void transformList(const tensor&, UList<scalar>&) {}
106 template<> inline void transformList(const tensorField&, UList<scalar>&) {}
107 template<> inline void transformList(const tensor&, Map<scalar>&) {}
108 template<> inline void transformList(const tensorField&, Map<scalar>&) {}
109 template<> inline void transformList(const tensor&, EdgeMap<scalar>&) {}
110 template<> inline void transformList(const tensorField&, EdgeMap<scalar>&) {}
111 
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #ifdef NoRepository
120  #include "transformList.C"
121 #endif
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
Foam::Tensor< scalar >
List.H
Foam::tensorField
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
Definition: primitiveFieldsFwd.H:57
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: lumpedPointController.H:69
Foam::transform
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Definition: dimensionSet.C:519
Map.H
Foam::transformList
void transformList(const tensor &rotTensor, UList< T > &field)
Inplace transform a list of elements.
Definition: transformList.C:52
Foam::Field< tensor >
field
rDeltaTY field()
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
tensorField.H
Foam::EdgeMap
Map from edge (expressed as its endpoints) to value. For easier forward declaration it is currently i...
Definition: EdgeMap.H:51
edgeHashes.H
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
transform.H
3D tensor transformation operations.
Foam::tensor
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.
Definition: symmTensor.H:61
transformList.C