FieldFieldFunctionsM: Corrected macro names and order for binary functions

This commit is contained in:
Henry Weller 2017-04-12 14:33:45 +01:00
parent 5fd814896a
commit e9ba8242ca

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -204,54 +204,6 @@ tmp<FieldField<Field, ReturnType>> Func \
\
TEMPLATE \
void Func \
( \
FieldField<Field, ReturnType>& f, \
const FieldField<Field, Type1>& f1, \
const Type2& s \
) \
{ \
forAll(f, i) \
{ \
Func(f[i], f1[i], s); \
} \
} \
\
TEMPLATE \
tmp<FieldField<Field, ReturnType>> Func \
( \
const FieldField<Field, Type1>& f1, \
const Type2& s \
) \
{ \
tmp<FieldField<Field, ReturnType>> tRes \
( \
FieldField<Field, Type1>::NewCalculatedType(f1) \
); \
Func(tRes.ref(), f1, s); \
return tRes; \
} \
\
TEMPLATE \
tmp<FieldField<Field, ReturnType>> Func \
( \
const tmp<FieldField<Field, Type1>>& tf1, \
const Type2& s \
) \
{ \
tmp<FieldField<Field, ReturnType>> tRes \
( \
reuseTmpFieldField<Field, ReturnType, Type1>::New(tf1) \
); \
Func(tRes.ref(), tf1(), s); \
tf1.clear(); \
return tRes; \
}
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
\
TEMPLATE \
void Func \
( \
FieldField<Field, ReturnType>& f, \
const Type1& s, \
@ -296,6 +248,54 @@ tmp<FieldField<Field, ReturnType>> Func \
}
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
\
TEMPLATE \
void Func \
( \
FieldField<Field, ReturnType>& f, \
const FieldField<Field, Type1>& f1, \
const Type2& s \
) \
{ \
forAll(f, i) \
{ \
Func(f[i], f1[i], s); \
} \
} \
\
TEMPLATE \
tmp<FieldField<Field, ReturnType>> Func \
( \
const FieldField<Field, Type1>& f1, \
const Type2& s \
) \
{ \
tmp<FieldField<Field, ReturnType>> tRes \
( \
FieldField<Field, Type1>::NewCalculatedType(f1) \
); \
Func(tRes.ref(), f1, s); \
return tRes; \
} \
\
TEMPLATE \
tmp<FieldField<Field, ReturnType>> Func \
( \
const tmp<FieldField<Field, Type1>>& tf1, \
const Type2& s \
) \
{ \
tmp<FieldField<Field, ReturnType>> tRes \
( \
reuseTmpFieldField<Field, ReturnType, Type1>::New(tf1) \
); \
Func(tRes.ref(), tf1(), s); \
tf1.clear(); \
return tRes; \
}
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)