From 5c6a4d9559e5dbfb1bb7067a130c769954de2ca2 Mon Sep 17 00:00:00 2001 From: Henry Weller <http://cfd.direct> Date: Tue, 9 Feb 2016 15:26:02 +0000 Subject: [PATCH] Function1/makeDataEntries: Introduced macro to simplify instantiation of Function1Types --- .../functions/Function1/makeDataEntries.C | 55 ++++++------------- 1 file changed, 16 insertions(+), 39 deletions(-) diff --git a/src/OpenFOAM/primitives/functions/Function1/makeDataEntries.C b/src/OpenFOAM/primitives/functions/Function1/makeDataEntries.C index c8d06e5bbc..aaae5bc10a 100644 --- a/src/OpenFOAM/primitives/functions/Function1/makeDataEntries.C +++ b/src/OpenFOAM/primitives/functions/Function1/makeDataEntries.C @@ -37,6 +37,17 @@ License #include "symmTensor.H" #include "tensor.H" +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeFunction1s(Type) \ + makeFunction1(Type); \ + makeFunction1Type(Constant, Type); \ + makeFunction1Type(Polynomial, Type); \ + makeFunction1Type(Sine, Type); \ + makeFunction1Type(CSV, Type); \ + makeFunction1Type(Table, Type); \ + makeFunction1Type(TableFile, Type); + namespace Foam { makeFunction1(label); @@ -44,45 +55,11 @@ namespace Foam // Polynomial functions and interpolation do evaluate to label // Instead evaluate a scalar and convert to label as appropriate - makeFunction1(scalar); - makeFunction1Type(Constant, scalar); - makeFunction1Type(Polynomial, scalar); - makeFunction1Type(Sine, scalar); - makeFunction1Type(CSV, scalar); - makeFunction1Type(Table, scalar); - makeFunction1Type(TableFile, scalar); - - makeFunction1(vector); - makeFunction1Type(Constant, vector); - makeFunction1Type(Polynomial, vector); - makeFunction1Type(Sine, vector); - makeFunction1Type(CSV, vector); - makeFunction1Type(Table, vector); - makeFunction1Type(TableFile, vector); - - makeFunction1(sphericalTensor); - makeFunction1Type(Constant, sphericalTensor); - makeFunction1Type(Polynomial, sphericalTensor); - makeFunction1Type(Sine, sphericalTensor); - makeFunction1Type(CSV, sphericalTensor); - makeFunction1Type(Table, sphericalTensor); - makeFunction1Type(TableFile, sphericalTensor); - - makeFunction1(symmTensor); - makeFunction1Type(Constant, symmTensor); - makeFunction1Type(Polynomial, symmTensor); - makeFunction1Type(Sine, symmTensor); - makeFunction1Type(CSV, symmTensor); - makeFunction1Type(Table, symmTensor); - makeFunction1Type(TableFile, symmTensor); - - makeFunction1(tensor); - makeFunction1Type(Constant, tensor); - makeFunction1Type(Polynomial, tensor); - makeFunction1Type(Sine, tensor); - makeFunction1Type(CSV, tensor); - makeFunction1Type(Table, tensor); - makeFunction1Type(TableFile, tensor); + makeFunction1s(scalar); + makeFunction1s(vector); + makeFunction1s(sphericalTensor); + makeFunction1s(symmTensor); + makeFunction1s(tensor); } -- GitLab