BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / OpenFOAM / fields / DimensionedFields / DimensionedField / DimensionedFieldFunctionsM.H
blob66b2ada8fe4672a3eff2ab5050fe7ed5c6f46aa6
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
28 #define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc)                        \
29                                                                               \
30 TEMPLATE                                                                      \
31 tmp<DimensionedField<ReturnType, GeoMesh> > Func                              \
32 (                                                                             \
33     const DimensionedField<Type1, GeoMesh>& df                                \
34 );                                                                            \
35                                                                               \
36 TEMPLATE                                                                      \
37 tmp<DimensionedField<ReturnType, GeoMesh> > Func                              \
38 (                                                                             \
39     const tmp<DimensionedField<Type1, GeoMesh> >& tdf1                        \
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 #define UNARY_OPERATOR(ReturnType, Type1, Op, opFunc, Dfunc)                  \
46                                                                               \
47 TEMPLATE                                                                      \
48 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op                       \
49 (                                                                             \
50     const DimensionedField<Type1, GeoMesh>& df1                               \
51 );                                                                            \
52                                                                               \
53 TEMPLATE                                                                      \
54 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op                       \
55 (                                                                             \
56     const tmp<DimensionedField<Type1, GeoMesh> >& tdf1                        \
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 #define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)                       \
63                                                                               \
64 TEMPLATE                                                                      \
65 tmp<DimensionedField<ReturnType, GeoMesh> > Func                              \
66 (                                                                             \
67     const DimensionedField<Type1, GeoMesh>& df1,                              \
68     const DimensionedField<Type2, GeoMesh>& df2                               \
69 );                                                                            \
70                                                                               \
71 TEMPLATE                                                                      \
72 tmp<DimensionedField<ReturnType, GeoMesh> > Func                              \
73 (                                                                             \
74     const DimensionedField<Type1, GeoMesh>& df1,                              \
75     const tmp<DimensionedField<Type2, GeoMesh> >& tdf2                        \
76 );                                                                            \
77                                                                               \
78 TEMPLATE                                                                      \
79 tmp<DimensionedField<ReturnType, GeoMesh> > Func                              \
80 (                                                                             \
81     const tmp<DimensionedField<Type1, GeoMesh> >& tdf1,                       \
82     const DimensionedField<Type2, GeoMesh>& df2                               \
83 );                                                                            \
84                                                                               \
85 TEMPLATE                                                                      \
86 tmp<DimensionedField<ReturnType, GeoMesh> > Func                              \
87 (                                                                             \
88     const tmp<DimensionedField<Type1, GeoMesh> >& tdf1,                       \
89     const tmp<DimensionedField<Type2, GeoMesh> >& tdf2                        \
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 #define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func)               \
96                                                                               \
97 TEMPLATE                                                                      \
98 tmp<DimensionedField<ReturnType, GeoMesh> > Func                              \
99 (                                                                             \
100     const dimensioned<Type1>& dt1,                                            \
101     const DimensionedField<Type2, GeoMesh>& df2                               \
102 );                                                                            \
103                                                                               \
104 TEMPLATE                                                                      \
105 tmp<DimensionedField<ReturnType, GeoMesh> > Func                              \
106 (                                                                             \
107     const Type1& t1,                                                          \
108     const DimensionedField<Type2, GeoMesh>& df2                               \
109 );                                                                            \
110                                                                               \
111 TEMPLATE                                                                      \
112 tmp<DimensionedField<ReturnType, GeoMesh> > Func                              \
113 (                                                                             \
114     const dimensioned<Type1>& dt1,                                            \
115     const tmp<DimensionedField<Type2, GeoMesh> >& tdf2                        \
116 );                                                                            \
117                                                                               \
118 TEMPLATE                                                                      \
119 tmp<DimensionedField<ReturnType, GeoMesh> > Func                              \
120 (                                                                             \
121     const Type1& t1,                                                          \
122     const tmp<DimensionedField<Type2, GeoMesh> >& tdf2                        \
126 #define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)               \
127                                                                               \
128 TEMPLATE                                                                      \
129 tmp<DimensionedField<ReturnType, GeoMesh> > Func                              \
130 (                                                                             \
131     const DimensionedField<Type1, GeoMesh>& df1,                              \
132     const dimensioned<Type2>& dt2                                             \
133 );                                                                            \
134                                                                               \
135 TEMPLATE                                                                      \
136 tmp<DimensionedField<ReturnType, GeoMesh> > Func                              \
137 (                                                                             \
138     const DimensionedField<Type1, GeoMesh>& df1,                              \
139     const Type2& t2                                                           \
140 );                                                                            \
141                                                                               \
142 TEMPLATE                                                                      \
143 tmp<DimensionedField<ReturnType, GeoMesh> > Func                              \
144 (                                                                             \
145     const tmp<DimensionedField<Type1, GeoMesh> >& tdf1,                       \
146     const dimensioned<Type2>& dt2                                             \
147 );                                                                            \
148                                                                               \
149 TEMPLATE                                                                      \
150 tmp<DimensionedField<ReturnType, GeoMesh> > Func                              \
151 (                                                                             \
152     const tmp<DimensionedField<Type1, GeoMesh> >& tdf2,                       \
153     const Type2& t2                                                           \
157 #define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)                  \
158     BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func)                   \
159     BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 #define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)         \
165                                                                               \
166 TEMPLATE                                                                      \
167 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op                       \
168 (                                                                             \
169     const DimensionedField<Type1, GeoMesh>& df1,                              \
170     const DimensionedField<Type2, GeoMesh>& df2                               \
171 );                                                                            \
172                                                                               \
173 TEMPLATE                                                                      \
174 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op                       \
175 (                                                                             \
176     const DimensionedField<Type1, GeoMesh>& df1,                              \
177     const tmp<DimensionedField<Type2, GeoMesh> >& tdf2                        \
178 );                                                                            \
179                                                                               \
180 TEMPLATE                                                                      \
181 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op                       \
182 (                                                                             \
183     const tmp<DimensionedField<Type1, GeoMesh> >& tdf1,                       \
184     const DimensionedField<Type2, GeoMesh>& df2                               \
185 );                                                                            \
186                                                                               \
187 TEMPLATE                                                                      \
188 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op                       \
189 (                                                                             \
190     const tmp<DimensionedField<Type1, GeoMesh> >& tdf1,                       \
191     const tmp<DimensionedField<Type2, GeoMesh> >& tdf2                        \
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 #define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
198                                                                               \
199 TEMPLATE                                                                      \
200 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op                       \
201 (                                                                             \
202     const dimensioned<Type1>& dt1,                                            \
203     const DimensionedField<Type2, GeoMesh>& df2                               \
204 );                                                                            \
205                                                                               \
206 TEMPLATE                                                                      \
207 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op                       \
208 (                                                                             \
209     const Type1& t1,                                                          \
210     const DimensionedField<Type2, GeoMesh>& df2                               \
211 );                                                                            \
212                                                                               \
213 TEMPLATE                                                                      \
214 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op                       \
215 (                                                                             \
216     const dimensioned<Type1>& dt1,                                            \
217     const tmp<DimensionedField<Type2, GeoMesh> >& tdf2                        \
218 );                                                                            \
219                                                                               \
220 TEMPLATE                                                                      \
221 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op                       \
222 (                                                                             \
223     const Type1& t1,                                                          \
224     const tmp<DimensionedField<Type2, GeoMesh> >& tdf2                        \
228 #define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
229                                                                               \
230 TEMPLATE                                                                      \
231 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op                       \
232 (                                                                             \
233     const DimensionedField<Type1, GeoMesh>& df1,                              \
234     const dimensioned<Type2>& dt2                                             \
235 );                                                                            \
236                                                                               \
237 TEMPLATE                                                                      \
238 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op                       \
239 (                                                                             \
240     const DimensionedField<Type1, GeoMesh>& df1,                              \
241     const Type2& t2                                                           \
242 );                                                                            \
243                                                                               \
244 TEMPLATE                                                                      \
245 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op                       \
246 (                                                                             \
247     const tmp<DimensionedField<Type1, GeoMesh> >& tdf1,                       \
248     const dimensioned<Type2>& dt2                                             \
249 );                                                                            \
250                                                                               \
251 TEMPLATE                                                                      \
252 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op                       \
253 (                                                                             \
254     const tmp<DimensionedField<Type1, GeoMesh> >& tdf1,                       \
255     const Type2& t2                                                           \
259 #define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)    \
260     BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)     \
261     BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)
264 // ************************************************************************* //