mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Consistently indent continuation backslashes in macro definitions
This commit is contained in:
@ -150,10 +150,10 @@ public:
|
||||
// Instantiation for multi-component-multi-component pairs
|
||||
#define makeInterfaceCompositionType(Type, Thermo, Comp, Mix, Phys, OtherThermo, OtherComp, OtherMix, OtherPhys)\
|
||||
\
|
||||
typedef Thermo<Comp, SpecieMixture<Mix<Phys>>> \
|
||||
typedef Thermo<Comp, SpecieMixture<Mix<Phys>>> \
|
||||
Type##Thermo##Comp##Mix##Phys; \
|
||||
\
|
||||
typedef OtherThermo<OtherComp, OtherMix<OtherPhys>> \
|
||||
typedef OtherThermo<OtherComp, OtherMix<OtherPhys>> \
|
||||
Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys; \
|
||||
\
|
||||
addInterfaceCompositionToRunTimeSelectionTable \
|
||||
@ -166,10 +166,10 @@ public:
|
||||
// Instantiation for multi-component-single-component pairs
|
||||
#define makeSpecieInterfaceCompositionType(Type, Thermo, Comp, Mix, Phys, OtherThermo, OtherComp, OtherMix, OtherPhys)\
|
||||
\
|
||||
typedef Thermo<Comp, SpecieMixture<Mix<Phys>>> \
|
||||
typedef Thermo<Comp, SpecieMixture<Mix<Phys>>> \
|
||||
Type##Thermo##Comp##Mix##Phys; \
|
||||
\
|
||||
typedef OtherThermo<OtherComp, SpecieMixture<OtherMix<OtherPhys>>> \
|
||||
typedef OtherThermo<OtherComp, SpecieMixture<OtherMix<OtherPhys>>> \
|
||||
Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys; \
|
||||
\
|
||||
addInterfaceCompositionToRunTimeSelectionTable \
|
||||
|
||||
@ -58,33 +58,33 @@ packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
|
||||
# - exclude Doxygen documentation etc
|
||||
#
|
||||
|
||||
find -H $packDir \
|
||||
! -type d \
|
||||
\( -type f -o -type l \) \
|
||||
! -name "*~" \
|
||||
-a ! -name ".*~" \
|
||||
-a ! -name "*.orig" \
|
||||
-a ! -name "*.dep" \
|
||||
-a ! -name "*.o" \
|
||||
-a ! -name "*.so" \
|
||||
-a ! -name "*.a" \
|
||||
-a ! -name "*.tar" \
|
||||
-a ! -name "*.tar.gz" \
|
||||
-a ! -name "*.tgz" \
|
||||
-a ! -name "*.tar.bz2" \
|
||||
-a ! -name "*.tbz" \
|
||||
-a ! -name "core" \
|
||||
-a ! -name "core.[1-9]*" \
|
||||
-a ! -name "libccmio*" \
|
||||
| sed \
|
||||
-e '\@/\.git/@d' \
|
||||
-e '\@/\.tags/@d' \
|
||||
-e '\@/platforms/@d' \
|
||||
-e '\@/t/@d' \
|
||||
-e '\@/Make[.A-Za-z]*/[^/]*/@d' \
|
||||
-e '\@/[Dd]oxygen/html/@d' \
|
||||
-e '\@/download/@d' \
|
||||
-e '\@/libccmio-.*/@d' \
|
||||
find -H $packDir \
|
||||
! -type d \
|
||||
\( -type f -o -type l \) \
|
||||
! -name "*~" \
|
||||
-a ! -name ".*~" \
|
||||
-a ! -name "*.orig" \
|
||||
-a ! -name "*.dep" \
|
||||
-a ! -name "*.o" \
|
||||
-a ! -name "*.so" \
|
||||
-a ! -name "*.a" \
|
||||
-a ! -name "*.tar" \
|
||||
-a ! -name "*.tar.gz" \
|
||||
-a ! -name "*.tgz" \
|
||||
-a ! -name "*.tar.bz2" \
|
||||
-a ! -name "*.tbz" \
|
||||
-a ! -name "core" \
|
||||
-a ! -name "core.[1-9]*" \
|
||||
-a ! -name "libccmio*" \
|
||||
| sed \
|
||||
-e '\@/\.git/@d' \
|
||||
-e '\@/\.tags/@d' \
|
||||
-e '\@/platforms/@d' \
|
||||
-e '\@/t/@d' \
|
||||
-e '\@/Make[.A-Za-z]*/[^/]*/@d' \
|
||||
-e '\@/[Dd]oxygen/html/@d' \
|
||||
-e '\@/download/@d' \
|
||||
-e '\@/libccmio-.*/@d' \
|
||||
-e '\@\./debian/@d'
|
||||
|
||||
|
||||
|
||||
@ -31,18 +31,18 @@ License
|
||||
|
||||
#if (UINT_MAX == 0xFFFFFFFF)
|
||||
// 32-bit counting, Hamming weight method
|
||||
# define COUNT_PACKEDBITS(sum, x) \
|
||||
{ \
|
||||
x -= (x >> 1) & 0x55555555; \
|
||||
x = (x & 0x33333333) + ((x >> 2) & 0x33333333); \
|
||||
sum += (((x + (x >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24; \
|
||||
# define COUNT_PACKEDBITS(sum, x) \
|
||||
{ \
|
||||
x -= (x >> 1) & 0x55555555; \
|
||||
x = (x & 0x33333333) + ((x >> 2) & 0x33333333); \
|
||||
sum += (((x + (x >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24; \
|
||||
}
|
||||
#elif (UINT_MAX == 0xFFFFFFFFFFFFFFFF)
|
||||
// 64-bit counting, Hamming weight method
|
||||
# define COUNT_PACKEDBITS(sum, x) \
|
||||
{ \
|
||||
x -= (x >> 1) & 0x5555555555555555; \
|
||||
x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333); \
|
||||
# define COUNT_PACKEDBITS(sum, x) \
|
||||
{ \
|
||||
x -= (x >> 1) & 0x5555555555555555; \
|
||||
x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333); \
|
||||
sum += (((x + (x >> 4)) & 0x0F0F0F0F0F0F0F0F) * 0x0101010101010101) >> 56;\
|
||||
}
|
||||
#else
|
||||
|
||||
@ -440,11 +440,11 @@ ostream& operator<<(ostream&, const InfoProxy<token>&);
|
||||
template<>
|
||||
Ostream& operator<<(Ostream& os, const InfoProxy<token>& ip);
|
||||
|
||||
#define defineCompoundTypeName(Type, Name) \
|
||||
#define defineCompoundTypeName(Type, Name) \
|
||||
defineTemplateTypeNameAndDebugWithName(token::Compound<Type>, #Type, 0);
|
||||
|
||||
#define addCompoundToRunTimeSelectionTable(Type, Name) \
|
||||
token::compound::addIstreamConstructorToTable<token::Compound<Type>> \
|
||||
#define addCompoundToRunTimeSelectionTable(Type, Name) \
|
||||
token::compound::addIstreamConstructorToTable<token::Compound<Type>> \
|
||||
add##Name##IstreamConstructorToTable_;
|
||||
|
||||
|
||||
|
||||
@ -74,10 +74,10 @@ class StaticAssertionTest {};
|
||||
// ~~~~~~~~~~~~~
|
||||
|
||||
//- Assert that some test is true at compile-time
|
||||
#define StaticAssert(Test) \
|
||||
typedef ::Foam::StaticAssertionTest \
|
||||
< \
|
||||
sizeof( ::Foam::StaticAssertionFailed<((Test) ? true : false)>) \
|
||||
#define StaticAssert(Test) \
|
||||
typedef ::Foam::StaticAssertionTest \
|
||||
< \
|
||||
sizeof( ::Foam::StaticAssertionFailed<((Test) ? true : false)>) \
|
||||
> StaticAssertMacro(StaticAssertionTest, __LINE__)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -34,39 +34,39 @@ Description
|
||||
|
||||
// add to hash-table of functions with typename as the key
|
||||
#define addToRunTimeSelectionTable\
|
||||
(baseType,thisType,argNames) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table */ \
|
||||
baseType::add##argNames##ConstructorToTable<thisType> \
|
||||
(baseType,thisType,argNames) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table */ \
|
||||
baseType::add##argNames##ConstructorToTable<thisType> \
|
||||
add##thisType##argNames##ConstructorTo##baseType##Table_
|
||||
|
||||
|
||||
// add to hash-table of functions with 'lookup' as the key
|
||||
#define addNamedToRunTimeSelectionTable\
|
||||
(baseType,thisType,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table, find by lookup */ \
|
||||
baseType::add##argNames##ConstructorToTable<thisType> \
|
||||
add_##lookup##_##thisType##argNames##ConstructorTo##baseType##Table_ \
|
||||
(baseType,thisType,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table, find by lookup */ \
|
||||
baseType::add##argNames##ConstructorToTable<thisType> \
|
||||
add_##lookup##_##thisType##argNames##ConstructorTo##baseType##Table_ \
|
||||
(#lookup)
|
||||
|
||||
|
||||
// add to hash-table of functions with typename as the key
|
||||
#define addRemovableToRunTimeSelectionTable\
|
||||
(baseType,thisType,argNames) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table */ \
|
||||
baseType::addRemovable##argNames##ConstructorToTable<thisType> \
|
||||
(baseType,thisType,argNames) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table */ \
|
||||
baseType::addRemovable##argNames##ConstructorToTable<thisType> \
|
||||
addRemovable##thisType##argNames##ConstructorTo##baseType##Table_
|
||||
|
||||
|
||||
// add to hash-table of functions with 'lookup' as the key
|
||||
#define addRemovableNamedToRunTimeSelectionTable\
|
||||
(baseType,thisType,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table, find by lookup */ \
|
||||
baseType::addRemovable##argNames##ConstructorToTable<thisType> \
|
||||
addRemovable_##lookup##_##thisType##argNames##ConstructorTo \
|
||||
(baseType,thisType,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table, find by lookup */ \
|
||||
baseType::addRemovable##argNames##ConstructorToTable<thisType> \
|
||||
addRemovable_##lookup##_##thisType##argNames##ConstructorTo \
|
||||
##baseType##Table_(#lookup)
|
||||
|
||||
|
||||
@ -76,21 +76,21 @@ Description
|
||||
// add to hash-table of functions with typename as the key
|
||||
// use when baseType doesn't need a template argument (eg, is a typedef)
|
||||
#define addTemplateToRunTimeSelectionTable\
|
||||
(baseType,thisType,Targ,argNames) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table */ \
|
||||
baseType::add##argNames##ConstructorToTable<thisType<Targ>> \
|
||||
(baseType,thisType,Targ,argNames) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table */ \
|
||||
baseType::add##argNames##ConstructorToTable<thisType<Targ>> \
|
||||
add##thisType##Targ##argNames##ConstructorTo##baseType##Table_
|
||||
|
||||
|
||||
// add to hash-table of functions with 'lookup' as the key
|
||||
// use when baseType doesn't need a template argument (eg, is a typedef)
|
||||
#define addNamedTemplateToRunTimeSelectionTable\
|
||||
(baseType,thisType,Targ,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table, find by lookup */ \
|
||||
baseType::add##argNames##ConstructorToTable<thisType<Targ>> \
|
||||
add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType \
|
||||
(baseType,thisType,Targ,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table, find by lookup */ \
|
||||
baseType::add##argNames##ConstructorToTable<thisType<Targ>> \
|
||||
add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType \
|
||||
##Table_(#lookup)
|
||||
|
||||
|
||||
@ -100,21 +100,21 @@ Description
|
||||
// add to hash-table of functions with typename as the key
|
||||
// use when baseType requires the Targ template argument as well
|
||||
#define addTemplatedToRunTimeSelectionTable\
|
||||
(baseType,thisType,Targ,argNames) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table */ \
|
||||
baseType<Targ>::add##argNames##ConstructorToTable<thisType<Targ>> \
|
||||
(baseType,thisType,Targ,argNames) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table */ \
|
||||
baseType<Targ>::add##argNames##ConstructorToTable<thisType<Targ>> \
|
||||
add##thisType##Targ##argNames##ConstructorTo##baseType##Targ##Table_
|
||||
|
||||
|
||||
// add to hash-table of functions with 'lookup' as the key
|
||||
// use when baseType requires the Targ template argument as well
|
||||
#define addNamedTemplatedToRunTimeSelectionTable\
|
||||
(baseType,thisType,Targ,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table, find by lookup */ \
|
||||
baseType<Targ>::add##argNames##ConstructorToTable<thisType<Targ>> \
|
||||
add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType## \
|
||||
(baseType,thisType,Targ,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table, find by lookup */ \
|
||||
baseType<Targ>::add##argNames##ConstructorToTable<thisType<Targ>> \
|
||||
add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType## \
|
||||
Targ##Table_(#lookup)
|
||||
|
||||
|
||||
|
||||
@ -47,89 +47,89 @@ Description
|
||||
// ~~~~~~~~~~~~~
|
||||
// declare a run-time selection:
|
||||
#define declareRunTimeSelectionTable\
|
||||
(autoPtr,baseType,argNames,argList,parList) \
|
||||
\
|
||||
/* Construct from argList function pointer type */ \
|
||||
typedef autoPtr<baseType> (*argNames##ConstructorPtr)argList; \
|
||||
\
|
||||
/* Construct from argList function table type */ \
|
||||
typedef HashTable<argNames##ConstructorPtr, word, string::hash> \
|
||||
argNames##ConstructorTable; \
|
||||
\
|
||||
/* Construct from argList function pointer table pointer */ \
|
||||
static argNames##ConstructorTable* argNames##ConstructorTablePtr_; \
|
||||
\
|
||||
/* Table constructor called from the table add function */ \
|
||||
static void construct##argNames##ConstructorTables(); \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
static void destroy##argNames##ConstructorTables(); \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
template<class baseType##Type> \
|
||||
class add##argNames##ConstructorToTable \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
static autoPtr<baseType> New argList \
|
||||
{ \
|
||||
return autoPtr<baseType>(new baseType##Type parList); \
|
||||
} \
|
||||
\
|
||||
add##argNames##ConstructorToTable \
|
||||
( \
|
||||
const word& lookup = baseType##Type::typeName \
|
||||
) \
|
||||
{ \
|
||||
construct##argNames##ConstructorTables(); \
|
||||
if (!argNames##ConstructorTablePtr_->insert(lookup, New)) \
|
||||
{ \
|
||||
std::cerr<< "Duplicate entry " << lookup \
|
||||
<< " in runtime selection table " << #baseType \
|
||||
<< std::endl; \
|
||||
error::safePrintStack(std::cerr); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
~add##argNames##ConstructorToTable() \
|
||||
{ \
|
||||
destroy##argNames##ConstructorTables(); \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
/* Remove only the entry (not the table) upon destruction */ \
|
||||
template<class baseType##Type> \
|
||||
class addRemovable##argNames##ConstructorToTable \
|
||||
{ \
|
||||
/* retain lookup name for later removal */ \
|
||||
const word& lookup_; \
|
||||
\
|
||||
public: \
|
||||
\
|
||||
static autoPtr<baseType> New argList \
|
||||
{ \
|
||||
return autoPtr<baseType>(new baseType##Type parList); \
|
||||
} \
|
||||
\
|
||||
addRemovable##argNames##ConstructorToTable \
|
||||
( \
|
||||
const word& lookup = baseType##Type::typeName \
|
||||
) \
|
||||
: \
|
||||
lookup_(lookup) \
|
||||
{ \
|
||||
construct##argNames##ConstructorTables(); \
|
||||
argNames##ConstructorTablePtr_->set(lookup, New); \
|
||||
} \
|
||||
\
|
||||
~addRemovable##argNames##ConstructorToTable() \
|
||||
{ \
|
||||
if (argNames##ConstructorTablePtr_) \
|
||||
{ \
|
||||
argNames##ConstructorTablePtr_->erase(lookup_); \
|
||||
} \
|
||||
} \
|
||||
(autoPtr,baseType,argNames,argList,parList) \
|
||||
\
|
||||
/* Construct from argList function pointer type */ \
|
||||
typedef autoPtr<baseType> (*argNames##ConstructorPtr)argList; \
|
||||
\
|
||||
/* Construct from argList function table type */ \
|
||||
typedef HashTable<argNames##ConstructorPtr, word, string::hash> \
|
||||
argNames##ConstructorTable; \
|
||||
\
|
||||
/* Construct from argList function pointer table pointer */ \
|
||||
static argNames##ConstructorTable* argNames##ConstructorTablePtr_; \
|
||||
\
|
||||
/* Table constructor called from the table add function */ \
|
||||
static void construct##argNames##ConstructorTables(); \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
static void destroy##argNames##ConstructorTables(); \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
template<class baseType##Type> \
|
||||
class add##argNames##ConstructorToTable \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
static autoPtr<baseType> New argList \
|
||||
{ \
|
||||
return autoPtr<baseType>(new baseType##Type parList); \
|
||||
} \
|
||||
\
|
||||
add##argNames##ConstructorToTable \
|
||||
( \
|
||||
const word& lookup = baseType##Type::typeName \
|
||||
) \
|
||||
{ \
|
||||
construct##argNames##ConstructorTables(); \
|
||||
if (!argNames##ConstructorTablePtr_->insert(lookup, New)) \
|
||||
{ \
|
||||
std::cerr<< "Duplicate entry " << lookup \
|
||||
<< " in runtime selection table " << #baseType \
|
||||
<< std::endl; \
|
||||
error::safePrintStack(std::cerr); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
~add##argNames##ConstructorToTable() \
|
||||
{ \
|
||||
destroy##argNames##ConstructorTables(); \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
/* Remove only the entry (not the table) upon destruction */ \
|
||||
template<class baseType##Type> \
|
||||
class addRemovable##argNames##ConstructorToTable \
|
||||
{ \
|
||||
/* retain lookup name for later removal */ \
|
||||
const word& lookup_; \
|
||||
\
|
||||
public: \
|
||||
\
|
||||
static autoPtr<baseType> New argList \
|
||||
{ \
|
||||
return autoPtr<baseType>(new baseType##Type parList); \
|
||||
} \
|
||||
\
|
||||
addRemovable##argNames##ConstructorToTable \
|
||||
( \
|
||||
const word& lookup = baseType##Type::typeName \
|
||||
) \
|
||||
: \
|
||||
lookup_(lookup) \
|
||||
{ \
|
||||
construct##argNames##ConstructorTables(); \
|
||||
argNames##ConstructorTablePtr_->set(lookup, New); \
|
||||
} \
|
||||
\
|
||||
~addRemovable##argNames##ConstructorToTable() \
|
||||
{ \
|
||||
if (argNames##ConstructorTablePtr_) \
|
||||
{ \
|
||||
argNames##ConstructorTablePtr_->erase(lookup_); \
|
||||
} \
|
||||
} \
|
||||
};
|
||||
|
||||
|
||||
@ -138,151 +138,151 @@ Description
|
||||
// ~~~~~~~~~~~~~
|
||||
// declare a run-time selection for derived classes:
|
||||
#define declareRunTimeNewSelectionTable\
|
||||
(autoPtr,baseType,argNames,argList,parList) \
|
||||
\
|
||||
/* Construct from argList function pointer type */ \
|
||||
typedef autoPtr<baseType> (*argNames##ConstructorPtr)argList; \
|
||||
\
|
||||
/* Construct from argList function table type */ \
|
||||
typedef HashTable<argNames##ConstructorPtr, word, string::hash> \
|
||||
argNames##ConstructorTable; \
|
||||
\
|
||||
/* Construct from argList function pointer table pointer */ \
|
||||
static argNames##ConstructorTable* argNames##ConstructorTablePtr_; \
|
||||
\
|
||||
/* Table constructor called from the table add function */ \
|
||||
static void construct##argNames##ConstructorTables(); \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
static void destroy##argNames##ConstructorTables(); \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
template<class baseType##Type> \
|
||||
class add##argNames##ConstructorToTable \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
static autoPtr<baseType> New##baseType argList \
|
||||
{ \
|
||||
return autoPtr<baseType>(baseType##Type::New parList.ptr()); \
|
||||
} \
|
||||
\
|
||||
add##argNames##ConstructorToTable \
|
||||
( \
|
||||
const word& lookup = baseType##Type::typeName \
|
||||
) \
|
||||
{ \
|
||||
construct##argNames##ConstructorTables(); \
|
||||
if \
|
||||
( \
|
||||
!argNames##ConstructorTablePtr_->insert \
|
||||
( \
|
||||
lookup, \
|
||||
New##baseType \
|
||||
) \
|
||||
) \
|
||||
{ \
|
||||
std::cerr<< "Duplicate entry " << lookup \
|
||||
<< " in runtime selection table " << #baseType \
|
||||
<< std::endl; \
|
||||
error::safePrintStack(std::cerr); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
~add##argNames##ConstructorToTable() \
|
||||
{ \
|
||||
destroy##argNames##ConstructorTables(); \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
template<class baseType##Type> \
|
||||
class addRemovable##argNames##ConstructorToTable \
|
||||
{ \
|
||||
/* retain lookup name for later removal */ \
|
||||
const word& lookup_; \
|
||||
\
|
||||
public: \
|
||||
\
|
||||
static autoPtr<baseType> New##baseType argList \
|
||||
{ \
|
||||
return autoPtr<baseType>(baseType##Type::New parList.ptr()); \
|
||||
} \
|
||||
\
|
||||
addRemovable##argNames##ConstructorToTable \
|
||||
( \
|
||||
const word& lookup = baseType##Type::typeName \
|
||||
) \
|
||||
: \
|
||||
lookup_(lookup) \
|
||||
{ \
|
||||
construct##argNames##ConstructorTables(); \
|
||||
argNames##ConstructorTablePtr_->set \
|
||||
( \
|
||||
lookup, \
|
||||
New##baseType \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
~addRemovable##argNames##ConstructorToTable() \
|
||||
{ \
|
||||
if (argNames##ConstructorTablePtr_) \
|
||||
{ \
|
||||
argNames##ConstructorTablePtr_->erase(lookup_); \
|
||||
} \
|
||||
} \
|
||||
(autoPtr,baseType,argNames,argList,parList) \
|
||||
\
|
||||
/* Construct from argList function pointer type */ \
|
||||
typedef autoPtr<baseType> (*argNames##ConstructorPtr)argList; \
|
||||
\
|
||||
/* Construct from argList function table type */ \
|
||||
typedef HashTable<argNames##ConstructorPtr, word, string::hash> \
|
||||
argNames##ConstructorTable; \
|
||||
\
|
||||
/* Construct from argList function pointer table pointer */ \
|
||||
static argNames##ConstructorTable* argNames##ConstructorTablePtr_; \
|
||||
\
|
||||
/* Table constructor called from the table add function */ \
|
||||
static void construct##argNames##ConstructorTables(); \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
static void destroy##argNames##ConstructorTables(); \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
template<class baseType##Type> \
|
||||
class add##argNames##ConstructorToTable \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
static autoPtr<baseType> New##baseType argList \
|
||||
{ \
|
||||
return autoPtr<baseType>(baseType##Type::New parList.ptr()); \
|
||||
} \
|
||||
\
|
||||
add##argNames##ConstructorToTable \
|
||||
( \
|
||||
const word& lookup = baseType##Type::typeName \
|
||||
) \
|
||||
{ \
|
||||
construct##argNames##ConstructorTables(); \
|
||||
if \
|
||||
( \
|
||||
!argNames##ConstructorTablePtr_->insert \
|
||||
( \
|
||||
lookup, \
|
||||
New##baseType \
|
||||
) \
|
||||
) \
|
||||
{ \
|
||||
std::cerr<< "Duplicate entry " << lookup \
|
||||
<< " in runtime selection table " << #baseType \
|
||||
<< std::endl; \
|
||||
error::safePrintStack(std::cerr); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
~add##argNames##ConstructorToTable() \
|
||||
{ \
|
||||
destroy##argNames##ConstructorTables(); \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
template<class baseType##Type> \
|
||||
class addRemovable##argNames##ConstructorToTable \
|
||||
{ \
|
||||
/* retain lookup name for later removal */ \
|
||||
const word& lookup_; \
|
||||
\
|
||||
public: \
|
||||
\
|
||||
static autoPtr<baseType> New##baseType argList \
|
||||
{ \
|
||||
return autoPtr<baseType>(baseType##Type::New parList.ptr()); \
|
||||
} \
|
||||
\
|
||||
addRemovable##argNames##ConstructorToTable \
|
||||
( \
|
||||
const word& lookup = baseType##Type::typeName \
|
||||
) \
|
||||
: \
|
||||
lookup_(lookup) \
|
||||
{ \
|
||||
construct##argNames##ConstructorTables(); \
|
||||
argNames##ConstructorTablePtr_->set \
|
||||
( \
|
||||
lookup, \
|
||||
New##baseType \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
~addRemovable##argNames##ConstructorToTable() \
|
||||
{ \
|
||||
if (argNames##ConstructorTablePtr_) \
|
||||
{ \
|
||||
argNames##ConstructorTablePtr_->erase(lookup_); \
|
||||
} \
|
||||
} \
|
||||
};
|
||||
|
||||
|
||||
// internal use:
|
||||
// constructor aid
|
||||
#define defineRunTimeSelectionTableConstructor\
|
||||
(baseType,argNames) \
|
||||
\
|
||||
/* Table constructor called from the table add function */ \
|
||||
void baseType::construct##argNames##ConstructorTables() \
|
||||
{ \
|
||||
static bool constructed = false; \
|
||||
if (!constructed) \
|
||||
{ \
|
||||
constructed = true; \
|
||||
baseType::argNames##ConstructorTablePtr_ \
|
||||
= new baseType::argNames##ConstructorTable; \
|
||||
} \
|
||||
(baseType,argNames) \
|
||||
\
|
||||
/* Table constructor called from the table add function */ \
|
||||
void baseType::construct##argNames##ConstructorTables() \
|
||||
{ \
|
||||
static bool constructed = false; \
|
||||
if (!constructed) \
|
||||
{ \
|
||||
constructed = true; \
|
||||
baseType::argNames##ConstructorTablePtr_ \
|
||||
= new baseType::argNames##ConstructorTable; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
// internal use:
|
||||
// destructor aid
|
||||
#define defineRunTimeSelectionTableDestructor\
|
||||
(baseType,argNames) \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void baseType::destroy##argNames##ConstructorTables() \
|
||||
{ \
|
||||
if (baseType::argNames##ConstructorTablePtr_) \
|
||||
{ \
|
||||
delete baseType::argNames##ConstructorTablePtr_; \
|
||||
baseType::argNames##ConstructorTablePtr_ = NULL; \
|
||||
} \
|
||||
(baseType,argNames) \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void baseType::destroy##argNames##ConstructorTables() \
|
||||
{ \
|
||||
if (baseType::argNames##ConstructorTablePtr_) \
|
||||
{ \
|
||||
delete baseType::argNames##ConstructorTablePtr_; \
|
||||
baseType::argNames##ConstructorTablePtr_ = NULL; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
// internal use:
|
||||
// create pointer to hash-table of functions
|
||||
#define defineRunTimeSelectionTablePtr\
|
||||
(baseType,argNames) \
|
||||
\
|
||||
/* Define the constructor function table */ \
|
||||
baseType::argNames##ConstructorTable* \
|
||||
(baseType,argNames) \
|
||||
\
|
||||
/* Define the constructor function table */ \
|
||||
baseType::argNames##ConstructorTable* \
|
||||
baseType::argNames##ConstructorTablePtr_ = NULL
|
||||
|
||||
|
||||
// not much in use:
|
||||
#define defineTemplateRunTimeSelectionTablePtr(baseType,argNames) \
|
||||
\
|
||||
/* Define the constructor function table */ \
|
||||
typename baseType::argNames##ConstructorTable* \
|
||||
#define defineTemplateRunTimeSelectionTablePtr(baseType,argNames) \
|
||||
\
|
||||
/* Define the constructor function table */ \
|
||||
typename baseType::argNames##ConstructorTable* \
|
||||
baseType::argNames##ConstructorTablePtr_ = NULL
|
||||
|
||||
|
||||
@ -293,10 +293,10 @@ Description
|
||||
// ~~~~~~~~~~~~~
|
||||
// define run-time selection table
|
||||
#define defineRunTimeSelectionTable\
|
||||
(baseType,argNames) \
|
||||
\
|
||||
defineRunTimeSelectionTablePtr(baseType,argNames); \
|
||||
defineRunTimeSelectionTableConstructor(baseType,argNames); \
|
||||
(baseType,argNames) \
|
||||
\
|
||||
defineRunTimeSelectionTablePtr(baseType,argNames); \
|
||||
defineRunTimeSelectionTableConstructor(baseType,argNames); \
|
||||
defineRunTimeSelectionTableDestructor(baseType,argNames)
|
||||
|
||||
|
||||
@ -305,13 +305,13 @@ Description
|
||||
// define run-time selection table for template classes
|
||||
// use when baseType doesn't need a template argument (eg, is a typedef)
|
||||
#define defineTemplateRunTimeSelectionTable\
|
||||
(baseType,argNames) \
|
||||
\
|
||||
template<> \
|
||||
defineRunTimeSelectionTablePtr(baseType,argNames); \
|
||||
template<> \
|
||||
defineRunTimeSelectionTableConstructor(baseType,argNames); \
|
||||
template<> \
|
||||
(baseType,argNames) \
|
||||
\
|
||||
template<> \
|
||||
defineRunTimeSelectionTablePtr(baseType,argNames); \
|
||||
template<> \
|
||||
defineRunTimeSelectionTableConstructor(baseType,argNames); \
|
||||
template<> \
|
||||
defineRunTimeSelectionTableDestructor(baseType,argNames)
|
||||
|
||||
|
||||
@ -322,18 +322,18 @@ Description
|
||||
// constructor aid
|
||||
// use when baseType requires the Targ template argument
|
||||
#define defineTemplatedRunTimeSelectionTableConstructor\
|
||||
(baseType,argNames,Targ) \
|
||||
\
|
||||
/* Table constructor called from the table add function */ \
|
||||
void baseType<Targ>::construct##argNames##ConstructorTables() \
|
||||
{ \
|
||||
static bool constructed = false; \
|
||||
if (!constructed) \
|
||||
{ \
|
||||
constructed = true; \
|
||||
baseType<Targ>::argNames##ConstructorTablePtr_ \
|
||||
= new baseType<Targ>::argNames##ConstructorTable; \
|
||||
} \
|
||||
(baseType,argNames,Targ) \
|
||||
\
|
||||
/* Table constructor called from the table add function */ \
|
||||
void baseType<Targ>::construct##argNames##ConstructorTables() \
|
||||
{ \
|
||||
static bool constructed = false; \
|
||||
if (!constructed) \
|
||||
{ \
|
||||
constructed = true; \
|
||||
baseType<Targ>::argNames##ConstructorTablePtr_ \
|
||||
= new baseType<Targ>::argNames##ConstructorTable; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
@ -341,16 +341,16 @@ Description
|
||||
// destructor aid
|
||||
// use when baseType requires the Targ template argument
|
||||
#define defineTemplatedRunTimeSelectionTableDestructor\
|
||||
(baseType,argNames,Targ) \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void baseType<Targ>::destroy##argNames##ConstructorTables() \
|
||||
{ \
|
||||
if (baseType<Targ>::argNames##ConstructorTablePtr_) \
|
||||
{ \
|
||||
delete baseType<Targ>::argNames##ConstructorTablePtr_; \
|
||||
baseType<Targ>::argNames##ConstructorTablePtr_ = NULL; \
|
||||
} \
|
||||
(baseType,argNames,Targ) \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void baseType<Targ>::destroy##argNames##ConstructorTables() \
|
||||
{ \
|
||||
if (baseType<Targ>::argNames##ConstructorTablePtr_) \
|
||||
{ \
|
||||
delete baseType<Targ>::argNames##ConstructorTablePtr_; \
|
||||
baseType<Targ>::argNames##ConstructorTablePtr_ = NULL; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
@ -358,10 +358,10 @@ Description
|
||||
// create pointer to hash-table of functions
|
||||
// use when baseType requires the Targ template argument
|
||||
#define defineTemplatedRunTimeSelectionTablePtr\
|
||||
(baseType,argNames,Targ) \
|
||||
\
|
||||
/* Define the constructor function table */ \
|
||||
baseType<Targ>::argNames##ConstructorTable* \
|
||||
(baseType,argNames,Targ) \
|
||||
\
|
||||
/* Define the constructor function table */ \
|
||||
baseType<Targ>::argNames##ConstructorTable* \
|
||||
baseType<Targ>::argNames##ConstructorTablePtr_ = NULL
|
||||
|
||||
|
||||
@ -370,13 +370,13 @@ Description
|
||||
// define run-time selection table for template classes
|
||||
// use when baseType requires the Targ template argument
|
||||
#define defineTemplatedRunTimeSelectionTable\
|
||||
(baseType,argNames,Targ) \
|
||||
\
|
||||
template<> \
|
||||
defineTemplatedRunTimeSelectionTablePtr(baseType,argNames,Targ); \
|
||||
template<> \
|
||||
defineTemplatedRunTimeSelectionTableConstructor(baseType,argNames,Targ); \
|
||||
template<> \
|
||||
(baseType,argNames,Targ) \
|
||||
\
|
||||
template<> \
|
||||
defineTemplatedRunTimeSelectionTablePtr(baseType,argNames,Targ); \
|
||||
template<> \
|
||||
defineTemplatedRunTimeSelectionTableConstructor(baseType,argNames,Targ); \
|
||||
template<> \
|
||||
defineTemplatedRunTimeSelectionTableDestructor(baseType,argNames,Targ)
|
||||
|
||||
|
||||
|
||||
@ -36,10 +36,10 @@ Description
|
||||
|
||||
// add to hash-table of functions with 'lookup' as the key
|
||||
#define addNamedToGlobalFunctionSelectionTable\
|
||||
(memberFunction,argNames,lookup,functionPtr) \
|
||||
\
|
||||
/* Add to the table, find by lookup name */ \
|
||||
add##memberFunction##argNames##GlobalMemberFunctionToTable \
|
||||
(memberFunction,argNames,lookup,functionPtr) \
|
||||
\
|
||||
/* Add to the table, find by lookup name */ \
|
||||
add##memberFunction##argNames##GlobalMemberFunctionToTable \
|
||||
add_##lookup##_##memberFunction##argNames##GlobalMemberFunctionTo##Table_ \
|
||||
(#lookup, functionPtr)
|
||||
|
||||
|
||||
@ -40,87 +40,87 @@ Description
|
||||
// ~~~~~~~~~~~~~
|
||||
// declare a run-time selection:
|
||||
#define declareGlobalFunctionSelectionTable\
|
||||
(returnType,memberFunction,argNames,argList,parList) \
|
||||
\
|
||||
/* Construct from argList function pointer type */ \
|
||||
(returnType,memberFunction,argNames,argList,parList) \
|
||||
\
|
||||
/* Construct from argList function pointer type */ \
|
||||
typedef returnType (*memberFunction##argNames##MemberFunctionPtr)argList; \
|
||||
\
|
||||
/* Construct from argList function table type */ \
|
||||
typedef HashTable \
|
||||
<memberFunction##argNames##MemberFunctionPtr, word, string::hash> \
|
||||
memberFunction##argNames##MemberFunctionTable; \
|
||||
\
|
||||
/* Construct from argList function pointer table pointer */ \
|
||||
extern memberFunction##argNames##MemberFunctionTable* \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_; \
|
||||
\
|
||||
/* Table memberFunction called from the table add function */ \
|
||||
void construct##memberFunction##argNames##MemberFunctionTables(); \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void destroy##memberFunction##argNames##MemberFunctionTables(); \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
class add##memberFunction##argNames##GlobalMemberFunctionToTable \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
add##memberFunction##argNames##GlobalMemberFunctionToTable \
|
||||
( \
|
||||
const word& lookup, \
|
||||
memberFunction##argNames##MemberFunctionPtr function \
|
||||
) \
|
||||
{ \
|
||||
construct##memberFunction##argNames##MemberFunctionTables(); \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_->insert \
|
||||
( \
|
||||
lookup, \
|
||||
function \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
~add##memberFunction##argNames##GlobalMemberFunctionToTable() \
|
||||
{ \
|
||||
destroy##memberFunction##argNames##MemberFunctionTables(); \
|
||||
} \
|
||||
\
|
||||
/* Construct from argList function table type */ \
|
||||
typedef HashTable \
|
||||
<memberFunction##argNames##MemberFunctionPtr, word, string::hash> \
|
||||
memberFunction##argNames##MemberFunctionTable; \
|
||||
\
|
||||
/* Construct from argList function pointer table pointer */ \
|
||||
extern memberFunction##argNames##MemberFunctionTable* \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_; \
|
||||
\
|
||||
/* Table memberFunction called from the table add function */ \
|
||||
void construct##memberFunction##argNames##MemberFunctionTables(); \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void destroy##memberFunction##argNames##MemberFunctionTables(); \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
class add##memberFunction##argNames##GlobalMemberFunctionToTable \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
add##memberFunction##argNames##GlobalMemberFunctionToTable \
|
||||
( \
|
||||
const word& lookup, \
|
||||
memberFunction##argNames##MemberFunctionPtr function \
|
||||
) \
|
||||
{ \
|
||||
construct##memberFunction##argNames##MemberFunctionTables(); \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_->insert \
|
||||
( \
|
||||
lookup, \
|
||||
function \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
~add##memberFunction##argNames##GlobalMemberFunctionToTable() \
|
||||
{ \
|
||||
destroy##memberFunction##argNames##MemberFunctionTables(); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
// internal use:
|
||||
// constructor/destructor aid
|
||||
#define defineGlobalFunctionSelectionTableConstructDestruct\
|
||||
(memberFunction,argNames) \
|
||||
\
|
||||
/* Table constructor called from the table add function */ \
|
||||
void construct##memberFunction##argNames##MemberFunctionTables() \
|
||||
{ \
|
||||
static bool constructed = false; \
|
||||
if (!constructed) \
|
||||
{ \
|
||||
constructed = true; \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_ \
|
||||
= new memberFunction##argNames##MemberFunctionTable; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void destroy##memberFunction##argNames##MemberFunctionTables() \
|
||||
{ \
|
||||
if (memberFunction##argNames##MemberFunctionTablePtr_) \
|
||||
{ \
|
||||
delete memberFunction##argNames##MemberFunctionTablePtr_; \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_ = NULL; \
|
||||
} \
|
||||
(memberFunction,argNames) \
|
||||
\
|
||||
/* Table constructor called from the table add function */ \
|
||||
void construct##memberFunction##argNames##MemberFunctionTables() \
|
||||
{ \
|
||||
static bool constructed = false; \
|
||||
if (!constructed) \
|
||||
{ \
|
||||
constructed = true; \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_ \
|
||||
= new memberFunction##argNames##MemberFunctionTable; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void destroy##memberFunction##argNames##MemberFunctionTables() \
|
||||
{ \
|
||||
if (memberFunction##argNames##MemberFunctionTablePtr_) \
|
||||
{ \
|
||||
delete memberFunction##argNames##MemberFunctionTablePtr_; \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_ = NULL; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
// internal use:
|
||||
// create pointer to hash-table of functions
|
||||
#define defineGlobalFunctionSelectionTablePtr\
|
||||
(memberFunction,argNames) \
|
||||
\
|
||||
/* Define the memberFunction table */ \
|
||||
memberFunction##argNames##MemberFunctionTable* \
|
||||
(memberFunction,argNames) \
|
||||
\
|
||||
/* Define the memberFunction table */ \
|
||||
memberFunction##argNames##MemberFunctionTable* \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_ = NULL
|
||||
|
||||
|
||||
@ -130,11 +130,11 @@ Description
|
||||
// ~~~~~~~~~~~~~
|
||||
// define run-time selection table
|
||||
#define defineGlobalFunctionSelectionTable\
|
||||
(memberFunction,argNames) \
|
||||
\
|
||||
defineGlobalFunctionSelectionTablePtr \
|
||||
(memberFunction,argNames); \
|
||||
defineGlobalFunctionSelectionTableConstructDestruct \
|
||||
(memberFunction,argNames) \
|
||||
\
|
||||
defineGlobalFunctionSelectionTablePtr \
|
||||
(memberFunction,argNames); \
|
||||
defineGlobalFunctionSelectionTableConstructDestruct \
|
||||
(memberFunction,argNames)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -37,21 +37,21 @@ Description
|
||||
|
||||
// add to hash-table of functions with typename as the key
|
||||
#define addToMemberFunctionSelectionTable\
|
||||
(baseType,thisType,memberFunction,argNames) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table */ \
|
||||
baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType> \
|
||||
(baseType,thisType,memberFunction,argNames) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table */ \
|
||||
baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType> \
|
||||
add##thisType##memberFunction##argNames##MemberFunctionTo##baseType##Table_
|
||||
|
||||
|
||||
|
||||
// add to hash-table of functions with 'lookup' as the key
|
||||
#define addNamedToMemberFunctionSelectionTable\
|
||||
(baseType,thisType,memberFunction,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table, find by lookup name */ \
|
||||
baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType> \
|
||||
add_##lookup##_##thisType##memberFunction##argNames##MemberFunctionTo## \
|
||||
(baseType,thisType,memberFunction,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table, find by lookup name */ \
|
||||
baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType> \
|
||||
add_##lookup##_##thisType##memberFunction##argNames##MemberFunctionTo## \
|
||||
baseType##Table_(#lookup)
|
||||
|
||||
|
||||
@ -61,44 +61,44 @@ Description
|
||||
// add to hash-table of functions with typename as the key
|
||||
// use when baseType doesn't need a template argument (eg, is a typedef)
|
||||
#define addTemplateToMemberFunctionSelectionTable\
|
||||
(baseType,thisType,Targ,memberFunction,argNames) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table */ \
|
||||
baseType::add##memberFunction##argNames## \
|
||||
MemberFunctionToTable<thisType<Targ>> \
|
||||
add##thisType##Targ##memberFunction##argNames##MemberFunctionTo## \
|
||||
(baseType,thisType,Targ,memberFunction,argNames) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table */ \
|
||||
baseType::add##memberFunction##argNames## \
|
||||
MemberFunctionToTable<thisType<Targ>> \
|
||||
add##thisType##Targ##memberFunction##argNames##MemberFunctionTo## \
|
||||
baseType##Table_
|
||||
|
||||
|
||||
// add to hash-table of functions with 'lookup' as the key
|
||||
// use when baseType doesn't need a template argument (eg, is a typedef)
|
||||
#define addNamedTemplateToMemberFunctionSelectionTable\
|
||||
(baseType,thisType,Targ,memberFunction,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table, find by lookup name */ \
|
||||
baseType::add##memberFunction##argNames## \
|
||||
MemberFunctionToTable<thisType<Targ>> \
|
||||
add_##lookup##_##thisType##Targ##memberFunction##argNames## \
|
||||
(baseType,thisType,Targ,memberFunction,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table, find by lookup name */ \
|
||||
baseType::add##memberFunction##argNames## \
|
||||
MemberFunctionToTable<thisType<Targ>> \
|
||||
add_##lookup##_##thisType##Targ##memberFunction##argNames## \
|
||||
MemberFunctionTo##baseType##Table_(#lookup)
|
||||
|
||||
// use when baseType requires the Targ template argument as well
|
||||
#define addTemplatedToMemberFunctionSelectionTable\
|
||||
(baseType,thisType,Targ,memberFunction,argNames) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table */ \
|
||||
baseType<Targ>::add##memberFunction##argNames## \
|
||||
MemberFunctionToTable<thisType<Targ>> \
|
||||
add##thisType##Targ##memberFunction##argNames##MemberFunctionTo## \
|
||||
(baseType,thisType,Targ,memberFunction,argNames) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table */ \
|
||||
baseType<Targ>::add##memberFunction##argNames## \
|
||||
MemberFunctionToTable<thisType<Targ>> \
|
||||
add##thisType##Targ##memberFunction##argNames##MemberFunctionTo## \
|
||||
baseType##Targ##Table_
|
||||
|
||||
// use when baseType requires the Targ template argument as well
|
||||
#define addNamedTemplatedToMemberFunctionSelectionTable\
|
||||
(baseType,thisType,Targ,memberFunction,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table, find by lookup name */ \
|
||||
baseType<Targ>::add##memberFunction##argNames## \
|
||||
MemberFunctionToTable<thisType<Targ>> \
|
||||
add_##lookup##_##thisType##Targ##memberFunction##argNames## \
|
||||
(baseType,thisType,Targ,memberFunction,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table, find by lookup name */ \
|
||||
baseType<Targ>::add##memberFunction##argNames## \
|
||||
MemberFunctionToTable<thisType<Targ>> \
|
||||
add_##lookup##_##thisType##Targ##memberFunction##argNames## \
|
||||
MemberFunctionTo##baseType##Targ##Table_(#lookup)
|
||||
|
||||
|
||||
@ -108,24 +108,24 @@ Description
|
||||
// add to hash-table of functions with typename as the key
|
||||
// use when baseType requires the Targ template argument as well
|
||||
#define addTemplatedToMemberFunctionSelectionTable\
|
||||
(baseType,thisType,Targ,memberFunction,argNames) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table */ \
|
||||
baseType<Targ>::add##memberFunction##argNames## \
|
||||
MemberFunctionToTable<thisType<Targ>> \
|
||||
add##thisType##Targ##memberFunction##argNames##MemberFunctionTo## \
|
||||
(baseType,thisType,Targ,memberFunction,argNames) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table */ \
|
||||
baseType<Targ>::add##memberFunction##argNames## \
|
||||
MemberFunctionToTable<thisType<Targ>> \
|
||||
add##thisType##Targ##memberFunction##argNames##MemberFunctionTo## \
|
||||
baseType##Targ##Table_
|
||||
|
||||
|
||||
// add to hash-table of functions with 'lookup' as the key
|
||||
// use when baseType requires the Targ template argument as well
|
||||
#define addNamedTemplatedToMemberFunctionSelectionTable\
|
||||
(baseType,thisType,Targ,memberFunction,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table, find by lookup name */ \
|
||||
baseType<Targ>::add##memberFunction##argNames## \
|
||||
MemberFunctionToTable<thisType<Targ>> \
|
||||
add_##lookup##_##thisType##Targ##memberFunction##argNames## \
|
||||
(baseType,thisType,Targ,memberFunction,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table, find by lookup name */ \
|
||||
baseType<Targ>::add##memberFunction##argNames## \
|
||||
MemberFunctionToTable<thisType<Targ>> \
|
||||
add_##lookup##_##thisType##Targ##memberFunction##argNames## \
|
||||
MemberFunctionTo##baseType##Targ##Table_(#lookup)
|
||||
|
||||
|
||||
|
||||
@ -43,102 +43,102 @@ Description
|
||||
// ~~~~~~~~~~~~~
|
||||
// declare a run-time selection:
|
||||
#define declareMemberFunctionSelectionTable\
|
||||
(returnType,baseType,memberFunction,argNames,argList,parList) \
|
||||
\
|
||||
/* Construct from argList function pointer type */ \
|
||||
(returnType,baseType,memberFunction,argNames,argList,parList) \
|
||||
\
|
||||
/* Construct from argList function pointer type */ \
|
||||
typedef returnType (*memberFunction##argNames##MemberFunctionPtr)argList; \
|
||||
\
|
||||
/* Construct from argList function table type */ \
|
||||
typedef HashTable \
|
||||
<memberFunction##argNames##MemberFunctionPtr, word, string::hash> \
|
||||
memberFunction##argNames##MemberFunctionTable; \
|
||||
\
|
||||
/* Construct from argList function pointer table pointer */ \
|
||||
static memberFunction##argNames##MemberFunctionTable* \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_; \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
template<class baseType##Type> \
|
||||
class add##memberFunction##argNames##MemberFunctionToTable \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
add##memberFunction##argNames##MemberFunctionToTable \
|
||||
( \
|
||||
const word& lookup = baseType##Type::typeName \
|
||||
) \
|
||||
{ \
|
||||
construct##memberFunction##argNames##MemberFunctionTables(); \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_->insert \
|
||||
( \
|
||||
lookup, \
|
||||
baseType##Type::memberFunction \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
~add##memberFunction##argNames##MemberFunctionToTable() \
|
||||
{ \
|
||||
destroy##memberFunction##argNames##MemberFunctionTables(); \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
/* Table memberFunction called from the table add function */ \
|
||||
static void construct##memberFunction##argNames##MemberFunctionTables(); \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
\
|
||||
/* Construct from argList function table type */ \
|
||||
typedef HashTable \
|
||||
<memberFunction##argNames##MemberFunctionPtr, word, string::hash> \
|
||||
memberFunction##argNames##MemberFunctionTable; \
|
||||
\
|
||||
/* Construct from argList function pointer table pointer */ \
|
||||
static memberFunction##argNames##MemberFunctionTable* \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_; \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
template<class baseType##Type> \
|
||||
class add##memberFunction##argNames##MemberFunctionToTable \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
add##memberFunction##argNames##MemberFunctionToTable \
|
||||
( \
|
||||
const word& lookup = baseType##Type::typeName \
|
||||
) \
|
||||
{ \
|
||||
construct##memberFunction##argNames##MemberFunctionTables(); \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_->insert \
|
||||
( \
|
||||
lookup, \
|
||||
baseType##Type::memberFunction \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
~add##memberFunction##argNames##MemberFunctionToTable() \
|
||||
{ \
|
||||
destroy##memberFunction##argNames##MemberFunctionTables(); \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
/* Table memberFunction called from the table add function */ \
|
||||
static void construct##memberFunction##argNames##MemberFunctionTables(); \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
static void destroy##memberFunction##argNames##MemberFunctionTables()
|
||||
|
||||
|
||||
// internal use:
|
||||
// constructor aid
|
||||
#define defineMemberFunctionSelectionTableMemberFunction\
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
/* Table memberFunction called from the table add function */ \
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
/* Table memberFunction called from the table add function */ \
|
||||
void baseType::construct##memberFunction##argNames##MemberFunctionTables()\
|
||||
{ \
|
||||
static bool constructed = false; \
|
||||
if (!constructed) \
|
||||
{ \
|
||||
constructed = true; \
|
||||
baseType::memberFunction##argNames##MemberFunctionTablePtr_ \
|
||||
{ \
|
||||
static bool constructed = false; \
|
||||
if (!constructed) \
|
||||
{ \
|
||||
constructed = true; \
|
||||
baseType::memberFunction##argNames##MemberFunctionTablePtr_ \
|
||||
= new baseType::memberFunction##argNames##MemberFunctionTable;\
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
// internal use:
|
||||
// destructor aid
|
||||
#define defineMemberFunctionSelectionTableDestructor\
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void baseType::destroy##memberFunction##argNames##MemberFunctionTables() \
|
||||
{ \
|
||||
if (baseType::memberFunction##argNames##MemberFunctionTablePtr_) \
|
||||
{ \
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void baseType::destroy##memberFunction##argNames##MemberFunctionTables() \
|
||||
{ \
|
||||
if (baseType::memberFunction##argNames##MemberFunctionTablePtr_) \
|
||||
{ \
|
||||
delete baseType::memberFunction##argNames##MemberFunctionTablePtr_;\
|
||||
baseType::memberFunction##argNames##MemberFunctionTablePtr_ = NULL;\
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
// internal use:
|
||||
// create pointer to hash-table of functions
|
||||
#define defineMemberFunctionSelectionTablePtr\
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
/* Define the memberFunction table */ \
|
||||
baseType::memberFunction##argNames##MemberFunctionTable* \
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
/* Define the memberFunction table */ \
|
||||
baseType::memberFunction##argNames##MemberFunctionTable* \
|
||||
baseType::memberFunction##argNames##MemberFunctionTablePtr_ = NULL
|
||||
|
||||
|
||||
// not much in use:
|
||||
#define defineTemplateMemberFunctionSelectionTablePtr\
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
/* Define the memberFunction table */ \
|
||||
typename baseType::memberFunction##argNames##MemberFunctionTable* \
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
/* Define the memberFunction table */ \
|
||||
typename baseType::memberFunction##argNames##MemberFunctionTable* \
|
||||
baseType::memberFunction##argNames##MemberFunctionTablePtr_ = NULL
|
||||
|
||||
|
||||
@ -148,13 +148,13 @@ Description
|
||||
// ~~~~~~~~~~~~~
|
||||
// define run-time selection table
|
||||
#define defineMemberFunctionSelectionTable\
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
defineMemberFunctionSelectionTablePtr \
|
||||
(baseType,memberFunction,argNames); \
|
||||
defineMemberFunctionSelectionTableMemberFunction \
|
||||
(baseType,memberFunction,argNames) \
|
||||
defineMemberFunctionSelectionTableDestructor \
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
defineMemberFunctionSelectionTablePtr \
|
||||
(baseType,memberFunction,argNames); \
|
||||
defineMemberFunctionSelectionTableMemberFunction \
|
||||
(baseType,memberFunction,argNames) \
|
||||
defineMemberFunctionSelectionTableDestructor \
|
||||
(baseType,memberFunction,argNames)
|
||||
|
||||
|
||||
@ -163,16 +163,16 @@ Description
|
||||
// define run-time selection table for template classes
|
||||
// use when baseType doesn't need a template argument (eg, is a typedef)
|
||||
#define defineTemplateMemberFunctionSelectionTable\
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
template<> \
|
||||
defineMemberFunctionSelectionTablePtr \
|
||||
(baseType,memberFunction,argNames); \
|
||||
template<> \
|
||||
defineMemberFunctionSelectionTableMemberFunction \
|
||||
(baseType,memberFunction,argNames) \
|
||||
template<> \
|
||||
defineMemberFunctionSelectionTableDestructor \
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
template<> \
|
||||
defineMemberFunctionSelectionTablePtr \
|
||||
(baseType,memberFunction,argNames); \
|
||||
template<> \
|
||||
defineMemberFunctionSelectionTableMemberFunction \
|
||||
(baseType,memberFunction,argNames) \
|
||||
template<> \
|
||||
defineMemberFunctionSelectionTableDestructor \
|
||||
(baseType,memberFunction,argNames)
|
||||
|
||||
|
||||
@ -182,20 +182,20 @@ Description
|
||||
// constructor aid
|
||||
// use when baseType requires the Targ template argument
|
||||
#define defineTemplatedMemberFunctionSelectionTableMemberFunction\
|
||||
(baseType,memberFunction,argNames,Targ) \
|
||||
\
|
||||
/* Table memberFunction called from the table add function */ \
|
||||
void baseType<Targ>::construct##memberFunction##argNames## \
|
||||
MemberFunctionTables() \
|
||||
{ \
|
||||
static bool constructed = false; \
|
||||
if (!constructed) \
|
||||
{ \
|
||||
constructed = true; \
|
||||
(baseType,memberFunction,argNames,Targ) \
|
||||
\
|
||||
/* Table memberFunction called from the table add function */ \
|
||||
void baseType<Targ>::construct##memberFunction##argNames## \
|
||||
MemberFunctionTables() \
|
||||
{ \
|
||||
static bool constructed = false; \
|
||||
if (!constructed) \
|
||||
{ \
|
||||
constructed = true; \
|
||||
baseType<Targ>::memberFunction##argNames##MemberFunctionTablePtr_ \
|
||||
= new baseType<Targ>::memberFunction##argNames## \
|
||||
MemberFunctionTable; \
|
||||
} \
|
||||
= new baseType<Targ>::memberFunction##argNames## \
|
||||
MemberFunctionTable; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
@ -203,22 +203,22 @@ Description
|
||||
// destructor aid
|
||||
// use when baseType requires the Targ template argument
|
||||
#define defineTemplatedMemberFunctionSelectionTableDestructor\
|
||||
(baseType,memberFunction,argNames,Targ) \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void baseType<Targ>::destroy##memberFunction##argNames## \
|
||||
MemberFunctionTables() \
|
||||
{ \
|
||||
if \
|
||||
( \
|
||||
(baseType,memberFunction,argNames,Targ) \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void baseType<Targ>::destroy##memberFunction##argNames## \
|
||||
MemberFunctionTables() \
|
||||
{ \
|
||||
if \
|
||||
( \
|
||||
baseType<Targ>::memberFunction##argNames##MemberFunctionTablePtr_ \
|
||||
) \
|
||||
{ \
|
||||
delete baseType<Targ>::memberFunction##argNames## \
|
||||
MemberFunctionTablePtr_; \
|
||||
baseType<Targ>::memberFunction##argNames## \
|
||||
MemberFunctionTablePtr_ = NULL; \
|
||||
} \
|
||||
) \
|
||||
{ \
|
||||
delete baseType<Targ>::memberFunction##argNames## \
|
||||
MemberFunctionTablePtr_; \
|
||||
baseType<Targ>::memberFunction##argNames## \
|
||||
MemberFunctionTablePtr_ = NULL; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
@ -226,10 +226,10 @@ Description
|
||||
// create pointer to hash-table of functions
|
||||
// use when baseType requires the Targ template argument
|
||||
#define defineTemplatedMemberFunctionSelectionTablePtr\
|
||||
(baseType,memberFunction,argNames,Targ) \
|
||||
\
|
||||
/* Define the memberFunction table */ \
|
||||
baseType<Targ>::memberFunction##argNames##MemberFunctionTable* \
|
||||
(baseType,memberFunction,argNames,Targ) \
|
||||
\
|
||||
/* Define the memberFunction table */ \
|
||||
baseType<Targ>::memberFunction##argNames##MemberFunctionTable* \
|
||||
baseType<Targ>::memberFunction##argNames##MemberFunctionTablePtr_ = NULL
|
||||
|
||||
|
||||
@ -238,16 +238,16 @@ Description
|
||||
// define run-time selection table for template classes
|
||||
// use when baseType requires the Targ template argument
|
||||
#define defineTemplatedMemberFunctionSelectionTable\
|
||||
(baseType,memberFunction,argNames,Targ) \
|
||||
\
|
||||
template<> \
|
||||
defineTemplatedMemberFunctionSelectionTablePtr \
|
||||
(baseType,memberFunction,argNames,Targ); \
|
||||
template<> \
|
||||
defineTemplatedMemberFunctionSelectionTableMemberFunction \
|
||||
(baseType,memberFunction,argNames,Targ) \
|
||||
template<> \
|
||||
defineTemplatedMemberFunctionSelectionTableDestructor \
|
||||
(baseType,memberFunction,argNames,Targ) \
|
||||
\
|
||||
template<> \
|
||||
defineTemplatedMemberFunctionSelectionTablePtr \
|
||||
(baseType,memberFunction,argNames,Targ); \
|
||||
template<> \
|
||||
defineTemplatedMemberFunctionSelectionTableMemberFunction \
|
||||
(baseType,memberFunction,argNames,Targ) \
|
||||
template<> \
|
||||
defineTemplatedMemberFunctionSelectionTableDestructor \
|
||||
(baseType,memberFunction,argNames,Targ)
|
||||
|
||||
|
||||
|
||||
@ -37,12 +37,12 @@ Description
|
||||
|
||||
// add to hash-table of functions with 'lookup' as the key
|
||||
#define addNamedToStaticMemberFunctionSelectionTable\
|
||||
(baseType,thisType,memberFunction,argNames,lookup,functionPtr) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table, find by lookup name */ \
|
||||
baseType::add##memberFunction##argNames## \
|
||||
StaticMemberFunctionToTable<thisType> \
|
||||
add_##lookup##_##thisType##memberFunction##argNames## \
|
||||
(baseType,thisType,memberFunction,argNames,lookup,functionPtr) \
|
||||
\
|
||||
/* Add the thisType memberFunction to the table, find by lookup name */ \
|
||||
baseType::add##memberFunction##argNames## \
|
||||
StaticMemberFunctionToTable<thisType> \
|
||||
add_##lookup##_##thisType##memberFunction##argNames## \
|
||||
StaticMemberFunctionTo##baseType##Table_(#lookup, functionPtr)
|
||||
|
||||
|
||||
|
||||
@ -40,88 +40,88 @@ Description
|
||||
// ~~~~~~~~~~~~~
|
||||
// declare a run-time selection:
|
||||
#define declareStaticMemberFunctionSelectionTable\
|
||||
(returnType,baseType,memberFunction,argNames,argList,parList) \
|
||||
\
|
||||
/* Construct from argList function pointer type */ \
|
||||
(returnType,baseType,memberFunction,argNames,argList,parList) \
|
||||
\
|
||||
/* Construct from argList function pointer type */ \
|
||||
typedef returnType (*memberFunction##argNames##MemberFunctionPtr)argList; \
|
||||
\
|
||||
/* Construct from argList function table type */ \
|
||||
typedef HashTable \
|
||||
<memberFunction##argNames##MemberFunctionPtr, word, string::hash> \
|
||||
memberFunction##argNames##MemberFunctionTable; \
|
||||
\
|
||||
/* Construct from argList function pointer table pointer */ \
|
||||
static memberFunction##argNames##MemberFunctionTable* \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_; \
|
||||
\
|
||||
/* Table memberFunction called from the table add function */ \
|
||||
static void construct##memberFunction##argNames##MemberFunctionTables(); \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
static void destroy##memberFunction##argNames##MemberFunctionTables(); \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
template<class baseType##Type> \
|
||||
class add##memberFunction##argNames##StaticMemberFunctionToTable \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
add##memberFunction##argNames##StaticMemberFunctionToTable \
|
||||
( \
|
||||
const word& lookup, \
|
||||
memberFunction##argNames##MemberFunctionPtr function \
|
||||
) \
|
||||
{ \
|
||||
construct##memberFunction##argNames##MemberFunctionTables(); \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_->insert \
|
||||
( \
|
||||
lookup, \
|
||||
function \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
~add##memberFunction##argNames##StaticMemberFunctionToTable() \
|
||||
{ \
|
||||
destroy##memberFunction##argNames##MemberFunctionTables(); \
|
||||
} \
|
||||
\
|
||||
/* Construct from argList function table type */ \
|
||||
typedef HashTable \
|
||||
<memberFunction##argNames##MemberFunctionPtr, word, string::hash> \
|
||||
memberFunction##argNames##MemberFunctionTable; \
|
||||
\
|
||||
/* Construct from argList function pointer table pointer */ \
|
||||
static memberFunction##argNames##MemberFunctionTable* \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_; \
|
||||
\
|
||||
/* Table memberFunction called from the table add function */ \
|
||||
static void construct##memberFunction##argNames##MemberFunctionTables(); \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
static void destroy##memberFunction##argNames##MemberFunctionTables(); \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
template<class baseType##Type> \
|
||||
class add##memberFunction##argNames##StaticMemberFunctionToTable \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
add##memberFunction##argNames##StaticMemberFunctionToTable \
|
||||
( \
|
||||
const word& lookup, \
|
||||
memberFunction##argNames##MemberFunctionPtr function \
|
||||
) \
|
||||
{ \
|
||||
construct##memberFunction##argNames##MemberFunctionTables(); \
|
||||
memberFunction##argNames##MemberFunctionTablePtr_->insert \
|
||||
( \
|
||||
lookup, \
|
||||
function \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
~add##memberFunction##argNames##StaticMemberFunctionToTable() \
|
||||
{ \
|
||||
destroy##memberFunction##argNames##MemberFunctionTables(); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
// internal use:
|
||||
// constructor/destructor aid
|
||||
#define defineStaticMemberFunctionSelectionTableConstructDestruct\
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
/* Table constructor called from the table add function constructor */ \
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
/* Table constructor called from the table add function constructor */ \
|
||||
void baseType::construct##memberFunction##argNames##MemberFunctionTables()\
|
||||
{ \
|
||||
static bool constructed = false; \
|
||||
if (!constructed) \
|
||||
{ \
|
||||
constructed = true; \
|
||||
baseType::memberFunction##argNames##MemberFunctionTablePtr_ \
|
||||
{ \
|
||||
static bool constructed = false; \
|
||||
if (!constructed) \
|
||||
{ \
|
||||
constructed = true; \
|
||||
baseType::memberFunction##argNames##MemberFunctionTablePtr_ \
|
||||
= new baseType::memberFunction##argNames##MemberFunctionTable;\
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void baseType::destroy##memberFunction##argNames##MemberFunctionTables() \
|
||||
{ \
|
||||
if (baseType::memberFunction##argNames##MemberFunctionTablePtr_) \
|
||||
{ \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void baseType::destroy##memberFunction##argNames##MemberFunctionTables() \
|
||||
{ \
|
||||
if (baseType::memberFunction##argNames##MemberFunctionTablePtr_) \
|
||||
{ \
|
||||
delete baseType::memberFunction##argNames##MemberFunctionTablePtr_;\
|
||||
baseType::memberFunction##argNames##MemberFunctionTablePtr_ = NULL;\
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
// internal use:
|
||||
// create pointer to hash-table of functions
|
||||
#define defineStaticMemberFunctionSelectionTablePtr\
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
/* Define the memberFunction table */ \
|
||||
baseType::memberFunction##argNames##MemberFunctionTable* \
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
/* Define the memberFunction table */ \
|
||||
baseType::memberFunction##argNames##MemberFunctionTable* \
|
||||
baseType::memberFunction##argNames##MemberFunctionTablePtr_ = NULL
|
||||
|
||||
|
||||
@ -131,12 +131,12 @@ Description
|
||||
// ~~~~~~~~~~~~~
|
||||
// define run-time selection table
|
||||
#define defineStaticMemberFunctionSelectionTable\
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
defineStaticMemberFunctionSelectionTablePtr \
|
||||
(baseType,memberFunction,argNames); \
|
||||
defineStaticMemberFunctionSelectionTableConstructDestruct \
|
||||
(baseType,memberFunction,argNames) \
|
||||
(baseType,memberFunction,argNames) \
|
||||
\
|
||||
defineStaticMemberFunctionSelectionTablePtr \
|
||||
(baseType,memberFunction,argNames); \
|
||||
defineStaticMemberFunctionSelectionTableConstructDestruct \
|
||||
(baseType,memberFunction,argNames) \
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -39,24 +39,24 @@ Description
|
||||
|
||||
//- Add typeName information from argument \a TypeNameString to a class.
|
||||
// Without debug information
|
||||
#define ClassNameNoDebug(TypeNameString) \
|
||||
static const char* typeName_() { return TypeNameString; } \
|
||||
#define ClassNameNoDebug(TypeNameString) \
|
||||
static const char* typeName_() { return TypeNameString; } \
|
||||
static const ::Foam::word typeName
|
||||
|
||||
//- Add typeName information from argument \a TypeNameString to a namespace.
|
||||
// Without debug information.
|
||||
#define NamespaceNameNoDebug(TypeNameString) \
|
||||
inline const char* typeName_() { return TypeNameString; } \
|
||||
#define NamespaceNameNoDebug(TypeNameString) \
|
||||
inline const char* typeName_() { return TypeNameString; } \
|
||||
extern const ::Foam::word typeName
|
||||
|
||||
//- Add typeName information from argument \a TemplateNameString to a
|
||||
// template class. Without debug information.
|
||||
#define TemplateNameNoDebug(TemplateNameString) \
|
||||
class TemplateNameString##Name \
|
||||
{ \
|
||||
public: \
|
||||
TemplateNameString##Name() {} \
|
||||
ClassNameNoDebug(#TemplateNameString); \
|
||||
#define TemplateNameNoDebug(TemplateNameString) \
|
||||
class TemplateNameString##Name \
|
||||
{ \
|
||||
public: \
|
||||
TemplateNameString##Name() {} \
|
||||
ClassNameNoDebug(#TemplateNameString); \
|
||||
}
|
||||
|
||||
|
||||
@ -66,24 +66,24 @@ public: \
|
||||
|
||||
//- Add typeName information from argument \a TypeNameString to a class.
|
||||
// Also declares debug information.
|
||||
#define ClassName(TypeNameString) \
|
||||
ClassNameNoDebug(TypeNameString); \
|
||||
#define ClassName(TypeNameString) \
|
||||
ClassNameNoDebug(TypeNameString); \
|
||||
static int debug
|
||||
|
||||
//- Add typeName information from argument \a TypeNameString to a namespace.
|
||||
// Also declares debug information.
|
||||
#define NamespaceName(TypeNameString) \
|
||||
NamespaceNameNoDebug(TypeNameString); \
|
||||
#define NamespaceName(TypeNameString) \
|
||||
NamespaceNameNoDebug(TypeNameString); \
|
||||
extern int debug
|
||||
|
||||
//- Add typeName information from argument \a TypeNameString to a
|
||||
// template class. Also declares debug information.
|
||||
#define TemplateName(TemplateNameString) \
|
||||
class TemplateNameString##Name \
|
||||
{ \
|
||||
public: \
|
||||
TemplateNameString##Name() {} \
|
||||
ClassName(#TemplateNameString); \
|
||||
#define TemplateName(TemplateNameString) \
|
||||
class TemplateNameString##Name \
|
||||
{ \
|
||||
public: \
|
||||
TemplateNameString##Name() {} \
|
||||
ClassName(#TemplateNameString); \
|
||||
}
|
||||
|
||||
|
||||
@ -92,28 +92,28 @@ public: \
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
//- Define the typeName, with alternative lookup as \a Name
|
||||
#define defineTypeNameWithName(Type, Name) \
|
||||
#define defineTypeNameWithName(Type, Name) \
|
||||
const ::Foam::word Type::typeName(Name)
|
||||
|
||||
//- Define the typeName
|
||||
#define defineTypeName(Type) \
|
||||
#define defineTypeName(Type) \
|
||||
defineTypeNameWithName(Type, Type::typeName_())
|
||||
|
||||
//- Define the typeName as \a Name for template classes
|
||||
# define defineTemplateTypeNameWithName(Type, Name) \
|
||||
template<> \
|
||||
# define defineTemplateTypeNameWithName(Type, Name) \
|
||||
template<> \
|
||||
defineTypeNameWithName(Type, Name)
|
||||
//- Define the typeName as \a Name for template sub-classes
|
||||
# define defineTemplate2TypeNameWithName(Type, Name) \
|
||||
template<> \
|
||||
# define defineTemplate2TypeNameWithName(Type, Name) \
|
||||
template<> \
|
||||
defineTypeNameWithName(Type, Name)
|
||||
|
||||
//- Define the typeName for template classes, useful with typedefs
|
||||
#define defineTemplateTypeName(Type) \
|
||||
#define defineTemplateTypeName(Type) \
|
||||
defineTemplateTypeNameWithName(Type, #Type)
|
||||
|
||||
//- Define the typeName directly for template classes
|
||||
#define defineNamedTemplateTypeName(Type) \
|
||||
#define defineNamedTemplateTypeName(Type) \
|
||||
defineTemplateTypeNameWithName(Type, Type::typeName_())
|
||||
|
||||
|
||||
@ -122,35 +122,35 @@ public: \
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
//- Define the typeName and debug information
|
||||
#define defineTypeNameAndDebug(Type, DebugSwitch) \
|
||||
defineTypeName(Type); \
|
||||
#define defineTypeNameAndDebug(Type, DebugSwitch) \
|
||||
defineTypeName(Type); \
|
||||
defineDebugSwitch(Type, DebugSwitch)
|
||||
|
||||
//- Define the typeName and debug information, lookup as \a Name
|
||||
#define defineTemplateTypeNameAndDebugWithName(Type, Name, DebugSwitch) \
|
||||
defineTemplateTypeNameWithName(Type, Name); \
|
||||
#define defineTemplateTypeNameAndDebugWithName(Type, Name, DebugSwitch) \
|
||||
defineTemplateTypeNameWithName(Type, Name); \
|
||||
defineTemplateDebugSwitchWithName(Type, Name, DebugSwitch)
|
||||
|
||||
//- Define the typeName and debug information for templates, useful
|
||||
// with typedefs
|
||||
#define defineTemplateTypeNameAndDebug(Type, DebugSwitch) \
|
||||
#define defineTemplateTypeNameAndDebug(Type, DebugSwitch) \
|
||||
defineTemplateTypeNameAndDebugWithName(Type, #Type, DebugSwitch)
|
||||
|
||||
//- Define the typeName and debug information for templates
|
||||
#define defineNamedTemplateTypeNameAndDebug(Type, DebugSwitch) \
|
||||
defineNamedTemplateTypeName(Type); \
|
||||
#define defineNamedTemplateTypeNameAndDebug(Type, DebugSwitch) \
|
||||
defineNamedTemplateTypeName(Type); \
|
||||
defineNamedTemplateDebugSwitch(Type, DebugSwitch)
|
||||
|
||||
// for templated sub-classes
|
||||
|
||||
//- Define the typeName and debug information, lookup as \a Name
|
||||
#define defineTemplate2TypeNameAndDebugWithName(Type, Name, DebugSwitch) \
|
||||
defineTemplate2TypeNameWithName(Type, Name); \
|
||||
#define defineTemplate2TypeNameAndDebugWithName(Type, Name, DebugSwitch) \
|
||||
defineTemplate2TypeNameWithName(Type, Name); \
|
||||
defineTemplate2DebugSwitchWithName(Type, Name, DebugSwitch)
|
||||
|
||||
//- Define the typeName and debug information for templates, useful
|
||||
// with typedefs
|
||||
#define defineTemplate2TypeNameAndDebug(Type, DebugSwitch) \
|
||||
#define defineTemplate2TypeNameAndDebug(Type, DebugSwitch) \
|
||||
defineTemplate2TypeNameAndDebugWithName(Type, #Type, DebugSwitch)
|
||||
|
||||
|
||||
|
||||
@ -62,13 +62,13 @@ Description
|
||||
// declarations (for use in header files)
|
||||
|
||||
//- Declare a ClassNameNoDebug() with extra virtual type info
|
||||
#define TypeNameNoDebug(TypeNameString) \
|
||||
ClassNameNoDebug(TypeNameString); \
|
||||
#define TypeNameNoDebug(TypeNameString) \
|
||||
ClassNameNoDebug(TypeNameString); \
|
||||
virtual const word& type() const { return typeName; }
|
||||
|
||||
//- Declare a ClassName() with extra virtual type info
|
||||
#define TypeName(TypeNameString) \
|
||||
ClassName(TypeNameString); \
|
||||
#define TypeName(TypeNameString) \
|
||||
ClassName(TypeNameString); \
|
||||
virtual const word& type() const { return typeName; }
|
||||
|
||||
|
||||
|
||||
@ -231,22 +231,22 @@ dimensionedScalar negPart(const dimensionedScalar& ds)
|
||||
}
|
||||
|
||||
|
||||
#define transFunc(func) \
|
||||
dimensionedScalar func(const dimensionedScalar& ds) \
|
||||
{ \
|
||||
if (!ds.dimensions().dimensionless()) \
|
||||
{ \
|
||||
FatalErrorInFunction \
|
||||
<< "ds not dimensionless" \
|
||||
<< abort(FatalError); \
|
||||
} \
|
||||
\
|
||||
return dimensionedScalar \
|
||||
( \
|
||||
#func "(" + ds.name() + ')', \
|
||||
dimless, \
|
||||
::func(ds.value()) \
|
||||
); \
|
||||
#define transFunc(func) \
|
||||
dimensionedScalar func(const dimensionedScalar& ds) \
|
||||
{ \
|
||||
if (!ds.dimensions().dimensionless()) \
|
||||
{ \
|
||||
FatalErrorInFunction \
|
||||
<< "ds not dimensionless" \
|
||||
<< abort(FatalError); \
|
||||
} \
|
||||
\
|
||||
return dimensionedScalar \
|
||||
( \
|
||||
#func "(" + ds.name() + ')', \
|
||||
dimless, \
|
||||
::func(ds.value()) \
|
||||
); \
|
||||
}
|
||||
|
||||
transFunc(exp)
|
||||
@ -275,22 +275,22 @@ transFunc(y1)
|
||||
#undef transFunc
|
||||
|
||||
|
||||
#define transFunc(func) \
|
||||
dimensionedScalar func(const int n, const dimensionedScalar& ds) \
|
||||
{ \
|
||||
if (!ds.dimensions().dimensionless()) \
|
||||
{ \
|
||||
FatalErrorInFunction \
|
||||
<< "ds not dimensionless" \
|
||||
<< abort(FatalError); \
|
||||
} \
|
||||
\
|
||||
return dimensionedScalar \
|
||||
( \
|
||||
#func "(" + name(n) + ',' + ds.name() + ')', \
|
||||
dimless, \
|
||||
::func(n, ds.value()) \
|
||||
); \
|
||||
#define transFunc(func) \
|
||||
dimensionedScalar func(const int n, const dimensionedScalar& ds) \
|
||||
{ \
|
||||
if (!ds.dimensions().dimensionless()) \
|
||||
{ \
|
||||
FatalErrorInFunction \
|
||||
<< "ds not dimensionless" \
|
||||
<< abort(FatalError); \
|
||||
} \
|
||||
\
|
||||
return dimensionedScalar \
|
||||
( \
|
||||
#func "(" + name(n) + ',' + ds.name() + ')', \
|
||||
dimless, \
|
||||
::func(n, ds.value()) \
|
||||
); \
|
||||
}
|
||||
|
||||
transFunc(jn)
|
||||
|
||||
@ -732,54 +732,54 @@ Foam::dimensioned<Type> Foam::operator/
|
||||
// Products
|
||||
// ~~~~~~~~
|
||||
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
Foam::dimensioned<typename Foam::product<Type1, Type2>::type> \
|
||||
Foam::operator op \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<typename product<Type1, Type2>::type> \
|
||||
( \
|
||||
'(' + dt1.name() + #op + dt2.name() + ')', \
|
||||
dt1.dimensions() op dt2.dimensions(), \
|
||||
dt1.value() op dt2.value() \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
Foam::dimensioned<typename Foam::product<Type, Form>::type> \
|
||||
Foam::operator op \
|
||||
( \
|
||||
const dimensioned<Type>& dt1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& t2 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<typename product<Type, Form>::type> \
|
||||
( \
|
||||
'(' + dt1.name() + #op + name(t2) + ')', \
|
||||
dt1.dimensions(), \
|
||||
dt1.value() op static_cast<const Form&>(t2) \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
Foam::dimensioned<typename Foam::product<Form, Type>::type> \
|
||||
Foam::operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& t1, \
|
||||
const dimensioned<Type>& dt2 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<typename product<Form, Type>::type> \
|
||||
( \
|
||||
'(' + name(t1) + #op + dt2.name() + ')', \
|
||||
dt2.dimensions(), \
|
||||
static_cast<const Form&>(t1) op dt2.value() \
|
||||
); \
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
Foam::dimensioned<typename Foam::product<Type1, Type2>::type> \
|
||||
Foam::operator op \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<typename product<Type1, Type2>::type> \
|
||||
( \
|
||||
'(' + dt1.name() + #op + dt2.name() + ')', \
|
||||
dt1.dimensions() op dt2.dimensions(), \
|
||||
dt1.value() op dt2.value() \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
Foam::dimensioned<typename Foam::product<Type, Form>::type> \
|
||||
Foam::operator op \
|
||||
( \
|
||||
const dimensioned<Type>& dt1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& t2 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<typename product<Type, Form>::type> \
|
||||
( \
|
||||
'(' + dt1.name() + #op + name(t2) + ')', \
|
||||
dt1.dimensions(), \
|
||||
dt1.value() op static_cast<const Form&>(t2) \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
Foam::dimensioned<typename Foam::product<Form, Type>::type> \
|
||||
Foam::operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& t1, \
|
||||
const dimensioned<Type>& dt2 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<typename product<Form, Type>::type> \
|
||||
( \
|
||||
'(' + name(t1) + #op + dt2.name() + ')', \
|
||||
dt2.dimensions(), \
|
||||
static_cast<const Form&>(t1) op dt2.value() \
|
||||
); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -303,26 +303,26 @@ dimensioned<Type> operator/
|
||||
// Products
|
||||
// ~~~~~~~~
|
||||
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
dimensioned<typename product<Type1, Type2>::type> \
|
||||
operator op(const dimensioned<Type1>&, const dimensioned<Type2>&); \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
dimensioned<typename product<Type, Form>::type> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Type>&, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& \
|
||||
); \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
dimensioned<typename product<Form, Type>::type> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>&, \
|
||||
const dimensioned<Type>& \
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
dimensioned<typename product<Type1, Type2>::type> \
|
||||
operator op(const dimensioned<Type1>&, const dimensioned<Type2>&); \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
dimensioned<typename product<Type, Form>::type> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Type>&, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& \
|
||||
); \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
dimensioned<typename product<Form, Type>::type> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>&, \
|
||||
const dimensioned<Type>& \
|
||||
);
|
||||
|
||||
PRODUCT_OPERATOR(outerProduct, *, outer)
|
||||
|
||||
@ -476,38 +476,38 @@ void DimensionedField<Type, GeoMesh>::operator=
|
||||
}
|
||||
|
||||
|
||||
#define COMPUTED_ASSIGNMENT(TYPE, op) \
|
||||
\
|
||||
template<class Type, class GeoMesh> \
|
||||
void DimensionedField<Type, GeoMesh>::operator op \
|
||||
( \
|
||||
const DimensionedField<TYPE, GeoMesh>& df \
|
||||
) \
|
||||
{ \
|
||||
checkField(*this, df, #op); \
|
||||
\
|
||||
dimensions_ op df.dimensions(); \
|
||||
Field<Type>::operator op(df); \
|
||||
} \
|
||||
\
|
||||
template<class Type, class GeoMesh> \
|
||||
void DimensionedField<Type, GeoMesh>::operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<TYPE, GeoMesh>>& tdf \
|
||||
) \
|
||||
{ \
|
||||
operator op(tdf()); \
|
||||
tdf.clear(); \
|
||||
} \
|
||||
\
|
||||
template<class Type, class GeoMesh> \
|
||||
void DimensionedField<Type, GeoMesh>::operator op \
|
||||
( \
|
||||
const dimensioned<TYPE>& dt \
|
||||
) \
|
||||
{ \
|
||||
dimensions_ op dt.dimensions(); \
|
||||
Field<Type>::operator op(dt.value()); \
|
||||
#define COMPUTED_ASSIGNMENT(TYPE, op) \
|
||||
\
|
||||
template<class Type, class GeoMesh> \
|
||||
void DimensionedField<Type, GeoMesh>::operator op \
|
||||
( \
|
||||
const DimensionedField<TYPE, GeoMesh>& df \
|
||||
) \
|
||||
{ \
|
||||
checkField(*this, df, #op); \
|
||||
\
|
||||
dimensions_ op df.dimensions(); \
|
||||
Field<Type>::operator op(df); \
|
||||
} \
|
||||
\
|
||||
template<class Type, class GeoMesh> \
|
||||
void DimensionedField<Type, GeoMesh>::operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<TYPE, GeoMesh>>& tdf \
|
||||
) \
|
||||
{ \
|
||||
operator op(tdf()); \
|
||||
tdf.clear(); \
|
||||
} \
|
||||
\
|
||||
template<class Type, class GeoMesh> \
|
||||
void DimensionedField<Type, GeoMesh>::operator op \
|
||||
( \
|
||||
const dimensioned<TYPE>& dt \
|
||||
) \
|
||||
{ \
|
||||
dimensions_ op dt.dimensions(); \
|
||||
Field<Type>::operator op(dt.value()); \
|
||||
}
|
||||
|
||||
COMPUTED_ASSIGNMENT(Type, +=)
|
||||
|
||||
@ -301,31 +301,31 @@ cmptAv(const tmp<DimensionedField<Type, GeoMesh>>& tdf)
|
||||
return CmptAv;
|
||||
}
|
||||
|
||||
#define UNARY_REDUCTION_FUNCTION(returnType, func, dfunc) \
|
||||
\
|
||||
template<class Type, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const DimensionedField<Type, GeoMesh>& df \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<Type> \
|
||||
( \
|
||||
#func "(" + df.name() + ')', \
|
||||
df.dimensions(), \
|
||||
dfunc(df.field()) \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
template<class Type, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
|
||||
) \
|
||||
{ \
|
||||
dimensioned<returnType> res = func(tdf1()); \
|
||||
tdf1.clear(); \
|
||||
return res; \
|
||||
#define UNARY_REDUCTION_FUNCTION(returnType, func, dfunc) \
|
||||
\
|
||||
template<class Type, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const DimensionedField<Type, GeoMesh>& df \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<Type> \
|
||||
( \
|
||||
#func "(" + df.name() + ')', \
|
||||
df.dimensions(), \
|
||||
dfunc(df.field()) \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
template<class Type, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
|
||||
) \
|
||||
{ \
|
||||
dimensioned<returnType> res = func(tdf1()); \
|
||||
tdf1.clear(); \
|
||||
return res; \
|
||||
}
|
||||
|
||||
UNARY_REDUCTION_FUNCTION(Type, max, gMax)
|
||||
@ -364,279 +364,279 @@ BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, /, '|', divide)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes \
|
||||
( \
|
||||
new DimensionedField<productType, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
'(' + df1.name() + #op + df2.name() + ')', \
|
||||
df1.instance(), \
|
||||
df1.db() \
|
||||
), \
|
||||
df1.mesh(), \
|
||||
df1.dimensions() op df2.dimensions() \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), df1.field(), df2.field()); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
\
|
||||
const DimensionedField<Type2, GeoMesh>& df2 = tdf2(); \
|
||||
\
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes = \
|
||||
reuseTmpDimensionedField<productType, Type2, GeoMesh>::New \
|
||||
( \
|
||||
tdf2, \
|
||||
'(' + df1.name() + #op + df2.name() + ')', \
|
||||
df1.dimensions() op df2.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), df1.field(), df2.field()); \
|
||||
\
|
||||
reuseTmpDimensionedField<productType, Type2, GeoMesh>::clear(tdf2); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
\
|
||||
const DimensionedField<Type1, GeoMesh>& df1 = tdf1(); \
|
||||
\
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes = \
|
||||
reuseTmpDimensionedField<productType, Type1, GeoMesh>::New \
|
||||
( \
|
||||
tdf1, \
|
||||
'(' + df1.name() + #op + df2.name() + ')', \
|
||||
df1.dimensions() op df2.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), df1.field(), df2.field()); \
|
||||
\
|
||||
reuseTmpDimensionedField<productType, Type1, GeoMesh>::clear(tdf1); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
\
|
||||
const DimensionedField<Type1, GeoMesh>& df1 = tdf1(); \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 = tdf2(); \
|
||||
\
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes = \
|
||||
reuseTmpTmpDimensionedField \
|
||||
<productType, Type1, Type1, Type2, GeoMesh>::New \
|
||||
( \
|
||||
tdf1, \
|
||||
tdf2, \
|
||||
'(' + df1.name() + #op + df2.name() + ')', \
|
||||
df1.dimensions() op df2.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), df1.field(), df2.field()); \
|
||||
\
|
||||
reuseTmpTmpDimensionedField \
|
||||
<productType, Type1, Type1, Type2, GeoMesh>::clear(tdf1, tdf2); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type, GeoMesh>& df1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
\
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes \
|
||||
( \
|
||||
new DimensionedField<productType, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
'(' + df1.name() + #op + dvs.name() + ')', \
|
||||
df1.instance(), \
|
||||
df1.db() \
|
||||
), \
|
||||
df1.mesh(), \
|
||||
df1.dimensions() op dvs.dimensions() \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), df1.field(), dvs.value()); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type, GeoMesh>& df1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{ \
|
||||
return df1 op dimensioned<Form>(static_cast<const Form&>(vs)); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
\
|
||||
const DimensionedField<Type, GeoMesh>& df1 = tdf1(); \
|
||||
\
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes = \
|
||||
reuseTmpDimensionedField<productType, Type, GeoMesh>::New \
|
||||
( \
|
||||
tdf1, \
|
||||
'(' + df1.name() + #op + dvs.name() + ')', \
|
||||
df1.dimensions() op dvs.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), df1.field(), dvs.value()); \
|
||||
\
|
||||
reuseTmpDimensionedField<productType, Type, GeoMesh>::clear(tdf1); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{ \
|
||||
return tdf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const DimensionedField<Type, GeoMesh>& df1 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes \
|
||||
( \
|
||||
new DimensionedField<productType, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
'(' + dvs.name() + #op + df1.name() + ')', \
|
||||
df1.instance(), \
|
||||
df1.db() \
|
||||
), \
|
||||
df1.mesh(), \
|
||||
dvs.dimensions() op df1.dimensions() \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), dvs.value(), df1.field()); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const DimensionedField<Type, GeoMesh>& df1 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<Form>(static_cast<const Form&>(vs)) op df1; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
\
|
||||
const DimensionedField<Type, GeoMesh>& df1 = tdf1(); \
|
||||
\
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes = \
|
||||
reuseTmpDimensionedField<productType, Type, GeoMesh>::New \
|
||||
( \
|
||||
tdf1, \
|
||||
'(' + dvs.name() + #op + df1.name() + ')', \
|
||||
dvs.dimensions() op df1.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), dvs.value(), df1.field()); \
|
||||
\
|
||||
reuseTmpDimensionedField<productType, Type, GeoMesh>::clear(tdf1); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<Form>(static_cast<const Form&>(vs)) op tdf1; \
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes \
|
||||
( \
|
||||
new DimensionedField<productType, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
'(' + df1.name() + #op + df2.name() + ')', \
|
||||
df1.instance(), \
|
||||
df1.db() \
|
||||
), \
|
||||
df1.mesh(), \
|
||||
df1.dimensions() op df2.dimensions() \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), df1.field(), df2.field()); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
\
|
||||
const DimensionedField<Type2, GeoMesh>& df2 = tdf2(); \
|
||||
\
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes = \
|
||||
reuseTmpDimensionedField<productType, Type2, GeoMesh>::New \
|
||||
( \
|
||||
tdf2, \
|
||||
'(' + df1.name() + #op + df2.name() + ')', \
|
||||
df1.dimensions() op df2.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), df1.field(), df2.field()); \
|
||||
\
|
||||
reuseTmpDimensionedField<productType, Type2, GeoMesh>::clear(tdf2); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
\
|
||||
const DimensionedField<Type1, GeoMesh>& df1 = tdf1(); \
|
||||
\
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes = \
|
||||
reuseTmpDimensionedField<productType, Type1, GeoMesh>::New \
|
||||
( \
|
||||
tdf1, \
|
||||
'(' + df1.name() + #op + df2.name() + ')', \
|
||||
df1.dimensions() op df2.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), df1.field(), df2.field()); \
|
||||
\
|
||||
reuseTmpDimensionedField<productType, Type1, GeoMesh>::clear(tdf1); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
\
|
||||
const DimensionedField<Type1, GeoMesh>& df1 = tdf1(); \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 = tdf2(); \
|
||||
\
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes = \
|
||||
reuseTmpTmpDimensionedField \
|
||||
<productType, Type1, Type1, Type2, GeoMesh>::New \
|
||||
( \
|
||||
tdf1, \
|
||||
tdf2, \
|
||||
'(' + df1.name() + #op + df2.name() + ')', \
|
||||
df1.dimensions() op df2.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), df1.field(), df2.field()); \
|
||||
\
|
||||
reuseTmpTmpDimensionedField \
|
||||
<productType, Type1, Type1, Type2, GeoMesh>::clear(tdf1, tdf2); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type, GeoMesh>& df1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
\
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes \
|
||||
( \
|
||||
new DimensionedField<productType, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
'(' + df1.name() + #op + dvs.name() + ')', \
|
||||
df1.instance(), \
|
||||
df1.db() \
|
||||
), \
|
||||
df1.mesh(), \
|
||||
df1.dimensions() op dvs.dimensions() \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), df1.field(), dvs.value()); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type, GeoMesh>& df1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{ \
|
||||
return df1 op dimensioned<Form>(static_cast<const Form&>(vs)); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
\
|
||||
const DimensionedField<Type, GeoMesh>& df1 = tdf1(); \
|
||||
\
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes = \
|
||||
reuseTmpDimensionedField<productType, Type, GeoMesh>::New \
|
||||
( \
|
||||
tdf1, \
|
||||
'(' + df1.name() + #op + dvs.name() + ')', \
|
||||
df1.dimensions() op dvs.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), df1.field(), dvs.value()); \
|
||||
\
|
||||
reuseTmpDimensionedField<productType, Type, GeoMesh>::clear(tdf1); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{ \
|
||||
return tdf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const DimensionedField<Type, GeoMesh>& df1 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes \
|
||||
( \
|
||||
new DimensionedField<productType, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
'(' + dvs.name() + #op + df1.name() + ')', \
|
||||
df1.instance(), \
|
||||
df1.db() \
|
||||
), \
|
||||
df1.mesh(), \
|
||||
dvs.dimensions() op df1.dimensions() \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), dvs.value(), df1.field()); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const DimensionedField<Type, GeoMesh>& df1 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<Form>(static_cast<const Form&>(vs)) op df1; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
\
|
||||
const DimensionedField<Type, GeoMesh>& df1 = tdf1(); \
|
||||
\
|
||||
tmp<DimensionedField<productType, GeoMesh>> tRes = \
|
||||
reuseTmpDimensionedField<productType, Type, GeoMesh>::New \
|
||||
( \
|
||||
tdf1, \
|
||||
'(' + dvs.name() + #op + df1.name() + ')', \
|
||||
dvs.dimensions() op df1.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes().field(), dvs.value(), df1.field()); \
|
||||
\
|
||||
reuseTmpDimensionedField<productType, Type, GeoMesh>::clear(tdf1); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<Form>(static_cast<const Form&>(vs)) op tdf1; \
|
||||
}
|
||||
|
||||
PRODUCT_OPERATOR(typeOfSum, +, add)
|
||||
|
||||
@ -100,17 +100,17 @@ tmp
|
||||
cmptAv(const tmp<DimensionedField<Type, GeoMesh>>& tdf);
|
||||
|
||||
|
||||
#define UNARY_REDUCTION_FUNCTION(returnType, func, dfunc) \
|
||||
\
|
||||
template<class Type, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const DimensionedField<Type, GeoMesh>& df \
|
||||
); \
|
||||
template<class Type, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
|
||||
#define UNARY_REDUCTION_FUNCTION(returnType, func, dfunc) \
|
||||
\
|
||||
template<class Type, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const DimensionedField<Type, GeoMesh>& df \
|
||||
); \
|
||||
template<class Type, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
|
||||
);
|
||||
|
||||
UNARY_REDUCTION_FUNCTION(Type, max, gMax)
|
||||
@ -149,102 +149,102 @@ BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, /, '|', divide)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type, GeoMesh>& df1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type, GeoMesh>& df1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const DimensionedField<Type, GeoMesh>& df1 \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const DimensionedField<Type, GeoMesh>& df1 \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
template<class Type1, class Type2, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type, GeoMesh>& df1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const DimensionedField<Type, GeoMesh>& df1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const DimensionedField<Type, GeoMesh>& df1 \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const DimensionedField<Type, GeoMesh>& df1 \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type, class GeoMesh> \
|
||||
tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
|
||||
);
|
||||
|
||||
PRODUCT_OPERATOR(typeOfSum, +, add)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -25,239 +25,239 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1 \
|
||||
#define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1 \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define UNARY_OPERATOR(ReturnType, Type1, Op, opFunc, Dfunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1 \
|
||||
#define UNARY_OPERATOR(ReturnType, Type1, Op, opFunc, Dfunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1 \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
#define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const Type2& t2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf2, \
|
||||
const Type2& t2 \
|
||||
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const Type2& t2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf2, \
|
||||
const Type2& t2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const DimensionedField<Type2, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const Type2& t2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const Type2& t2 \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const DimensionedField<Type1, GeoMesh>& df1, \
|
||||
const Type2& t2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
|
||||
const Type2& t2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)
|
||||
|
||||
|
||||
|
||||
@ -667,73 +667,73 @@ UNARY_FUNCTION(scalar, scalar, y1, trans)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BesselFunc(func) \
|
||||
\
|
||||
template<class GeoMesh> \
|
||||
tmp<DimensionedField<scalar, GeoMesh>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const DimensionedField<scalar, GeoMesh>& dsf \
|
||||
) \
|
||||
{ \
|
||||
if (!dsf.dimensions().dimensionless()) \
|
||||
{ \
|
||||
FatalErrorInFunction \
|
||||
<< "dsf not dimensionless" \
|
||||
<< abort(FatalError); \
|
||||
} \
|
||||
\
|
||||
tmp<DimensionedField<scalar, GeoMesh>> tFunc \
|
||||
( \
|
||||
new DimensionedField<scalar, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
#func "(" + name(n) + ',' + dsf.name() + ')', \
|
||||
dsf.instance(), \
|
||||
dsf.db() \
|
||||
), \
|
||||
dsf.mesh(), \
|
||||
dimless \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
func(tFunc().field(), n, dsf.field()); \
|
||||
\
|
||||
return tFunc; \
|
||||
} \
|
||||
\
|
||||
template<class GeoMesh> \
|
||||
tmp<DimensionedField<scalar, GeoMesh>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const tmp<DimensionedField<scalar, GeoMesh>>& tdsf \
|
||||
) \
|
||||
{ \
|
||||
const DimensionedField<scalar, GeoMesh>& dsf = tdsf(); \
|
||||
\
|
||||
if (!dsf.dimensions().dimensionless()) \
|
||||
{ \
|
||||
FatalErrorInFunction \
|
||||
<< " : dsf not dimensionless" \
|
||||
<< abort(FatalError); \
|
||||
} \
|
||||
\
|
||||
tmp<DimensionedField<scalar, GeoMesh>> tFunc \
|
||||
( \
|
||||
reuseTmpDimensionedField<scalar, scalar, GeoMesh>::New \
|
||||
( \
|
||||
tdsf, \
|
||||
#func "(" + name(n) + ',' + dsf.name() + ')', \
|
||||
dimless \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
func(tFunc().field(), n, dsf.field()); \
|
||||
\
|
||||
reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf); \
|
||||
\
|
||||
return tFunc; \
|
||||
#define BesselFunc(func) \
|
||||
\
|
||||
template<class GeoMesh> \
|
||||
tmp<DimensionedField<scalar, GeoMesh>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const DimensionedField<scalar, GeoMesh>& dsf \
|
||||
) \
|
||||
{ \
|
||||
if (!dsf.dimensions().dimensionless()) \
|
||||
{ \
|
||||
FatalErrorInFunction \
|
||||
<< "dsf not dimensionless" \
|
||||
<< abort(FatalError); \
|
||||
} \
|
||||
\
|
||||
tmp<DimensionedField<scalar, GeoMesh>> tFunc \
|
||||
( \
|
||||
new DimensionedField<scalar, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
#func "(" + name(n) + ',' + dsf.name() + ')', \
|
||||
dsf.instance(), \
|
||||
dsf.db() \
|
||||
), \
|
||||
dsf.mesh(), \
|
||||
dimless \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
func(tFunc().field(), n, dsf.field()); \
|
||||
\
|
||||
return tFunc; \
|
||||
} \
|
||||
\
|
||||
template<class GeoMesh> \
|
||||
tmp<DimensionedField<scalar, GeoMesh>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const tmp<DimensionedField<scalar, GeoMesh>>& tdsf \
|
||||
) \
|
||||
{ \
|
||||
const DimensionedField<scalar, GeoMesh>& dsf = tdsf(); \
|
||||
\
|
||||
if (!dsf.dimensions().dimensionless()) \
|
||||
{ \
|
||||
FatalErrorInFunction \
|
||||
<< " : dsf not dimensionless" \
|
||||
<< abort(FatalError); \
|
||||
} \
|
||||
\
|
||||
tmp<DimensionedField<scalar, GeoMesh>> tFunc \
|
||||
( \
|
||||
reuseTmpDimensionedField<scalar, scalar, GeoMesh>::New \
|
||||
( \
|
||||
tdsf, \
|
||||
#func "(" + name(n) + ',' + dsf.name() + ')', \
|
||||
dimless \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
func(tFunc().field(), n, dsf.field()); \
|
||||
\
|
||||
reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf); \
|
||||
\
|
||||
return tFunc; \
|
||||
}
|
||||
|
||||
BesselFunc(jn)
|
||||
|
||||
@ -124,17 +124,17 @@ UNARY_FUNCTION(scalar, scalar, y1, trans)
|
||||
#define BesselFunc(func) \
|
||||
\
|
||||
template<class GeoMesh> \
|
||||
tmp<DimensionedField<scalar, GeoMesh>> func \
|
||||
tmp<DimensionedField<scalar, GeoMesh>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const DimensionedField<scalar, GeoMesh>& \
|
||||
); \
|
||||
\
|
||||
template<class GeoMesh> \
|
||||
tmp<DimensionedField<scalar, GeoMesh>> func \
|
||||
tmp<DimensionedField<scalar, GeoMesh>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const tmp<DimensionedField<scalar, GeoMesh>>& \
|
||||
const tmp<DimensionedField<scalar, GeoMesh>>& \
|
||||
);
|
||||
|
||||
BesselFunc(jn)
|
||||
|
||||
@ -326,34 +326,34 @@ void FieldField<Field, Type>::operator=(const Type& t)
|
||||
}
|
||||
|
||||
|
||||
#define COMPUTED_ASSIGNMENT(TYPE, op) \
|
||||
\
|
||||
template<template<class> class Field, class Type> \
|
||||
void FieldField<Field, Type>::operator op(const FieldField<Field, TYPE>& f) \
|
||||
{ \
|
||||
forAll(*this, i) \
|
||||
{ \
|
||||
this->operator[](i) op f[i]; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
template<template<class> class Field, class Type> \
|
||||
void FieldField<Field, Type>::operator op \
|
||||
( \
|
||||
const tmp<FieldField<Field, TYPE>>& tf \
|
||||
) \
|
||||
{ \
|
||||
operator op(tf()); \
|
||||
tf.clear(); \
|
||||
} \
|
||||
\
|
||||
template<template<class> class Field, class Type> \
|
||||
void FieldField<Field, Type>::operator op(const TYPE& t) \
|
||||
{ \
|
||||
forAll(*this, i) \
|
||||
{ \
|
||||
this->operator[](i) op t; \
|
||||
} \
|
||||
#define COMPUTED_ASSIGNMENT(TYPE, op) \
|
||||
\
|
||||
template<template<class> class Field, class Type> \
|
||||
void FieldField<Field, Type>::operator op(const FieldField<Field, TYPE>& f) \
|
||||
{ \
|
||||
forAll(*this, i) \
|
||||
{ \
|
||||
this->operator[](i) op f[i]; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
template<template<class> class Field, class Type> \
|
||||
void FieldField<Field, Type>::operator op \
|
||||
( \
|
||||
const tmp<FieldField<Field, TYPE>>& tf \
|
||||
) \
|
||||
{ \
|
||||
operator op(tf()); \
|
||||
tf.clear(); \
|
||||
} \
|
||||
\
|
||||
template<template<class> class Field, class Type> \
|
||||
void FieldField<Field, Type>::operator op(const TYPE& t) \
|
||||
{ \
|
||||
forAll(*this, i) \
|
||||
{ \
|
||||
this->operator[](i) op t; \
|
||||
} \
|
||||
}
|
||||
|
||||
COMPUTED_ASSIGNMENT(Type, +=)
|
||||
|
||||
@ -397,14 +397,14 @@ tmp<FieldField<Field, Type>> cmptMag
|
||||
}
|
||||
|
||||
|
||||
#define TMP_UNARY_FUNCTION(returnType, func) \
|
||||
\
|
||||
template<template<class> class Field, class Type> \
|
||||
returnType func(const tmp<FieldField<Field, Type>>& tf1) \
|
||||
{ \
|
||||
returnType res = func(tf1()); \
|
||||
tf1.clear(); \
|
||||
return res; \
|
||||
#define TMP_UNARY_FUNCTION(returnType, func) \
|
||||
\
|
||||
template<template<class> class Field, class Type> \
|
||||
returnType func(const tmp<FieldField<Field, Type>>& tf1) \
|
||||
{ \
|
||||
returnType res = func(tf1()); \
|
||||
tf1.clear(); \
|
||||
return res; \
|
||||
}
|
||||
|
||||
template<template<class> class Field, class Type>
|
||||
@ -548,15 +548,15 @@ TMP_UNARY_FUNCTION(Type, average)
|
||||
|
||||
#include "PstreamReduceOps.H"
|
||||
|
||||
#define G_UNARY_FUNCTION(returnType, gFunc, func, rFunc) \
|
||||
\
|
||||
template<template<class> class Field, class Type> \
|
||||
returnType gFunc(const FieldField<Field, Type>& f) \
|
||||
{ \
|
||||
returnType res = func(f); \
|
||||
reduce(res, rFunc##Op<Type>()); \
|
||||
return res; \
|
||||
} \
|
||||
#define G_UNARY_FUNCTION(returnType, gFunc, func, rFunc) \
|
||||
\
|
||||
template<template<class> class Field, class Type> \
|
||||
returnType gFunc(const FieldField<Field, Type>& f) \
|
||||
{ \
|
||||
returnType res = func(f); \
|
||||
reduce(res, rFunc##Op<Type>()); \
|
||||
return res; \
|
||||
} \
|
||||
TMP_UNARY_FUNCTION(returnType, gFunc)
|
||||
|
||||
G_UNARY_FUNCTION(Type, gMax, max, max)
|
||||
@ -655,7 +655,7 @@ template \
|
||||
class Type1, \
|
||||
class Type2 \
|
||||
> \
|
||||
tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
|
||||
tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const FieldField<Field1, Type1>& f1, \
|
||||
@ -663,7 +663,7 @@ operator op \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<FieldField<Field1, productType>> tRes \
|
||||
tmp<FieldField<Field1, productType>> tRes \
|
||||
( \
|
||||
FieldField<Field1, productType>::NewCalculatedType(f1) \
|
||||
); \
|
||||
@ -672,15 +672,15 @@ operator op \
|
||||
} \
|
||||
\
|
||||
template<template<class> class Field, class Type1, class Type2> \
|
||||
tmp<FieldField<Field, typename product<Type1, Type2>::type>> \
|
||||
tmp<FieldField<Field, typename product<Type1, Type2>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<FieldField<Field, productType>> tRes \
|
||||
tmp<FieldField<Field, productType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, productType, Type2>::New(tf2) \
|
||||
); \
|
||||
@ -696,15 +696,15 @@ template \
|
||||
class Type1, \
|
||||
class Type2 \
|
||||
> \
|
||||
tmp<FieldField<Field, typename product<Type1, Type2>::type>> \
|
||||
tmp<FieldField<Field, typename product<Type1, Type2>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const FieldField<Field1, Type1>& f1, \
|
||||
const tmp<FieldField<Field2, Type2>>& tf2 \
|
||||
const tmp<FieldField<Field2, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<FieldField<Field1, productType>> tRes \
|
||||
tmp<FieldField<Field1, productType>> tRes \
|
||||
( \
|
||||
FieldField<Field1, productType>::NewCalculatedType(f1) \
|
||||
); \
|
||||
@ -720,15 +720,15 @@ template \
|
||||
class Type1, \
|
||||
class Type2 \
|
||||
> \
|
||||
tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
|
||||
tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<FieldField<Field1, Type1>>& tf1, \
|
||||
const tmp<FieldField<Field1, Type1>>& tf1, \
|
||||
const FieldField<Field2, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<FieldField<Field1, productType>> tRes \
|
||||
tmp<FieldField<Field1, productType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field1, productType, Type1>::New(tf1) \
|
||||
); \
|
||||
@ -744,15 +744,15 @@ template \
|
||||
class Type1, \
|
||||
class Type2 \
|
||||
> \
|
||||
tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
|
||||
tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<FieldField<Field1, Type1>>& tf1, \
|
||||
const tmp<FieldField<Field2, Type2>>& tf2 \
|
||||
const tmp<FieldField<Field1, Type1>>& tf1, \
|
||||
const tmp<FieldField<Field2, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<FieldField<Field1, productType>> tRes \
|
||||
tmp<FieldField<Field1, productType>> tRes \
|
||||
( \
|
||||
reuseTmpTmpFieldField<Field1, productType, Type1, Type1, Type2>::New \
|
||||
(tf1, tf2) \
|
||||
@ -780,7 +780,7 @@ void opFunc \
|
||||
\
|
||||
template \
|
||||
<template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
|
||||
tmp<FieldField<Field, typename product<Type, Form>::type>> \
|
||||
tmp<FieldField<Field, typename product<Type, Form>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const FieldField<Field, Type>& f1, \
|
||||
@ -788,7 +788,7 @@ operator op \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
tmp<FieldField<Field, productType>> tRes \
|
||||
tmp<FieldField<Field, productType>> tRes \
|
||||
( \
|
||||
FieldField<Field, productType>::NewCalculatedType(f1) \
|
||||
); \
|
||||
@ -798,15 +798,15 @@ operator op \
|
||||
\
|
||||
template \
|
||||
<template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
|
||||
tmp<FieldField<Field, typename product<Type, Form>::type>> \
|
||||
tmp<FieldField<Field, typename product<Type, Form>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type>>& tf1, \
|
||||
const tmp<FieldField<Field, Type>>& tf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
tmp<FieldField<Field, productType>> tRes \
|
||||
tmp<FieldField<Field, productType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, productType, Type>::New(tf1) \
|
||||
); \
|
||||
@ -832,7 +832,7 @@ void opFunc \
|
||||
\
|
||||
template \
|
||||
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
|
||||
tmp<FieldField<Field, typename product<Form, Type>::type>> \
|
||||
tmp<FieldField<Field, typename product<Form, Type>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
@ -840,7 +840,7 @@ operator op \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
tmp<FieldField<Field, productType>> tRes \
|
||||
tmp<FieldField<Field, productType>> tRes \
|
||||
( \
|
||||
FieldField<Field, productType>::NewCalculatedType(f1) \
|
||||
); \
|
||||
@ -850,15 +850,15 @@ operator op \
|
||||
\
|
||||
template \
|
||||
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
|
||||
tmp<FieldField<Field, typename product<Form, Type>::type>> \
|
||||
tmp<FieldField<Field, typename product<Form, Type>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const tmp<FieldField<Field, Type>>& tf1 \
|
||||
const tmp<FieldField<Field, Type>>& tf1 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
tmp<FieldField<Field, productType>> tRes \
|
||||
tmp<FieldField<Field, productType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, productType, Type>::New(tf1) \
|
||||
); \
|
||||
|
||||
@ -185,9 +185,9 @@ tmp<FieldField<Field, Type>> cmptMag
|
||||
);
|
||||
|
||||
|
||||
#define TMP_UNARY_FUNCTION(returnType, func) \
|
||||
\
|
||||
template<template<class> class Field, class Type> \
|
||||
#define TMP_UNARY_FUNCTION(returnType, func) \
|
||||
\
|
||||
template<template<class> class Field, class Type> \
|
||||
returnType func(const tmp<FieldField<Field, Type>>& tf1);
|
||||
|
||||
template<template<class> class Field, class Type>
|
||||
@ -216,10 +216,10 @@ Type average(const FieldField<Field, Type>& f);
|
||||
TMP_UNARY_FUNCTION(Type, average)
|
||||
|
||||
|
||||
#define G_UNARY_FUNCTION(returnType, gFunc, func, rFunc) \
|
||||
\
|
||||
template<template<class> class Field, class Type> \
|
||||
returnType gFunc(const FieldField<Field, Type>& f); \
|
||||
#define G_UNARY_FUNCTION(returnType, gFunc, func, rFunc) \
|
||||
\
|
||||
template<template<class> class Field, class Type> \
|
||||
returnType gFunc(const FieldField<Field, Type>& f); \
|
||||
TMP_UNARY_FUNCTION(returnType, gFunc)
|
||||
|
||||
G_UNARY_FUNCTION(Type, gMax, max, max)
|
||||
@ -288,7 +288,7 @@ template \
|
||||
class Type1, \
|
||||
class Type2 \
|
||||
> \
|
||||
tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
|
||||
tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const FieldField<Field1, Type1>& f1, \
|
||||
@ -296,11 +296,11 @@ operator op \
|
||||
); \
|
||||
\
|
||||
template<template<class> class Field, class Type1, class Type2> \
|
||||
tmp<FieldField<Field, typename product<Type1, Type2>::type>> \
|
||||
tmp<FieldField<Field, typename product<Type1, Type2>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
@ -310,11 +310,11 @@ template \
|
||||
class Type1, \
|
||||
class Type2 \
|
||||
> \
|
||||
tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
|
||||
tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const FieldField<Field1, Type1>& f1, \
|
||||
const tmp<FieldField<Field2, Type2>>& tf2 \
|
||||
const tmp<FieldField<Field2, Type2>>& tf2 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
@ -324,10 +324,10 @@ template \
|
||||
class Type1, \
|
||||
class Type2 \
|
||||
> \
|
||||
tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
|
||||
tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<FieldField<Field1, Type1>>& tf1, \
|
||||
const tmp<FieldField<Field1, Type1>>& tf1, \
|
||||
const FieldField<Field2, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
@ -338,11 +338,11 @@ template \
|
||||
class Type1, \
|
||||
class Type2 \
|
||||
> \
|
||||
tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
|
||||
tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<FieldField<Field1, Type1>>& tf1, \
|
||||
const tmp<FieldField<Field2, Type2>>& tf2 \
|
||||
const tmp<FieldField<Field1, Type1>>& tf1, \
|
||||
const tmp<FieldField<Field2, Type2>>& tf2 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
@ -356,7 +356,7 @@ void opFunc \
|
||||
\
|
||||
template \
|
||||
<template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
|
||||
tmp<FieldField<Field, typename product<Type, Form>::type>> \
|
||||
tmp<FieldField<Field, typename product<Type, Form>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const FieldField<Field, Type>& f1, \
|
||||
@ -365,10 +365,10 @@ operator op \
|
||||
\
|
||||
template \
|
||||
<template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
|
||||
tmp<FieldField<Field, typename product<Type, Form>::type>> \
|
||||
tmp<FieldField<Field, typename product<Type, Form>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type>>& tf1, \
|
||||
const tmp<FieldField<Field, Type>>& tf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
); \
|
||||
\
|
||||
@ -383,7 +383,7 @@ void opFunc \
|
||||
\
|
||||
template \
|
||||
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
|
||||
tmp<FieldField<Field, typename product<Form, Type>::type>> \
|
||||
tmp<FieldField<Field, typename product<Form, Type>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
@ -392,11 +392,11 @@ operator op \
|
||||
\
|
||||
template \
|
||||
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
|
||||
tmp<FieldField<Field, typename product<Form, Type>::type>> \
|
||||
tmp<FieldField<Field, typename product<Form, Type>::type>> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const tmp<FieldField<Field, Type>>& tf1 \
|
||||
const tmp<FieldField<Field, Type>>& tf1 \
|
||||
);
|
||||
|
||||
PRODUCT_OPERATOR(typeOfSum, +, add)
|
||||
|
||||
@ -28,469 +28,469 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define UNARY_FUNCTION(ReturnType, Type, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& res, \
|
||||
const FieldField<Field, Type>& f \
|
||||
) \
|
||||
{ \
|
||||
forAll(res, i) \
|
||||
{ \
|
||||
Func(res[i], f[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const FieldField<Field, Type>& f \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
FieldField<Field, ReturnType>::NewCalculatedType(f) \
|
||||
); \
|
||||
Func(tRes(), f); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type>>& tf \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, Type, Type>::New(tf) \
|
||||
); \
|
||||
Func(tRes(), tf()); \
|
||||
reuseTmpFieldField<Field, Type, Type>::clear(tf); \
|
||||
return tRes; \
|
||||
#define UNARY_FUNCTION(ReturnType, Type, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& res, \
|
||||
const FieldField<Field, Type>& f \
|
||||
) \
|
||||
{ \
|
||||
forAll(res, i) \
|
||||
{ \
|
||||
Func(res[i], f[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const FieldField<Field, Type>& f \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
FieldField<Field, ReturnType>::NewCalculatedType(f) \
|
||||
); \
|
||||
Func(tRes(), f); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type>>& tf \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, Type, Type>::New(tf) \
|
||||
); \
|
||||
Func(tRes(), tf()); \
|
||||
reuseTmpFieldField<Field, Type, Type>::clear(tf); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define UNARY_OPERATOR(ReturnType, Type, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& res, \
|
||||
const FieldField<Field, Type>& f \
|
||||
) \
|
||||
{ \
|
||||
forAll(res, i) \
|
||||
{ \
|
||||
OpFunc(res[i], f[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type>& f \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
FieldField<Field, Type>::NewCalculatedType(f) \
|
||||
); \
|
||||
OpFunc(tRes(), f); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type>>& tf \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, Type, Type>::New(tf) \
|
||||
); \
|
||||
OpFunc(tRes(), tf()); \
|
||||
reuseTmpFieldField<Field, Type, Type>::clear(tf); \
|
||||
return tRes; \
|
||||
#define UNARY_OPERATOR(ReturnType, Type, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& res, \
|
||||
const FieldField<Field, Type>& f \
|
||||
) \
|
||||
{ \
|
||||
forAll(res, i) \
|
||||
{ \
|
||||
OpFunc(res[i], f[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type>& f \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
FieldField<Field, Type>::NewCalculatedType(f) \
|
||||
); \
|
||||
OpFunc(tRes(), f); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type>>& tf \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, Type, Type>::New(tf) \
|
||||
); \
|
||||
OpFunc(tRes(), tf()); \
|
||||
reuseTmpFieldField<Field, Type, Type>::clear(tf); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
forAll(f, i) \
|
||||
{ \
|
||||
Func(f[i], f1[i], f2[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
FieldField<Field, Type1>::NewCalculatedType(f1) \
|
||||
); \
|
||||
Func(tRes(), f1, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::New(tf2) \
|
||||
); \
|
||||
Func(tRes(), f1, tf2()); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, ReturnType, Type1>::New(tf1) \
|
||||
); \
|
||||
Func(tRes(), tf1(), f2); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpTmpFieldField<Field, ReturnType, Type1, Type1, Type2>:: \
|
||||
New(tf1, tf2) \
|
||||
); \
|
||||
Func(tRes(), tf1(), tf2()); \
|
||||
reuseTmpTmpFieldField<Field, ReturnType, Type1, Type1, Type2>:: \
|
||||
clear(tf1, tf2); \
|
||||
return tRes; \
|
||||
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
forAll(f, i) \
|
||||
{ \
|
||||
Func(f[i], f1[i], f2[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
FieldField<Field, Type1>::NewCalculatedType(f1) \
|
||||
); \
|
||||
Func(tRes(), f1, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::New(tf2) \
|
||||
); \
|
||||
Func(tRes(), f1, tf2()); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, ReturnType, Type1>::New(tf1) \
|
||||
); \
|
||||
Func(tRes(), tf1(), f2); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpTmpFieldField<Field, ReturnType, Type1, Type1, Type2>:: \
|
||||
New(tf1, tf2) \
|
||||
); \
|
||||
Func(tRes(), tf1(), tf2()); \
|
||||
reuseTmpTmpFieldField<Field, ReturnType, Type1, Type1, Type2>:: \
|
||||
clear(tf1, tf2); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_TYPE_FUNCTION_SF(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(), 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(), tf1(), s); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
#define BINARY_TYPE_FUNCTION_SF(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(), 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(), tf1(), s); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const Type1& s, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
forAll(f, i) \
|
||||
{ \
|
||||
Func(f[i], s, f2[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const Type1& s, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
FieldField<Field, Type2>::NewCalculatedType(f2) \
|
||||
); \
|
||||
Func(tRes(), s, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const Type1& s, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::New(tf2) \
|
||||
); \
|
||||
Func(tRes(), s, tf2()); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const Type1& s, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
forAll(f, i) \
|
||||
{ \
|
||||
Func(f[i], s, f2[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const Type1& s, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
FieldField<Field, Type2>::NewCalculatedType(f2) \
|
||||
); \
|
||||
Func(tRes(), s, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const Type1& s, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::New(tf2) \
|
||||
); \
|
||||
Func(tRes(), s, tf2()); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
forAll(f, i) \
|
||||
{ \
|
||||
OpFunc(f[i], f1[i], f2[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
FieldField<Field, ReturnType>::NewCalculatedType(f1) \
|
||||
); \
|
||||
OpFunc(tRes(), f1, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::New(tf2) \
|
||||
); \
|
||||
OpFunc(tRes(), f1, tf2()); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, ReturnType, Type1>::New(tf1) \
|
||||
); \
|
||||
OpFunc(tRes(), tf1(), f2); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpTmpFieldField<Field, ReturnType, Type1, Type1, Type2>:: \
|
||||
New(tf1, tf2) \
|
||||
); \
|
||||
OpFunc(tRes(), tf1(), tf2()); \
|
||||
reuseTmpTmpFieldField<Field, ReturnType, Type1, Type1, Type2>:: \
|
||||
clear(tf1, tf2); \
|
||||
return tRes; \
|
||||
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
forAll(f, i) \
|
||||
{ \
|
||||
OpFunc(f[i], f1[i], f2[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
FieldField<Field, ReturnType>::NewCalculatedType(f1) \
|
||||
); \
|
||||
OpFunc(tRes(), f1, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::New(tf2) \
|
||||
); \
|
||||
OpFunc(tRes(), f1, tf2()); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, ReturnType, Type1>::New(tf1) \
|
||||
); \
|
||||
OpFunc(tRes(), tf1(), f2); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpTmpFieldField<Field, ReturnType, Type1, Type1, Type2>:: \
|
||||
New(tf1, tf2) \
|
||||
); \
|
||||
OpFunc(tRes(), tf1(), tf2()); \
|
||||
reuseTmpTmpFieldField<Field, ReturnType, Type1, Type1, Type2>:: \
|
||||
clear(tf1, tf2); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const Type1& s, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
forAll(f, i) \
|
||||
{ \
|
||||
OpFunc(f[i], s, f2[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
FieldField<Field, Type2>::NewCalculatedType(f2) \
|
||||
); \
|
||||
OpFunc(tRes(), s, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::New(tf2) \
|
||||
); \
|
||||
OpFunc(tRes(), s, tf2()); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const Type1& s, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
forAll(f, i) \
|
||||
{ \
|
||||
OpFunc(f[i], s, f2[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
FieldField<Field, Type2>::NewCalculatedType(f2) \
|
||||
); \
|
||||
OpFunc(tRes(), s, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::New(tf2) \
|
||||
); \
|
||||
OpFunc(tRes(), s, tf2()); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const Type2& s \
|
||||
) \
|
||||
{ \
|
||||
forAll(f, i) \
|
||||
{ \
|
||||
OpFunc(f[i], f1[i], s); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const Type2& s \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
FieldField<Field, Type1>::NewCalculatedType(f1) \
|
||||
); \
|
||||
OpFunc(tRes(), f1, s); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const Type2& s \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, ReturnType, Type1>::New(tf1) \
|
||||
); \
|
||||
OpFunc(tRes(), tf1(), s); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const Type2& s \
|
||||
) \
|
||||
{ \
|
||||
forAll(f, i) \
|
||||
{ \
|
||||
OpFunc(f[i], f1[i], s); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const Type2& s \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
FieldField<Field, Type1>::NewCalculatedType(f1) \
|
||||
); \
|
||||
OpFunc(tRes(), f1, s); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const Type2& s \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, ReturnType>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, ReturnType, Type1>::New(tf1) \
|
||||
); \
|
||||
OpFunc(tRes(), tf1(), s); \
|
||||
reuseTmpFieldField<Field, ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpFunc)
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -30,245 +30,245 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define UNARY_FUNCTION(ReturnType, Type1, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& res, \
|
||||
const FieldField<Field, Type1>& f \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf \
|
||||
#define UNARY_FUNCTION(ReturnType, Type1, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& res, \
|
||||
const FieldField<Field, Type1>& f \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> Func \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& res, \
|
||||
const FieldField<Field, Type1>& f \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf \
|
||||
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& res, \
|
||||
const FieldField<Field, Type1>& f \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void func \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void func \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void func \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const Type1& s1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const FieldField<Field, Type1>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const tmp<FieldField<Field, Type1>>& tf2 \
|
||||
#define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void func \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const Type1& s1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const FieldField<Field, Type1>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const tmp<FieldField<Field, Type1>>& tf2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void func \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const Type2& s \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const Type2& s \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const Type2& s \
|
||||
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void func \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const Type2& s \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const Type2& s \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> func \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const Type2& s \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const Type1& s1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const Type1& s1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const FieldField<Field, Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const tmp<FieldField<Field, Type2>>& tf2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const Type2& s2 \
|
||||
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
FieldField<Field, ReturnType>& f, \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const FieldField<Field, Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<FieldField<Field, ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<FieldField<Field, Type1>>& tf1, \
|
||||
const Type2& s2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpFunc)
|
||||
|
||||
|
||||
|
||||
@ -135,51 +135,51 @@ UNARY_FUNCTION(scalar, scalar, y0)
|
||||
UNARY_FUNCTION(scalar, scalar, y1)
|
||||
|
||||
|
||||
#define BesselFunc(func) \
|
||||
\
|
||||
template<template<class> class Field> \
|
||||
void func \
|
||||
( \
|
||||
FieldField<Field, scalar>& res, \
|
||||
const int n, \
|
||||
const FieldField<Field, scalar>& sf \
|
||||
) \
|
||||
{ \
|
||||
forAll(res, i) \
|
||||
{ \
|
||||
func(res[i], n, sf[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
template<template<class> class Field> \
|
||||
tmp<FieldField<Field, scalar>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const FieldField<Field, scalar>& sf \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, scalar>> tRes \
|
||||
( \
|
||||
FieldField<Field, scalar>::NewCalculatedType(sf) \
|
||||
); \
|
||||
func(tRes(), n, sf); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<template<class> class Field> \
|
||||
tmp<FieldField<Field, scalar>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const tmp<FieldField<Field, scalar>>& tsf \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, scalar>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, scalar, scalar>::New(tsf) \
|
||||
); \
|
||||
func(tRes(), n, tsf()); \
|
||||
reuseTmpFieldField<Field, scalar, scalar>::clear(tsf); \
|
||||
return tRes; \
|
||||
#define BesselFunc(func) \
|
||||
\
|
||||
template<template<class> class Field> \
|
||||
void func \
|
||||
( \
|
||||
FieldField<Field, scalar>& res, \
|
||||
const int n, \
|
||||
const FieldField<Field, scalar>& sf \
|
||||
) \
|
||||
{ \
|
||||
forAll(res, i) \
|
||||
{ \
|
||||
func(res[i], n, sf[i]); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
template<template<class> class Field> \
|
||||
tmp<FieldField<Field, scalar>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const FieldField<Field, scalar>& sf \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, scalar>> tRes \
|
||||
( \
|
||||
FieldField<Field, scalar>::NewCalculatedType(sf) \
|
||||
); \
|
||||
func(tRes(), n, sf); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<template<class> class Field> \
|
||||
tmp<FieldField<Field, scalar>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const tmp<FieldField<Field, scalar>>& tsf \
|
||||
) \
|
||||
{ \
|
||||
tmp<FieldField<Field, scalar>> tRes \
|
||||
( \
|
||||
reuseTmpFieldField<Field, scalar, scalar>::New(tsf) \
|
||||
); \
|
||||
func(tRes(), n, tsf()); \
|
||||
reuseTmpFieldField<Field, scalar, scalar>::clear(tsf); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
BesselFunc(jn)
|
||||
|
||||
@ -128,14 +128,14 @@ UNARY_FUNCTION(scalar, scalar, y0)
|
||||
UNARY_FUNCTION(scalar, scalar, y1)
|
||||
|
||||
|
||||
#define BesselFunc(func) \
|
||||
void func \
|
||||
( \
|
||||
FieldField<Field, scalar>& Res, \
|
||||
const int n, \
|
||||
const FieldField<Field, scalar>& sf \
|
||||
); \
|
||||
tmp<scalarField> func(const int n, const FieldField<Field, scalar>&); \
|
||||
#define BesselFunc(func) \
|
||||
void func \
|
||||
( \
|
||||
FieldField<Field, scalar>& Res, \
|
||||
const int n, \
|
||||
const FieldField<Field, scalar>& sf \
|
||||
); \
|
||||
tmp<scalarField> func(const int n, const FieldField<Field, scalar>&); \
|
||||
tmp<scalarField> func(const int n, const tmp<FieldField<Field, scalar>>&);
|
||||
|
||||
BesselFunc(jn)
|
||||
|
||||
@ -712,25 +712,25 @@ void Foam::Field<Type>::operator=(const VectorSpace<Form,Cmpt,nCmpt>& vs)
|
||||
}
|
||||
|
||||
|
||||
#define COMPUTED_ASSIGNMENT(TYPE, op) \
|
||||
\
|
||||
template<class Type> \
|
||||
void Foam::Field<Type>::operator op(const UList<TYPE>& f) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_F(Type, *this, op, TYPE, f) \
|
||||
} \
|
||||
\
|
||||
template<class Type> \
|
||||
void Foam::Field<Type>::operator op(const tmp<Field<TYPE>>& tf) \
|
||||
{ \
|
||||
operator op(tf()); \
|
||||
tf.clear(); \
|
||||
} \
|
||||
\
|
||||
template<class Type> \
|
||||
void Foam::Field<Type>::operator op(const TYPE& t) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_S(Type, *this, op, TYPE, t) \
|
||||
#define COMPUTED_ASSIGNMENT(TYPE, op) \
|
||||
\
|
||||
template<class Type> \
|
||||
void Foam::Field<Type>::operator op(const UList<TYPE>& f) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_F(Type, *this, op, TYPE, f) \
|
||||
} \
|
||||
\
|
||||
template<class Type> \
|
||||
void Foam::Field<Type>::operator op(const tmp<Field<TYPE>>& tf) \
|
||||
{ \
|
||||
operator op(tf()); \
|
||||
tf.clear(); \
|
||||
} \
|
||||
\
|
||||
template<class Type> \
|
||||
void Foam::Field<Type>::operator op(const TYPE& t) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_S(Type, *this, op, TYPE, t) \
|
||||
}
|
||||
|
||||
COMPUTED_ASSIGNMENT(Type, +=)
|
||||
|
||||
@ -297,14 +297,14 @@ tmp<Field<Type>> cmptMag(const tmp<Field<Type>>& tf)
|
||||
}
|
||||
|
||||
|
||||
#define TMP_UNARY_FUNCTION(ReturnType, Func) \
|
||||
\
|
||||
template<class Type> \
|
||||
ReturnType Func(const tmp<Field<Type>>& tf1) \
|
||||
{ \
|
||||
ReturnType res = Func(tf1()); \
|
||||
tf1.clear(); \
|
||||
return res; \
|
||||
#define TMP_UNARY_FUNCTION(ReturnType, Func) \
|
||||
\
|
||||
template<class Type> \
|
||||
ReturnType Func(const tmp<Field<Type>>& tf1) \
|
||||
{ \
|
||||
ReturnType res = Func(tf1()); \
|
||||
tf1.clear(); \
|
||||
return res; \
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
@ -527,15 +527,15 @@ Type average(const UList<Type>& f)
|
||||
TMP_UNARY_FUNCTION(Type, average)
|
||||
|
||||
|
||||
#define G_UNARY_FUNCTION(ReturnType, gFunc, Func, rFunc) \
|
||||
\
|
||||
template<class Type> \
|
||||
ReturnType gFunc(const UList<Type>& f, const label comm) \
|
||||
{ \
|
||||
ReturnType res = Func(f); \
|
||||
reduce(res, rFunc##Op<Type>(), Pstream::msgType(), comm); \
|
||||
return res; \
|
||||
} \
|
||||
#define G_UNARY_FUNCTION(ReturnType, gFunc, Func, rFunc) \
|
||||
\
|
||||
template<class Type> \
|
||||
ReturnType gFunc(const UList<Type>& f, const label comm) \
|
||||
{ \
|
||||
ReturnType res = Func(f); \
|
||||
reduce(res, rFunc##Op<Type>(), Pstream::msgType(), comm); \
|
||||
return res; \
|
||||
} \
|
||||
TMP_UNARY_FUNCTION(ReturnType, gFunc)
|
||||
|
||||
G_UNARY_FUNCTION(Type, gMax, max, max)
|
||||
@ -633,137 +633,137 @@ BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, /, divide)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define PRODUCT_OPERATOR(product, Op, OpFunc) \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<typename product<Type1, Type2>::type>& res, \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
TFOR_ALL_F_OP_F_OP_F(productType, res, =, Type1, f1, Op, Type2, f2) \
|
||||
} \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const UList<Type1>& f1, const UList<Type2>& f2) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<Field<productType>> tRes(new Field<productType>(f1.size())); \
|
||||
OpFunc(tRes(), f1, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const UList<Type1>& f1, const tmp<Field<Type2>>& tf2) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<Field<productType>> tRes = reuseTmp<productType, Type2>::New(tf2); \
|
||||
OpFunc(tRes(), f1, tf2()); \
|
||||
reuseTmp<productType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const tmp<Field<Type1>>& tf1, const UList<Type2>& f2) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<Field<productType>> tRes = reuseTmp<productType, Type1>::New(tf1); \
|
||||
OpFunc(tRes(), tf1(), f2); \
|
||||
reuseTmp<productType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const tmp<Field<Type1>>& tf1, const tmp<Field<Type2>>& tf2) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<Field<productType>> tRes = \
|
||||
reuseTmpTmp<productType, Type1, Type1, Type2>::New(tf1, tf2); \
|
||||
OpFunc(tRes(), tf1(), tf2()); \
|
||||
reuseTmpTmp<productType, Type1, Type1, Type2>::clear(tf1, tf2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<typename product<Type, Form>::type>& res, \
|
||||
const UList<Type>& f1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
TFOR_ALL_F_OP_F_OP_S \
|
||||
#define PRODUCT_OPERATOR(product, Op, OpFunc) \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<typename product<Type1, Type2>::type>& res, \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
TFOR_ALL_F_OP_F_OP_F(productType, res, =, Type1, f1, Op, Type2, f2) \
|
||||
} \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const UList<Type1>& f1, const UList<Type2>& f2) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<Field<productType>> tRes(new Field<productType>(f1.size())); \
|
||||
OpFunc(tRes(), f1, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const UList<Type1>& f1, const tmp<Field<Type2>>& tf2) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<Field<productType>> tRes = reuseTmp<productType, Type2>::New(tf2); \
|
||||
OpFunc(tRes(), f1, tf2()); \
|
||||
reuseTmp<productType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const tmp<Field<Type1>>& tf1, const UList<Type2>& f2) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<Field<productType>> tRes = reuseTmp<productType, Type1>::New(tf1); \
|
||||
OpFunc(tRes(), tf1(), f2); \
|
||||
reuseTmp<productType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const tmp<Field<Type1>>& tf1, const tmp<Field<Type2>>& tf2) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<Field<productType>> tRes = \
|
||||
reuseTmpTmp<productType, Type1, Type1, Type2>::New(tf1, tf2); \
|
||||
OpFunc(tRes(), tf1(), tf2()); \
|
||||
reuseTmpTmp<productType, Type1, Type1, Type2>::clear(tf1, tf2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<typename product<Type, Form>::type>& res, \
|
||||
const UList<Type>& f1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
TFOR_ALL_F_OP_F_OP_S \
|
||||
(productType, res, =,Type, f1, Op, Form, static_cast<const Form&>(vs))\
|
||||
} \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
tmp<Field<typename product<Type, Form>::type>> \
|
||||
operator Op(const UList<Type>& f1, const VectorSpace<Form,Cmpt,nCmpt>& vs) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
tmp<Field<productType>> tRes(new Field<productType>(f1.size())); \
|
||||
OpFunc(tRes(), f1, static_cast<const Form&>(vs)); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
tmp<Field<typename product<Type, Form>::type>> \
|
||||
operator Op \
|
||||
( \
|
||||
const tmp<Field<Type>>& tf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
tmp<Field<productType>> tRes = reuseTmp<productType, Type>::New(tf1); \
|
||||
OpFunc(tRes(), tf1(), static_cast<const Form&>(vs)); \
|
||||
reuseTmp<productType, Type>::clear(tf1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type> \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<typename product<Form, Type>::type>& res, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const UList<Type>& f1 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
TFOR_ALL_F_OP_S_OP_F \
|
||||
} \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
tmp<Field<typename product<Type, Form>::type>> \
|
||||
operator Op(const UList<Type>& f1, const VectorSpace<Form,Cmpt,nCmpt>& vs) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
tmp<Field<productType>> tRes(new Field<productType>(f1.size())); \
|
||||
OpFunc(tRes(), f1, static_cast<const Form&>(vs)); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
tmp<Field<typename product<Type, Form>::type>> \
|
||||
operator Op \
|
||||
( \
|
||||
const tmp<Field<Type>>& tf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
tmp<Field<productType>> tRes = reuseTmp<productType, Type>::New(tf1); \
|
||||
OpFunc(tRes(), tf1(), static_cast<const Form&>(vs)); \
|
||||
reuseTmp<productType, Type>::clear(tf1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type> \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<typename product<Form, Type>::type>& res, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const UList<Type>& f1 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
TFOR_ALL_F_OP_S_OP_F \
|
||||
(productType, res, =,Form,static_cast<const Form&>(vs), Op, Type, f1) \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type> \
|
||||
tmp<Field<typename product<Form, Type>::type>> \
|
||||
operator Op(const VectorSpace<Form,Cmpt,nCmpt>& vs, const UList<Type>& f1) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
tmp<Field<productType>> tRes(new Field<productType>(f1.size())); \
|
||||
OpFunc(tRes(), static_cast<const Form&>(vs), f1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type> \
|
||||
tmp<Field<typename product<Form, Type>::type>> \
|
||||
operator Op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, const tmp<Field<Type>>& tf1 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
tmp<Field<productType>> tRes = reuseTmp<productType, Type>::New(tf1); \
|
||||
OpFunc(tRes(), static_cast<const Form&>(vs), tf1()); \
|
||||
reuseTmp<productType, Type>::clear(tf1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type> \
|
||||
tmp<Field<typename product<Form, Type>::type>> \
|
||||
operator Op(const VectorSpace<Form,Cmpt,nCmpt>& vs, const UList<Type>& f1) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
tmp<Field<productType>> tRes(new Field<productType>(f1.size())); \
|
||||
OpFunc(tRes(), static_cast<const Form&>(vs), f1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type> \
|
||||
tmp<Field<typename product<Form, Type>::type>> \
|
||||
operator Op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, const tmp<Field<Type>>& tf1 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
tmp<Field<productType>> tRes = reuseTmp<productType, Type>::New(tf1); \
|
||||
OpFunc(tRes(), static_cast<const Form&>(vs), tf1()); \
|
||||
reuseTmp<productType, Type>::clear(tf1); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
PRODUCT_OPERATOR(typeOfSum, +, add)
|
||||
|
||||
@ -151,9 +151,9 @@ tmp<Field<Type>> cmptMag(const UList<Type>& f);
|
||||
template<class Type>
|
||||
tmp<Field<Type>> cmptMag(const tmp<Field<Type>>& tf);
|
||||
|
||||
#define TMP_UNARY_FUNCTION(ReturnType, Func) \
|
||||
\
|
||||
template<class Type> \
|
||||
#define TMP_UNARY_FUNCTION(ReturnType, Func) \
|
||||
\
|
||||
template<class Type> \
|
||||
ReturnType Func(const tmp<Field<Type>>& tf1);
|
||||
|
||||
template<class Type>
|
||||
@ -209,9 +209,9 @@ Type average(const UList<Type>& f);
|
||||
TMP_UNARY_FUNCTION(Type, average)
|
||||
|
||||
|
||||
#define G_UNARY_FUNCTION(ReturnType, gFunc, Func, rFunc) \
|
||||
\
|
||||
template<class Type> \
|
||||
#define G_UNARY_FUNCTION(ReturnType, gFunc, Func, rFunc) \
|
||||
\
|
||||
template<class Type> \
|
||||
ReturnType gFunc(const UList<Type>& f, const label comm = UPstream::worldComm);\
|
||||
TMP_UNARY_FUNCTION(ReturnType, gFunc)
|
||||
|
||||
@ -281,62 +281,62 @@ BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, /, divide)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define PRODUCT_OPERATOR(product, Op, OpFunc) \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<typename product<Type1, Type2>::type>& res, \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const UList<Type1>& f1, const UList<Type2>& f2); \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const UList<Type1>& f1, const tmp<Field<Type2>>& tf2); \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const tmp<Field<Type1>>& tf1, const UList<Type2>& f2); \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const tmp<Field<Type1>>& tf1, const tmp<Field<Type2>>& tf2); \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<typename product<Type, Form>::type>& res, \
|
||||
const UList<Type>& f1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
); \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
tmp<Field<typename product<Type, Form>::type>> \
|
||||
operator Op(const UList<Type>& f1, const VectorSpace<Form,Cmpt,nCmpt>& vs); \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
tmp<Field<typename product<Type, Form>::type>> \
|
||||
#define PRODUCT_OPERATOR(product, Op, OpFunc) \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<typename product<Type1, Type2>::type>& res, \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const UList<Type1>& f1, const UList<Type2>& f2); \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const UList<Type1>& f1, const tmp<Field<Type2>>& tf2); \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const tmp<Field<Type1>>& tf1, const UList<Type2>& f2); \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
tmp<Field<typename product<Type1, Type2>::type>> \
|
||||
operator Op(const tmp<Field<Type1>>& tf1, const tmp<Field<Type2>>& tf2); \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<typename product<Type, Form>::type>& res, \
|
||||
const UList<Type>& f1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
); \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
tmp<Field<typename product<Type, Form>::type>> \
|
||||
operator Op(const UList<Type>& f1, const VectorSpace<Form,Cmpt,nCmpt>& vs); \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
tmp<Field<typename product<Type, Form>::type>> \
|
||||
operator Op(const tmp<Field<Type>>&tf1,const VectorSpace<Form,Cmpt,nCmpt>&vs);\
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type> \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<typename product<Form, Type>::type>& res, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const UList<Type>& f1 \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type> \
|
||||
tmp<Field<typename product<Form, Type>::type>> \
|
||||
operator Op(const VectorSpace<Form,Cmpt,nCmpt>& vs, const UList<Type>& f1); \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type> \
|
||||
tmp<Field<typename product<Form, Type>::type>> \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type> \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<typename product<Form, Type>::type>& res, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const UList<Type>& f1 \
|
||||
); \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type> \
|
||||
tmp<Field<typename product<Form, Type>::type>> \
|
||||
operator Op(const VectorSpace<Form,Cmpt,nCmpt>& vs, const UList<Type>& f1); \
|
||||
\
|
||||
template<class Form, class Cmpt, int nCmpt, class Type> \
|
||||
tmp<Field<typename product<Form, Type>::type>> \
|
||||
operator Op(const VectorSpace<Form,Cmpt,nCmpt>&vs,const tmp<Field<Type>>&tf1);
|
||||
|
||||
PRODUCT_OPERATOR(typeOfSum, +, add)
|
||||
|
||||
@ -28,372 +28,372 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define UNARY_FUNCTION(ReturnType, Type, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func(Field<ReturnType>& res, const UList<Type>& f) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_FUNC_F(ReturnType, res, =, ::Foam::Func, Type, f) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func(const UList<Type>& f) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f.size())); \
|
||||
Func(tRes(), f); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func(const tmp<Field<Type>>& tf) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type>::New(tf); \
|
||||
Func(tRes(), tf()); \
|
||||
reuseTmp<ReturnType, Type>::clear(tf); \
|
||||
return tRes; \
|
||||
#define UNARY_FUNCTION(ReturnType, Type, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func(Field<ReturnType>& res, const UList<Type>& f) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_FUNC_F(ReturnType, res, =, ::Foam::Func, Type, f) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func(const UList<Type>& f) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f.size())); \
|
||||
Func(tRes(), f); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func(const tmp<Field<Type>>& tf) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type>::New(tf); \
|
||||
Func(tRes(), tf()); \
|
||||
reuseTmp<ReturnType, Type>::clear(tf); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define UNARY_OPERATOR(ReturnType, Type, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc(Field<ReturnType>& res, const UList<Type>& f) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_OP_F(ReturnType, res, =, Op, Type, f) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op(const UList<Type>& f) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f.size())); \
|
||||
OpFunc(tRes(), f); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op(const tmp<Field<Type>>& tf) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type>::New(tf); \
|
||||
OpFunc(tRes(), tf()); \
|
||||
reuseTmp<ReturnType, Type>::clear(tf); \
|
||||
return tRes; \
|
||||
#define UNARY_OPERATOR(ReturnType, Type, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc(Field<ReturnType>& res, const UList<Type>& f) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_OP_F(ReturnType, res, =, Op, Type, f) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op(const UList<Type>& f) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f.size())); \
|
||||
OpFunc(tRes(), f); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op(const tmp<Field<Type>>& tf) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type>::New(tf); \
|
||||
OpFunc(tRes(), tf()); \
|
||||
reuseTmp<ReturnType, Type>::clear(tf); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
Field<ReturnType>& res, \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_FUNC_F_F \
|
||||
( \
|
||||
ReturnType, res, =, ::Foam::Func, Type1, f1, Type2, f2 \
|
||||
) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f1.size())); \
|
||||
Func(tRes(), f1, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type2>::New(tf2); \
|
||||
Func(tRes(), f1, tf2()); \
|
||||
reuseTmp<ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type1>::New(tf1); \
|
||||
Func(tRes(), tf1(), f2); \
|
||||
reuseTmp<ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = \
|
||||
reuseTmpTmp<ReturnType, Type1, Type1, Type2>::New(tf1, tf2); \
|
||||
Func(tRes(), tf1(), tf2()); \
|
||||
reuseTmpTmp<ReturnType, Type1, Type1, Type2>::clear(tf1, tf2); \
|
||||
return tRes; \
|
||||
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
Field<ReturnType>& res, \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_FUNC_F_F \
|
||||
( \
|
||||
ReturnType, res, =, ::Foam::Func, Type1, f1, Type2, f2 \
|
||||
) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f1.size())); \
|
||||
Func(tRes(), f1, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type2>::New(tf2); \
|
||||
Func(tRes(), f1, tf2()); \
|
||||
reuseTmp<ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type1>::New(tf1); \
|
||||
Func(tRes(), tf1(), f2); \
|
||||
reuseTmp<ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = \
|
||||
reuseTmpTmp<ReturnType, Type1, Type1, Type2>::New(tf1, tf2); \
|
||||
Func(tRes(), tf1(), tf2()); \
|
||||
reuseTmpTmp<ReturnType, Type1, Type1, Type2>::clear(tf1, tf2); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
Field<ReturnType>& res, \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_FUNC_S_F \
|
||||
( \
|
||||
ReturnType, res, =, ::Foam::Func, Type1, s1, Type2, f2 \
|
||||
) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f2.size())); \
|
||||
Func(tRes(), s1, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type2>::New(tf2); \
|
||||
Func(tRes(), s1, tf2()); \
|
||||
reuseTmp<ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
#define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
Field<ReturnType>& res, \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_FUNC_S_F \
|
||||
( \
|
||||
ReturnType, res, =, ::Foam::Func, Type1, s1, Type2, f2 \
|
||||
) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f2.size())); \
|
||||
Func(tRes(), s1, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type2>::New(tf2); \
|
||||
Func(tRes(), s1, tf2()); \
|
||||
reuseTmp<ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
Field<ReturnType>& res, \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_FUNC_F_S \
|
||||
( \
|
||||
ReturnType, res, =, ::Foam::Func, Type1, f1, Type2, s2 \
|
||||
) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f1.size())); \
|
||||
Func(tRes(), f1, s2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const Type2& s2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type1>::New(tf1); \
|
||||
Func(tRes(), tf1(), s2); \
|
||||
reuseTmp<ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
Field<ReturnType>& res, \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_FUNC_F_S \
|
||||
( \
|
||||
ReturnType, res, =, ::Foam::Func, Type1, f1, Type2, s2 \
|
||||
) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f1.size())); \
|
||||
Func(tRes(), f1, s2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const Type2& s2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type1>::New(tf1); \
|
||||
Func(tRes(), tf1(), s2); \
|
||||
reuseTmp<ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<ReturnType>& res, \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_F_OP_F(ReturnType, res, =, Type1, f1, Op, Type2, f2) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f1.size())); \
|
||||
OpFunc(tRes(), f1, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type2>::New(tf2); \
|
||||
OpFunc(tRes(), f1, tf2()); \
|
||||
reuseTmp<ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type1>::New(tf1); \
|
||||
OpFunc(tRes(), tf1(), f2); \
|
||||
reuseTmp<ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = \
|
||||
reuseTmpTmp<ReturnType, Type1, Type1, Type2>::New(tf1, tf2); \
|
||||
OpFunc(tRes(), tf1(), tf2()); \
|
||||
reuseTmpTmp<ReturnType, Type1, Type1, Type2>::clear(tf1, tf2); \
|
||||
return tRes; \
|
||||
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<ReturnType>& res, \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_F_OP_F(ReturnType, res, =, Type1, f1, Op, Type2, f2) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f1.size())); \
|
||||
OpFunc(tRes(), f1, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type2>::New(tf2); \
|
||||
OpFunc(tRes(), f1, tf2()); \
|
||||
reuseTmp<ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type1>::New(tf1); \
|
||||
OpFunc(tRes(), tf1(), f2); \
|
||||
reuseTmp<ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = \
|
||||
reuseTmpTmp<ReturnType, Type1, Type1, Type2>::New(tf1, tf2); \
|
||||
OpFunc(tRes(), tf1(), tf2()); \
|
||||
reuseTmpTmp<ReturnType, Type1, Type1, Type2>::clear(tf1, tf2); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<ReturnType>& res, \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_S_OP_F(ReturnType, res, =, Type1, s1, Op, Type2, f2) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f2.size())); \
|
||||
OpFunc(tRes(), s1, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type2>::New(tf2); \
|
||||
OpFunc(tRes(), s1, tf2()); \
|
||||
reuseTmp<ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<ReturnType>& res, \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_S_OP_F(ReturnType, res, =, Type1, s1, Op, Type2, f2) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f2.size())); \
|
||||
OpFunc(tRes(), s1, f2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type2>::New(tf2); \
|
||||
OpFunc(tRes(), s1, tf2()); \
|
||||
reuseTmp<ReturnType, Type2>::clear(tf2); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<ReturnType>& res, \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_F_OP_S(ReturnType, res, =, Type1, f1, Op, Type2, s2) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f1.size())); \
|
||||
OpFunc(tRes(), f1, s2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const Type2& s2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type1>::New(tf1); \
|
||||
OpFunc(tRes(), tf1(), s2); \
|
||||
reuseTmp<ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<ReturnType>& res, \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_F_OP_S(ReturnType, res, =, Type1, f1, Op, Type2, s2) \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes(new Field<ReturnType>(f1.size())); \
|
||||
OpFunc(tRes(), f1, s2); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const Type2& s2 \
|
||||
) \
|
||||
{ \
|
||||
tmp<Field<ReturnType>> tRes = reuseTmp<ReturnType, Type1>::New(tf1); \
|
||||
OpFunc(tRes(), tf1(), s2); \
|
||||
reuseTmp<ReturnType, Type1>::clear(tf1); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
|
||||
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpFunc)
|
||||
|
||||
|
||||
|
||||
@ -30,221 +30,221 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define UNARY_FUNCTION(ReturnType, Type1, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func(Field<ReturnType>& res, const UList<Type1>& f); \
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func(const UList<Type1>& f); \
|
||||
TEMPLATE \
|
||||
#define UNARY_FUNCTION(ReturnType, Type1, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func(Field<ReturnType>& res, const UList<Type1>& f); \
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func(const UList<Type1>& f); \
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func(const tmp<Field<Type1>>& tf);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc(Field<ReturnType>& res, const UList<Type1>& f); \
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op(const UList<Type1>& f); \
|
||||
TEMPLATE \
|
||||
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc(Field<ReturnType>& res, const UList<Type1>& f); \
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op(const UList<Type1>& f); \
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op(const tmp<Field<Type1>>& tf);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
Field<ReturnType>& f, \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
Field<ReturnType>& f, \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
Field<ReturnType>& f, \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
#define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
Field<ReturnType>& f, \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
Field<ReturnType>& f, \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const Type2& s2 \
|
||||
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void Func \
|
||||
( \
|
||||
Field<ReturnType>& f, \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> Func \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const Type2& s2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<ReturnType>& f, \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<ReturnType>& f, \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<ReturnType>& f, \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<ReturnType>& f, \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const UList<Type2>& f2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const Type1& s1, \
|
||||
const tmp<Field<Type2>>& tf2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<ReturnType>& f, \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const Type2& s2 \
|
||||
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
void OpFunc \
|
||||
( \
|
||||
Field<ReturnType>& f, \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const UList<Type1>& f1, \
|
||||
const Type2& s2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<Field<ReturnType>> operator Op \
|
||||
( \
|
||||
const tmp<Field<Type1>>& tf1, \
|
||||
const Type2& s2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpFunc)
|
||||
|
||||
|
||||
|
||||
@ -109,250 +109,250 @@ void checkFields
|
||||
|
||||
// member function : this f1 OP fUNC f2
|
||||
|
||||
#define TFOR_ALL_F_OP_FUNC_F(typeF1, f1, OP, FUNC, typeF2, f2) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP " " #FUNC "(f2)"); \
|
||||
\
|
||||
/* set access to f1, f2 and f3 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP FUNC(List_ELEM(f2, f2P, i)); \
|
||||
List_END_FOR_ALL \
|
||||
#define TFOR_ALL_F_OP_FUNC_F(typeF1, f1, OP, FUNC, typeF2, f2) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP " " #FUNC "(f2)"); \
|
||||
\
|
||||
/* set access to f1, f2 and f3 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP FUNC(List_ELEM(f2, f2P, i)); \
|
||||
List_END_FOR_ALL \
|
||||
|
||||
|
||||
#define TFOR_ALL_F_OP_F_FUNC(typeF1, f1, OP, typeF2, f2, FUNC) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP " f2" #FUNC); \
|
||||
\
|
||||
/* set access to f1, f2 and f3 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP List_ELEM(f2, f2P, i).FUNC(); \
|
||||
List_END_FOR_ALL \
|
||||
#define TFOR_ALL_F_OP_F_FUNC(typeF1, f1, OP, typeF2, f2, FUNC) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP " f2" #FUNC); \
|
||||
\
|
||||
/* set access to f1, f2 and f3 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP List_ELEM(f2, f2P, i).FUNC(); \
|
||||
List_END_FOR_ALL \
|
||||
|
||||
|
||||
// member function : this field f1 OP fUNC f2, f3
|
||||
|
||||
#define TFOR_ALL_F_OP_FUNC_F_F(typeF1, f1, OP, FUNC, typeF2, f2, typeF3, f3)\
|
||||
\
|
||||
/* check the three fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, f3, "f1 " #OP " " #FUNC "(f2, f3)"); \
|
||||
\
|
||||
/* set access to f1, f2 and f3 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
List_CONST_ACCESS(typeF3, f3, f3P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) \
|
||||
OP FUNC(List_ELEM(f2, f2P, i), List_ELEM(f3, f3P, i)); \
|
||||
List_END_FOR_ALL \
|
||||
\
|
||||
/* check the three fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, f3, "f1 " #OP " " #FUNC "(f2, f3)"); \
|
||||
\
|
||||
/* set access to f1, f2 and f3 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
List_CONST_ACCESS(typeF3, f3, f3P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) \
|
||||
OP FUNC(List_ELEM(f2, f2P, i), List_ELEM(f3, f3P, i)); \
|
||||
List_END_FOR_ALL \
|
||||
|
||||
|
||||
// member function : this field f1 OP fUNC f2, f3
|
||||
|
||||
#define TFOR_ALL_S_OP_FUNC_F_F(typeS, s, OP, FUNC, typeF1, f1, typeF2, f2) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "s " #OP " " #FUNC "(f1, f2)"); \
|
||||
\
|
||||
/* set access to f1 and f2 at end of each field */ \
|
||||
List_CONST_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing s OP FUNC(f1, f2) */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
(s) OP FUNC(List_ELEM(f1, f1P, i), List_ELEM(f2, f2P, i)); \
|
||||
List_END_FOR_ALL \
|
||||
#define TFOR_ALL_S_OP_FUNC_F_F(typeS, s, OP, FUNC, typeF1, f1, typeF2, f2) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "s " #OP " " #FUNC "(f1, f2)"); \
|
||||
\
|
||||
/* set access to f1 and f2 at end of each field */ \
|
||||
List_CONST_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing s OP FUNC(f1, f2) */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
(s) OP FUNC(List_ELEM(f1, f1P, i), List_ELEM(f2, f2P, i)); \
|
||||
List_END_FOR_ALL \
|
||||
|
||||
|
||||
// member function : this f1 OP fUNC f2, s
|
||||
|
||||
#define TFOR_ALL_F_OP_FUNC_F_S(typeF1, f1, OP, FUNC, typeF2, f2, typeS, s) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP " " #FUNC "(f2, s)"); \
|
||||
\
|
||||
/* set access to f1, f2 and f3 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP FUNC(List_ELEM(f2, f2P, i), (s)); \
|
||||
#define TFOR_ALL_F_OP_FUNC_F_S(typeF1, f1, OP, FUNC, typeF2, f2, typeS, s) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP " " #FUNC "(f2, s)"); \
|
||||
\
|
||||
/* set access to f1, f2 and f3 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP FUNC(List_ELEM(f2, f2P, i), (s)); \
|
||||
List_END_FOR_ALL
|
||||
|
||||
|
||||
// member function : s1 OP fUNC f, s2
|
||||
|
||||
#define TFOR_ALL_S_OP_FUNC_F_S(typeS1, s1, OP, FUNC, typeF, f, typeS2, s2) \
|
||||
\
|
||||
/* set access to f at end of field */ \
|
||||
List_CONST_ACCESS(typeF, f, fP); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f, i) \
|
||||
(s1) OP FUNC(List_ELEM(f, fP, i), (s2)); \
|
||||
List_END_FOR_ALL \
|
||||
#define TFOR_ALL_S_OP_FUNC_F_S(typeS1, s1, OP, FUNC, typeF, f, typeS2, s2) \
|
||||
\
|
||||
/* set access to f at end of field */ \
|
||||
List_CONST_ACCESS(typeF, f, fP); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f, i) \
|
||||
(s1) OP FUNC(List_ELEM(f, fP, i), (s2)); \
|
||||
List_END_FOR_ALL \
|
||||
|
||||
|
||||
// member function : this f1 OP fUNC s, f2
|
||||
|
||||
#define TFOR_ALL_F_OP_FUNC_S_F(typeF1, f1, OP, FUNC, typeS, s, typeF2, f2) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP " " #FUNC "(s, f2)"); \
|
||||
\
|
||||
/* set access to f1, f2 and f3 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP FUNC((s), List_ELEM(f2, f2P, i)); \
|
||||
List_END_FOR_ALL \
|
||||
#define TFOR_ALL_F_OP_FUNC_S_F(typeF1, f1, OP, FUNC, typeS, s, typeF2, f2) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP " " #FUNC "(s, f2)"); \
|
||||
\
|
||||
/* set access to f1, f2 and f3 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP FUNC((s), List_ELEM(f2, f2P, i)); \
|
||||
List_END_FOR_ALL \
|
||||
|
||||
|
||||
// member function : this f1 OP fUNC s, f2
|
||||
|
||||
#define TFOR_ALL_F_OP_FUNC_S_S(typeF1, f1, OP, FUNC, typeS1, s1, typeS2, s2)\
|
||||
\
|
||||
/* set access to f1 at end of field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 FUNC(s1, s2) */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP FUNC((s1), (s2)); \
|
||||
List_END_FOR_ALL \
|
||||
\
|
||||
/* set access to f1 at end of field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 FUNC(s1, s2) */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP FUNC((s1), (s2)); \
|
||||
List_END_FOR_ALL \
|
||||
|
||||
|
||||
// member function : this f1 OP1 f2 OP2 FUNC s
|
||||
|
||||
#define TFOR_ALL_F_OP_F_FUNC_S(typeF1, f1, OP, typeF2, f2, FUNC, typeS, s) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP " f2 " #FUNC "(s)"); \
|
||||
\
|
||||
/* set access to f1, f2 and f3 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP List_ELEM(f2, f2P, i) FUNC((s)); \
|
||||
List_END_FOR_ALL \
|
||||
#define TFOR_ALL_F_OP_F_FUNC_S(typeF1, f1, OP, typeF2, f2, FUNC, typeS, s) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP " f2 " #FUNC "(s)"); \
|
||||
\
|
||||
/* set access to f1, f2 and f3 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP List_ELEM(f2, f2P, i) FUNC((s)); \
|
||||
List_END_FOR_ALL \
|
||||
|
||||
|
||||
// define high performance macro functions for Field<Type> operations
|
||||
|
||||
// member operator : this field f1 OP1 f2 OP2 f3
|
||||
|
||||
#define TFOR_ALL_F_OP_F_OP_F(typeF1, f1, OP1, typeF2, f2, OP2, typeF3, f3) \
|
||||
\
|
||||
/* check the three fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, f3, "f1 " #OP1 " f2 " #OP2 " f3"); \
|
||||
\
|
||||
/* set access to f1, f2 and f3 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
List_CONST_ACCESS(typeF3, f3, f3P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP1 List_ELEM(f2, f2P, i) \
|
||||
OP2 List_ELEM(f3, f3P, i); \
|
||||
List_END_FOR_ALL \
|
||||
#define TFOR_ALL_F_OP_F_OP_F(typeF1, f1, OP1, typeF2, f2, OP2, typeF3, f3) \
|
||||
\
|
||||
/* check the three fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, f3, "f1 " #OP1 " f2 " #OP2 " f3"); \
|
||||
\
|
||||
/* set access to f1, f2 and f3 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
List_CONST_ACCESS(typeF3, f3, f3P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 f2 OP2 f3 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP1 List_ELEM(f2, f2P, i) \
|
||||
OP2 List_ELEM(f3, f3P, i); \
|
||||
List_END_FOR_ALL \
|
||||
|
||||
|
||||
// member operator : this field f1 OP1 s OP2 f2
|
||||
|
||||
#define TFOR_ALL_F_OP_S_OP_F(typeF1, f1, OP1, typeS, s, OP2, typeF2, f2) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP1 " s " #OP2 " f2"); \
|
||||
\
|
||||
/* set access to f1 and f2 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 s OP2 f2 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP1 (s) OP2 List_ELEM(f2, f2P, i); \
|
||||
List_END_FOR_ALL \
|
||||
#define TFOR_ALL_F_OP_S_OP_F(typeF1, f1, OP1, typeS, s, OP2, typeF2, f2) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP1 " s " #OP2 " f2"); \
|
||||
\
|
||||
/* set access to f1 and f2 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 s OP2 f2 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP1 (s) OP2 List_ELEM(f2, f2P, i); \
|
||||
List_END_FOR_ALL \
|
||||
|
||||
|
||||
// member operator : this field f1 OP1 f2 OP2 s
|
||||
|
||||
#define TFOR_ALL_F_OP_F_OP_S(typeF1, f1, OP1, typeF2, f2, OP2, typeS, s) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP1 " f2 " #OP2 " s"); \
|
||||
\
|
||||
/* set access to f1 and f2 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 s OP2 f2 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP1 List_ELEM(f2, f2P, i) OP2 (s); \
|
||||
List_END_FOR_ALL \
|
||||
#define TFOR_ALL_F_OP_F_OP_S(typeF1, f1, OP1, typeF2, f2, OP2, typeS, s) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP1 " f2 " #OP2 " s"); \
|
||||
\
|
||||
/* set access to f1 and f2 at end of each field */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 s OP2 f2 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP1 List_ELEM(f2, f2P, i) OP2 (s); \
|
||||
List_END_FOR_ALL \
|
||||
|
||||
|
||||
// member operator : this field f1 OP f2
|
||||
|
||||
#define TFOR_ALL_F_OP_F(typeF1, f1, OP, typeF2, f2) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP " f2"); \
|
||||
\
|
||||
/* set pointer to f1P at end of f1 and */ \
|
||||
/* f2.p at end of f2 */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP f2 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP List_ELEM(f2, f2P, i); \
|
||||
List_END_FOR_ALL \
|
||||
#define TFOR_ALL_F_OP_F(typeF1, f1, OP, typeF2, f2) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, "f1 " #OP " f2"); \
|
||||
\
|
||||
/* set pointer to f1P at end of f1 and */ \
|
||||
/* f2.p at end of f2 */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP f2 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP List_ELEM(f2, f2P, i); \
|
||||
List_END_FOR_ALL \
|
||||
|
||||
// member operator : this field f1 OP1 OP2 f2
|
||||
|
||||
#define TFOR_ALL_F_OP_OP_F(typeF1, f1, OP1, OP2, typeF2, f2) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, #OP1 " " #OP2 " f2"); \
|
||||
\
|
||||
/* set pointer to f1P at end of f1 and */ \
|
||||
/* f2.p at end of f2 */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 OP2 f2 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP1 OP2 List_ELEM(f2, f2P, i); \
|
||||
List_END_FOR_ALL \
|
||||
#define TFOR_ALL_F_OP_OP_F(typeF1, f1, OP1, OP2, typeF2, f2) \
|
||||
\
|
||||
/* check the two fields have same Field<Type> mesh */ \
|
||||
checkFields(f1, f2, #OP1 " " #OP2 " f2"); \
|
||||
\
|
||||
/* set pointer to f1P at end of f1 and */ \
|
||||
/* f2.p at end of f2 */ \
|
||||
List_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through fields performing f1 OP1 OP2 f2 */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
List_ELEM(f1, f1P, i) OP1 OP2 List_ELEM(f2, f2P, i); \
|
||||
List_END_FOR_ALL \
|
||||
|
||||
|
||||
// member operator : this field f OP s
|
||||
|
||||
#define TFOR_ALL_F_OP_S(typeF, f, OP, typeS, s) \
|
||||
\
|
||||
/* set access to f at end of field */ \
|
||||
List_ACCESS(typeF, f, fP); \
|
||||
\
|
||||
/* loop through field performing f OP s */ \
|
||||
List_FOR_ALL(f, i) \
|
||||
List_ELEM(f, fP, i) OP (s); \
|
||||
List_END_FOR_ALL \
|
||||
#define TFOR_ALL_F_OP_S(typeF, f, OP, typeS, s) \
|
||||
\
|
||||
/* set access to f at end of field */ \
|
||||
List_ACCESS(typeF, f, fP); \
|
||||
\
|
||||
/* loop through field performing f OP s */ \
|
||||
List_FOR_ALL(f, i) \
|
||||
List_ELEM(f, fP, i) OP (s); \
|
||||
List_END_FOR_ALL \
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -360,41 +360,41 @@ void checkFields
|
||||
|
||||
// friend operator function : s OP f, allocates storage for s
|
||||
|
||||
#define TFOR_ALL_S_OP_F(typeS, s, OP, typeF, f) \
|
||||
\
|
||||
/* set access to f at end of field */ \
|
||||
List_CONST_ACCESS(typeF, f, fP); \
|
||||
\
|
||||
/* loop through field performing s OP f */ \
|
||||
List_FOR_ALL(f, i) \
|
||||
(s) OP List_ELEM(f, fP, i); \
|
||||
#define TFOR_ALL_S_OP_F(typeS, s, OP, typeF, f) \
|
||||
\
|
||||
/* set access to f at end of field */ \
|
||||
List_CONST_ACCESS(typeF, f, fP); \
|
||||
\
|
||||
/* loop through field performing s OP f */ \
|
||||
List_FOR_ALL(f, i) \
|
||||
(s) OP List_ELEM(f, fP, i); \
|
||||
List_END_FOR_ALL
|
||||
|
||||
|
||||
// friend operator function : s OP1 f1 OP2 f2, allocates storage for s
|
||||
|
||||
#define TFOR_ALL_S_OP_F_OP_F(typeS, s, OP1, typeF1, f1, OP2, typeF2, f2) \
|
||||
\
|
||||
/* set access to f1 and f2 at end of each field */ \
|
||||
List_CONST_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through field performing s OP f */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
(s) OP1 List_ELEM(f1, f1P, i) OP2 List_ELEM(f2, f2P, i); \
|
||||
#define TFOR_ALL_S_OP_F_OP_F(typeS, s, OP1, typeF1, f1, OP2, typeF2, f2) \
|
||||
\
|
||||
/* set access to f1 and f2 at end of each field */ \
|
||||
List_CONST_ACCESS(typeF1, f1, f1P); \
|
||||
List_CONST_ACCESS(typeF2, f2, f2P); \
|
||||
\
|
||||
/* loop through field performing s OP f */ \
|
||||
List_FOR_ALL(f1, i) \
|
||||
(s) OP1 List_ELEM(f1, f1P, i) OP2 List_ELEM(f2, f2P, i); \
|
||||
List_END_FOR_ALL
|
||||
|
||||
|
||||
// friend operator function : s OP FUNC(f), allocates storage for s
|
||||
|
||||
#define TFOR_ALL_S_OP_FUNC_F(typeS, s, OP, FUNC, typeF, f) \
|
||||
\
|
||||
/* set access to f at end of field */ \
|
||||
List_CONST_ACCESS(typeF, f, fP); \
|
||||
\
|
||||
/* loop through field performing s OP f */ \
|
||||
List_FOR_ALL(f, i) \
|
||||
(s) OP FUNC(List_ELEM(f, fP, i)); \
|
||||
#define TFOR_ALL_S_OP_FUNC_F(typeS, s, OP, FUNC, typeF, f) \
|
||||
\
|
||||
/* set access to f at end of field */ \
|
||||
List_CONST_ACCESS(typeF, f, fP); \
|
||||
\
|
||||
/* loop through field performing s OP f */ \
|
||||
List_FOR_ALL(f, i) \
|
||||
(s) OP FUNC(List_ELEM(f, fP, i)); \
|
||||
List_END_FOR_ALL
|
||||
|
||||
|
||||
|
||||
@ -164,25 +164,25 @@ UNARY_FUNCTION(scalar, scalar, atmToPa)
|
||||
UNARY_FUNCTION(scalar, scalar, paToAtm)
|
||||
|
||||
|
||||
#define BesselFunc(func) \
|
||||
void func(scalarField& res, const int n, const UList<scalar>& sf) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_FUNC_S_F(scalar, res, =, ::Foam::func, int, n, scalar, sf) \
|
||||
} \
|
||||
\
|
||||
tmp<scalarField> func(const int n, const UList<scalar>& sf) \
|
||||
{ \
|
||||
tmp<scalarField> tRes(new scalarField(sf.size())); \
|
||||
func(tRes(), n, sf); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
tmp<scalarField> func(const int n, const tmp<scalarField>& tsf) \
|
||||
{ \
|
||||
tmp<scalarField> tRes = reuseTmp<scalar, scalar>::New(tsf); \
|
||||
func(tRes(), n, tsf()); \
|
||||
reuseTmp<scalar, scalar>::clear(tsf); \
|
||||
return tRes; \
|
||||
#define BesselFunc(func) \
|
||||
void func(scalarField& res, const int n, const UList<scalar>& sf) \
|
||||
{ \
|
||||
TFOR_ALL_F_OP_FUNC_S_F(scalar, res, =, ::Foam::func, int, n, scalar, sf) \
|
||||
} \
|
||||
\
|
||||
tmp<scalarField> func(const int n, const UList<scalar>& sf) \
|
||||
{ \
|
||||
tmp<scalarField> tRes(new scalarField(sf.size())); \
|
||||
func(tRes(), n, sf); \
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
tmp<scalarField> func(const int n, const tmp<scalarField>& tsf) \
|
||||
{ \
|
||||
tmp<scalarField> tRes = reuseTmp<scalar, scalar>::New(tsf); \
|
||||
func(tRes(), n, tsf()); \
|
||||
reuseTmp<scalar, scalar>::clear(tsf); \
|
||||
return tRes; \
|
||||
}
|
||||
|
||||
BesselFunc(jn)
|
||||
|
||||
@ -1162,38 +1162,38 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator==
|
||||
}
|
||||
|
||||
|
||||
#define COMPUTED_ASSIGNMENT(TYPE, op) \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
void Foam::GeometricField<Type, PatchField, GeoMesh>::operator op \
|
||||
( \
|
||||
const GeometricField<TYPE, PatchField, GeoMesh>& gf \
|
||||
) \
|
||||
{ \
|
||||
checkField(*this, gf, #op); \
|
||||
\
|
||||
dimensionedInternalField() op gf.dimensionedInternalField(); \
|
||||
boundaryField() op gf.boundaryField(); \
|
||||
} \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
void Foam::GeometricField<Type, PatchField, GeoMesh>::operator op \
|
||||
( \
|
||||
const tmp<GeometricField<TYPE, PatchField, GeoMesh>>& tgf \
|
||||
) \
|
||||
{ \
|
||||
operator op(tgf()); \
|
||||
tgf.clear(); \
|
||||
} \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
void Foam::GeometricField<Type, PatchField, GeoMesh>::operator op \
|
||||
( \
|
||||
const dimensioned<TYPE>& dt \
|
||||
) \
|
||||
{ \
|
||||
dimensionedInternalField() op dt; \
|
||||
boundaryField() op dt.value(); \
|
||||
#define COMPUTED_ASSIGNMENT(TYPE, op) \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
void Foam::GeometricField<Type, PatchField, GeoMesh>::operator op \
|
||||
( \
|
||||
const GeometricField<TYPE, PatchField, GeoMesh>& gf \
|
||||
) \
|
||||
{ \
|
||||
checkField(*this, gf, #op); \
|
||||
\
|
||||
dimensionedInternalField() op gf.dimensionedInternalField(); \
|
||||
boundaryField() op gf.boundaryField(); \
|
||||
} \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
void Foam::GeometricField<Type, PatchField, GeoMesh>::operator op \
|
||||
( \
|
||||
const tmp<GeometricField<TYPE, PatchField, GeoMesh>>& tgf \
|
||||
) \
|
||||
{ \
|
||||
operator op(tgf()); \
|
||||
tgf.clear(); \
|
||||
} \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
void Foam::GeometricField<Type, PatchField, GeoMesh>::operator op \
|
||||
( \
|
||||
const dimensioned<TYPE>& dt \
|
||||
) \
|
||||
{ \
|
||||
dimensionedInternalField() op dt; \
|
||||
boundaryField() op dt.value(); \
|
||||
}
|
||||
|
||||
COMPUTED_ASSIGNMENT(Type, +=)
|
||||
|
||||
@ -475,31 +475,31 @@ cmptAv(const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf)
|
||||
}
|
||||
|
||||
|
||||
#define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<Type> \
|
||||
( \
|
||||
#func "(" + gf.name() + ')', \
|
||||
gf.dimensions(), \
|
||||
Foam::func(gFunc(gf.internalField()), gFunc(gf.boundaryField())) \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
) \
|
||||
{ \
|
||||
dimensioned<returnType> res = func(tgf1()); \
|
||||
tgf1.clear(); \
|
||||
return res; \
|
||||
#define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<Type> \
|
||||
( \
|
||||
#func "(" + gf.name() + ')', \
|
||||
gf.dimensions(), \
|
||||
Foam::func(gFunc(gf.internalField()), gFunc(gf.boundaryField())) \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
) \
|
||||
{ \
|
||||
dimensioned<returnType> res = func(tgf1()); \
|
||||
tgf1.clear(); \
|
||||
return res; \
|
||||
}
|
||||
|
||||
UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(Type, max, gMax)
|
||||
@ -508,31 +508,31 @@ UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(Type, min, gMin)
|
||||
#undef UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY
|
||||
|
||||
|
||||
#define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc) \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<Type> \
|
||||
( \
|
||||
#func "(" + gf.name() + ')', \
|
||||
gf.dimensions(), \
|
||||
gFunc(gf.internalField()) \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
) \
|
||||
{ \
|
||||
dimensioned<returnType> res = func(tgf1()); \
|
||||
tgf1.clear(); \
|
||||
return res; \
|
||||
#define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc) \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<Type> \
|
||||
( \
|
||||
#func "(" + gf.name() + ')', \
|
||||
gf.dimensions(), \
|
||||
gFunc(gf.internalField()) \
|
||||
); \
|
||||
} \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
) \
|
||||
{ \
|
||||
dimensioned<returnType> res = func(tgf1()); \
|
||||
tgf1.clear(); \
|
||||
return res; \
|
||||
}
|
||||
|
||||
UNARY_REDUCTION_FUNCTION(Type, sum, gSum)
|
||||
@ -569,380 +569,380 @@ BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, /, '|', divide)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
void opFunc \
|
||||
( \
|
||||
GeometricField \
|
||||
<typename product<Type1, Type2>::type, PatchField, GeoMesh>& gf, \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
|
||||
) \
|
||||
{ \
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
void opFunc \
|
||||
( \
|
||||
GeometricField \
|
||||
<typename product<Type1, Type2>::type, PatchField, GeoMesh>& gf, \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
|
||||
) \
|
||||
{ \
|
||||
Foam::opFunc(gf.internalField(), gf1.internalField(), gf2.internalField());\
|
||||
Foam::opFunc(gf.boundaryField(), gf1.boundaryField(), gf2.boundaryField());\
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \
|
||||
( \
|
||||
new GeometricField<productType, PatchField, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
'(' + gf1.name() + #op + gf2.name() + ')', \
|
||||
gf1.instance(), \
|
||||
gf1.db(), \
|
||||
IOobject::NO_READ, \
|
||||
IOobject::NO_WRITE \
|
||||
), \
|
||||
gf1.mesh(), \
|
||||
gf1.dimensions() op gf2.dimensions() \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), gf1, gf2); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \
|
||||
( \
|
||||
new GeometricField<productType, PatchField, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
'(' + gf1.name() + #op + gf2.name() + ')', \
|
||||
gf1.instance(), \
|
||||
gf1.db(), \
|
||||
IOobject::NO_READ, \
|
||||
IOobject::NO_WRITE \
|
||||
), \
|
||||
gf1.mesh(), \
|
||||
gf1.dimensions() op gf2.dimensions() \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), gf1, gf2); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
\
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \
|
||||
\
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \
|
||||
reuseTmpGeometricField<productType, Type2, PatchField, GeoMesh>::New \
|
||||
( \
|
||||
tgf2, \
|
||||
'(' + gf1.name() + #op + gf2.name() + ')', \
|
||||
gf1.dimensions() op gf2.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), gf1, gf2); \
|
||||
\
|
||||
reuseTmpGeometricField<productType, Type2, PatchField, GeoMesh> \
|
||||
::clear(tgf2); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
\
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \
|
||||
\
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \
|
||||
reuseTmpGeometricField<productType, Type2, PatchField, GeoMesh>::New \
|
||||
( \
|
||||
tgf2, \
|
||||
'(' + gf1.name() + #op + gf2.name() + ')', \
|
||||
gf1.dimensions() op gf2.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), gf1, gf2); \
|
||||
\
|
||||
reuseTmpGeometricField<productType, Type2, PatchField, GeoMesh> \
|
||||
::clear(tgf2); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
\
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \
|
||||
\
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \
|
||||
reuseTmpGeometricField<productType, Type1, PatchField, GeoMesh>::New \
|
||||
( \
|
||||
tgf1, \
|
||||
'(' + gf1.name() + #op + gf2.name() + ')', \
|
||||
gf1.dimensions() op gf2.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), gf1, gf2); \
|
||||
\
|
||||
reuseTmpGeometricField<productType, Type1, PatchField, GeoMesh> \
|
||||
::clear(tgf1); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
\
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \
|
||||
\
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \
|
||||
reuseTmpGeometricField<productType, Type1, PatchField, GeoMesh>::New \
|
||||
( \
|
||||
tgf1, \
|
||||
'(' + gf1.name() + #op + gf2.name() + ')', \
|
||||
gf1.dimensions() op gf2.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), gf1, gf2); \
|
||||
\
|
||||
reuseTmpGeometricField<productType, Type1, PatchField, GeoMesh> \
|
||||
::clear(tgf1); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
\
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \
|
||||
\
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \
|
||||
reuseTmpTmpGeometricField \
|
||||
<productType, Type1, Type1, Type2, PatchField, GeoMesh>::New \
|
||||
( \
|
||||
tgf1, \
|
||||
tgf2, \
|
||||
'(' + gf1.name() + #op + gf2.name() + ')', \
|
||||
gf1.dimensions() op gf2.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), gf1, gf2); \
|
||||
\
|
||||
reuseTmpTmpGeometricField \
|
||||
<productType, Type1, Type1, Type2, PatchField, GeoMesh> \
|
||||
::clear(tgf1, tgf2); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
void opFunc \
|
||||
( \
|
||||
GeometricField \
|
||||
<typename product<Type, Form>::type, PatchField, GeoMesh>& gf, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
) \
|
||||
{ \
|
||||
Foam::opFunc(gf.internalField(), gf1.internalField(), dvs.value()); \
|
||||
Foam::opFunc(gf.boundaryField(), gf1.boundaryField(), dvs.value()); \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type1, Type2>::type productType; \
|
||||
\
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \
|
||||
\
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \
|
||||
reuseTmpTmpGeometricField \
|
||||
<productType, Type1, Type1, Type2, PatchField, GeoMesh>::New \
|
||||
( \
|
||||
tgf1, \
|
||||
tgf2, \
|
||||
'(' + gf1.name() + #op + gf2.name() + ')', \
|
||||
gf1.dimensions() op gf2.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), gf1, gf2); \
|
||||
\
|
||||
reuseTmpTmpGeometricField \
|
||||
<productType, Type1, Type1, Type2, PatchField, GeoMesh> \
|
||||
::clear(tgf1, tgf2); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
void opFunc \
|
||||
( \
|
||||
GeometricField \
|
||||
<typename product<Type, Form>::type, PatchField, GeoMesh>& gf, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
) \
|
||||
{ \
|
||||
Foam::opFunc(gf.internalField(), gf1.internalField(), dvs.value()); \
|
||||
Foam::opFunc(gf.boundaryField(), gf1.boundaryField(), dvs.value()); \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
tmp<GeometricField<typename product<Type, Form>::type, PatchField, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
\
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \
|
||||
( \
|
||||
new GeometricField<productType, PatchField, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
'(' + gf1.name() + #op + dvs.name() + ')', \
|
||||
gf1.instance(), \
|
||||
gf1.db(), \
|
||||
IOobject::NO_READ, \
|
||||
IOobject::NO_WRITE \
|
||||
), \
|
||||
gf1.mesh(), \
|
||||
gf1.dimensions() op dvs.dimensions() \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), gf1, dvs); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
\
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \
|
||||
( \
|
||||
new GeometricField<productType, PatchField, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
'(' + gf1.name() + #op + dvs.name() + ')', \
|
||||
gf1.instance(), \
|
||||
gf1.db(), \
|
||||
IOobject::NO_READ, \
|
||||
IOobject::NO_WRITE \
|
||||
), \
|
||||
gf1.mesh(), \
|
||||
gf1.dimensions() op dvs.dimensions() \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), gf1, dvs); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{ \
|
||||
return gf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{ \
|
||||
return gf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
tmp<GeometricField<typename product<Type, Form>::type, PatchField, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
\
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 = tgf1(); \
|
||||
\
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \
|
||||
reuseTmpGeometricField<productType, Type, PatchField, GeoMesh>::New \
|
||||
( \
|
||||
tgf1, \
|
||||
'(' + gf1.name() + #op + dvs.name() + ')', \
|
||||
gf1.dimensions() op dvs.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), gf1, dvs); \
|
||||
\
|
||||
reuseTmpGeometricField<productType, Type, PatchField, GeoMesh> \
|
||||
::clear(tgf1); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Type, Form>::type productType; \
|
||||
\
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 = tgf1(); \
|
||||
\
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \
|
||||
reuseTmpGeometricField<productType, Type, PatchField, GeoMesh>::New \
|
||||
( \
|
||||
tgf1, \
|
||||
'(' + gf1.name() + #op + dvs.name() + ')', \
|
||||
gf1.dimensions() op dvs.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), gf1, dvs); \
|
||||
\
|
||||
reuseTmpGeometricField<productType, Type, PatchField, GeoMesh> \
|
||||
::clear(tgf1); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{ \
|
||||
return tgf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
void opFunc \
|
||||
( \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh>& gf, \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 \
|
||||
) \
|
||||
{ \
|
||||
Foam::opFunc(gf.internalField(), dvs.value(), gf1.internalField()); \
|
||||
Foam::opFunc(gf.boundaryField(), dvs.value(), gf1.boundaryField()); \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{ \
|
||||
return tgf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
void opFunc \
|
||||
( \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh>& gf, \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 \
|
||||
) \
|
||||
{ \
|
||||
Foam::opFunc(gf.internalField(), dvs.value(), gf1.internalField()); \
|
||||
Foam::opFunc(gf.boundaryField(), dvs.value(), gf1.boundaryField()); \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \
|
||||
( \
|
||||
new GeometricField<productType, PatchField, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
'(' + dvs.name() + #op + gf1.name() + ')', \
|
||||
gf1.instance(), \
|
||||
gf1.db(), \
|
||||
IOobject::NO_READ, \
|
||||
IOobject::NO_WRITE \
|
||||
), \
|
||||
gf1.mesh(), \
|
||||
dvs.dimensions() op gf1.dimensions() \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), dvs, gf1); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \
|
||||
( \
|
||||
new GeometricField<productType, PatchField, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
'(' + dvs.name() + #op + gf1.name() + ')', \
|
||||
gf1.instance(), \
|
||||
gf1.db(), \
|
||||
IOobject::NO_READ, \
|
||||
IOobject::NO_WRITE \
|
||||
), \
|
||||
gf1.mesh(), \
|
||||
dvs.dimensions() op gf1.dimensions() \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), dvs, gf1); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<Form>(static_cast<const Form&>(vs)) op gf1; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<Form>(static_cast<const Form&>(vs)) op gf1; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
\
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 = tgf1(); \
|
||||
\
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \
|
||||
reuseTmpGeometricField<productType, Type, PatchField, GeoMesh>::New \
|
||||
( \
|
||||
tgf1, \
|
||||
'(' + dvs.name() + #op + gf1.name() + ')', \
|
||||
dvs.dimensions() op gf1.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), dvs, gf1); \
|
||||
\
|
||||
reuseTmpGeometricField<productType, Type, PatchField, GeoMesh> \
|
||||
::clear(tgf1); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
) \
|
||||
{ \
|
||||
typedef typename product<Form, Type>::type productType; \
|
||||
\
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 = tgf1(); \
|
||||
\
|
||||
tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \
|
||||
reuseTmpGeometricField<productType, Type, PatchField, GeoMesh>::New \
|
||||
( \
|
||||
tgf1, \
|
||||
'(' + dvs.name() + #op + gf1.name() + ')', \
|
||||
dvs.dimensions() op gf1.dimensions() \
|
||||
); \
|
||||
\
|
||||
Foam::opFunc(tRes(), dvs, gf1); \
|
||||
\
|
||||
reuseTmpGeometricField<productType, Type, PatchField, GeoMesh> \
|
||||
::clear(tgf1); \
|
||||
\
|
||||
return tRes; \
|
||||
} \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<Form>(static_cast<const Form&>(vs)) op tgf1; \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<Form>(static_cast<const Form&>(vs)) op tgf1; \
|
||||
}
|
||||
|
||||
PRODUCT_OPERATOR(typeOfSum, +, add)
|
||||
|
||||
@ -194,18 +194,18 @@ tmp
|
||||
cmptAv(const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf);
|
||||
|
||||
|
||||
#define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf \
|
||||
); \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
#define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf \
|
||||
); \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
);
|
||||
|
||||
UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(Type, max, gMax)
|
||||
@ -214,18 +214,18 @@ UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(Type, min, gMin)
|
||||
#undef UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY
|
||||
|
||||
|
||||
#define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc) \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf \
|
||||
); \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
#define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc) \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf \
|
||||
); \
|
||||
\
|
||||
template<class Type, template<class> class PatchField, class GeoMesh> \
|
||||
dimensioned<returnType> func \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
);
|
||||
|
||||
UNARY_REDUCTION_FUNCTION(Type, sum, gSum)
|
||||
@ -262,216 +262,216 @@ BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, /, '|', divide)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
void opFunc \
|
||||
( \
|
||||
GeometricField \
|
||||
<typename product<Type1, Type2>::type, PatchField, GeoMesh>& gf, \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
void opFunc \
|
||||
( \
|
||||
GeometricField \
|
||||
<typename product<Type, Form>::type, PatchField, GeoMesh>& gf, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Type, Form>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Type, Form>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
void opFunc \
|
||||
( \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh>& gf, \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
void opFunc \
|
||||
( \
|
||||
GeometricField \
|
||||
<typename product<Type1, Type2>::type, PatchField, GeoMesh>& gf, \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
void opFunc \
|
||||
( \
|
||||
GeometricField \
|
||||
<typename product<Type, Form>::type, PatchField, GeoMesh>& gf, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Type, Form>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Type, Form>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \
|
||||
const dimensioned<Form>& dvs \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
void opFunc \
|
||||
( \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh>& gf, \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const GeometricField<Type, PatchField, GeoMesh>& gf1 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
<class Form, class Type, template<class> class PatchField, class GeoMesh> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const dimensioned<Form>& dvs, \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
); \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type, template<class> class PatchField, \
|
||||
class GeoMesh \
|
||||
> \
|
||||
tmp \
|
||||
< \
|
||||
GeometricField \
|
||||
<typename product<Form, Type>::type, PatchField, GeoMesh> \
|
||||
> \
|
||||
operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \
|
||||
);
|
||||
|
||||
PRODUCT_OPERATOR(typeOfSum, +, add)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -25,239 +25,239 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1 \
|
||||
#define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1 \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define UNARY_OPERATOR(ReturnType, Type1, Op, opFunc, Dfunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1 \
|
||||
#define UNARY_OPERATOR(ReturnType, Type1, Op, opFunc, Dfunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1 \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
#define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const Type2& t2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf2, \
|
||||
const Type2& t2 \
|
||||
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const Type2& t2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf2, \
|
||||
const Type2& t2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
|
||||
BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const GeometricField<Type2, PatchField, GeoMesh>& df2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const Type1& t1, \
|
||||
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const Type2& t2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, \
|
||||
const Type2& t2 \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const GeometricField<Type1, PatchField, GeoMesh>& df1, \
|
||||
const Type2& t2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
); \
|
||||
\
|
||||
TEMPLATE \
|
||||
tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \
|
||||
( \
|
||||
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, \
|
||||
const Type2& t2 \
|
||||
);
|
||||
|
||||
|
||||
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
|
||||
BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)
|
||||
|
||||
|
||||
|
||||
@ -791,88 +791,88 @@ UNARY_FUNCTION(scalar, scalar, y1, trans)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define BesselFunc(func) \
|
||||
\
|
||||
template<template<class> class PatchField, class GeoMesh> \
|
||||
void func \
|
||||
( \
|
||||
GeometricField<scalar, PatchField, GeoMesh>& gsf, \
|
||||
const int n, \
|
||||
const GeometricField<scalar, PatchField, GeoMesh>& gsf1 \
|
||||
) \
|
||||
{ \
|
||||
func(gsf.internalField(), n, gsf1.internalField()); \
|
||||
func(gsf.boundaryField(), n, gsf1.boundaryField()); \
|
||||
} \
|
||||
\
|
||||
template<template<class> class PatchField, class GeoMesh> \
|
||||
tmp<GeometricField<scalar, PatchField, GeoMesh>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const GeometricField<scalar, PatchField, GeoMesh>& gsf \
|
||||
) \
|
||||
{ \
|
||||
if (!gsf.dimensions().dimensionless()) \
|
||||
{ \
|
||||
FatalErrorInFunction \
|
||||
<< "gsf not dimensionless" \
|
||||
<< abort(FatalError); \
|
||||
} \
|
||||
\
|
||||
tmp<GeometricField<scalar, PatchField, GeoMesh>> tFunc \
|
||||
( \
|
||||
new GeometricField<scalar, PatchField, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
#func "(" + gsf.name() + ')', \
|
||||
gsf.instance(), \
|
||||
gsf.db(), \
|
||||
IOobject::NO_READ, \
|
||||
IOobject::NO_WRITE \
|
||||
), \
|
||||
gsf.mesh(), \
|
||||
dimless \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
func(tFunc(), n, gsf); \
|
||||
\
|
||||
return tFunc; \
|
||||
} \
|
||||
\
|
||||
template<template<class> class PatchField, class GeoMesh> \
|
||||
tmp<GeometricField<scalar, PatchField, GeoMesh>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf \
|
||||
) \
|
||||
{ \
|
||||
const GeometricField<scalar, PatchField, GeoMesh>& gsf = tgsf(); \
|
||||
\
|
||||
if (!gsf.dimensions().dimensionless()) \
|
||||
{ \
|
||||
FatalErrorInFunction \
|
||||
<< " : gsf not dimensionless" \
|
||||
<< abort(FatalError); \
|
||||
} \
|
||||
\
|
||||
tmp<GeometricField<scalar, PatchField, GeoMesh>> tFunc \
|
||||
( \
|
||||
reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::New \
|
||||
( \
|
||||
tgsf, \
|
||||
#func "(" + gsf.name() + ')', \
|
||||
dimless \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
func(tFunc(), n, gsf); \
|
||||
\
|
||||
reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh> \
|
||||
::clear(tgsf); \
|
||||
\
|
||||
return tFunc; \
|
||||
#define BesselFunc(func) \
|
||||
\
|
||||
template<template<class> class PatchField, class GeoMesh> \
|
||||
void func \
|
||||
( \
|
||||
GeometricField<scalar, PatchField, GeoMesh>& gsf, \
|
||||
const int n, \
|
||||
const GeometricField<scalar, PatchField, GeoMesh>& gsf1 \
|
||||
) \
|
||||
{ \
|
||||
func(gsf.internalField(), n, gsf1.internalField()); \
|
||||
func(gsf.boundaryField(), n, gsf1.boundaryField()); \
|
||||
} \
|
||||
\
|
||||
template<template<class> class PatchField, class GeoMesh> \
|
||||
tmp<GeometricField<scalar, PatchField, GeoMesh>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const GeometricField<scalar, PatchField, GeoMesh>& gsf \
|
||||
) \
|
||||
{ \
|
||||
if (!gsf.dimensions().dimensionless()) \
|
||||
{ \
|
||||
FatalErrorInFunction \
|
||||
<< "gsf not dimensionless" \
|
||||
<< abort(FatalError); \
|
||||
} \
|
||||
\
|
||||
tmp<GeometricField<scalar, PatchField, GeoMesh>> tFunc \
|
||||
( \
|
||||
new GeometricField<scalar, PatchField, GeoMesh> \
|
||||
( \
|
||||
IOobject \
|
||||
( \
|
||||
#func "(" + gsf.name() + ')', \
|
||||
gsf.instance(), \
|
||||
gsf.db(), \
|
||||
IOobject::NO_READ, \
|
||||
IOobject::NO_WRITE \
|
||||
), \
|
||||
gsf.mesh(), \
|
||||
dimless \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
func(tFunc(), n, gsf); \
|
||||
\
|
||||
return tFunc; \
|
||||
} \
|
||||
\
|
||||
template<template<class> class PatchField, class GeoMesh> \
|
||||
tmp<GeometricField<scalar, PatchField, GeoMesh>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf \
|
||||
) \
|
||||
{ \
|
||||
const GeometricField<scalar, PatchField, GeoMesh>& gsf = tgsf(); \
|
||||
\
|
||||
if (!gsf.dimensions().dimensionless()) \
|
||||
{ \
|
||||
FatalErrorInFunction \
|
||||
<< " : gsf not dimensionless" \
|
||||
<< abort(FatalError); \
|
||||
} \
|
||||
\
|
||||
tmp<GeometricField<scalar, PatchField, GeoMesh>> tFunc \
|
||||
( \
|
||||
reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::New \
|
||||
( \
|
||||
tgsf, \
|
||||
#func "(" + gsf.name() + ')', \
|
||||
dimless \
|
||||
) \
|
||||
); \
|
||||
\
|
||||
func(tFunc(), n, gsf); \
|
||||
\
|
||||
reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh> \
|
||||
::clear(tgsf); \
|
||||
\
|
||||
return tFunc; \
|
||||
}
|
||||
|
||||
BesselFunc(jn)
|
||||
|
||||
@ -140,17 +140,17 @@ void func \
|
||||
); \
|
||||
\
|
||||
template<template<class> class PatchField, class GeoMesh> \
|
||||
tmp<GeometricField<scalar, PatchField, GeoMesh>> func \
|
||||
tmp<GeometricField<scalar, PatchField, GeoMesh>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const GeometricField<scalar, PatchField, GeoMesh>& \
|
||||
); \
|
||||
\
|
||||
template<template<class> class PatchField, class GeoMesh> \
|
||||
tmp<GeometricField<scalar, PatchField, GeoMesh>> func \
|
||||
tmp<GeometricField<scalar, PatchField, GeoMesh>> func \
|
||||
( \
|
||||
const int n, \
|
||||
const tmp<GeometricField<scalar, PatchField, GeoMesh>>& \
|
||||
const tmp<GeometricField<scalar, PatchField, GeoMesh>>& \
|
||||
);
|
||||
|
||||
BesselFunc(jn)
|
||||
|
||||
@ -528,82 +528,82 @@ const pointPatchField<Type>& operator+
|
||||
|
||||
|
||||
#define addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
pointPatch \
|
||||
); \
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
patchMapper \
|
||||
); \
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
dictionary \
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
pointPatch \
|
||||
); \
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
patchMapper \
|
||||
); \
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
dictionary \
|
||||
);
|
||||
|
||||
|
||||
// for non-templated patch fields
|
||||
#define makePointPatchTypeField(PatchTypeField,typePatchTypeField) \
|
||||
defineTypeNameAndDebug(typePatchTypeField, 0); \
|
||||
#define makePointPatchTypeField(PatchTypeField,typePatchTypeField) \
|
||||
defineTypeNameAndDebug(typePatchTypeField, 0); \
|
||||
addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField)
|
||||
|
||||
|
||||
// for templated patch fields
|
||||
#define makeTemplatePointPatchTypeField(PatchTypeField, typePatchTypeField) \
|
||||
defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
|
||||
#define makeTemplatePointPatchTypeField(PatchTypeField, typePatchTypeField) \
|
||||
defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
|
||||
addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField)
|
||||
|
||||
|
||||
#define makePointPatchFields(type) \
|
||||
makeTemplatePointPatchTypeField \
|
||||
( \
|
||||
pointPatchScalarField, \
|
||||
type##PointPatchScalarField \
|
||||
); \
|
||||
makeTemplatePointPatchTypeField \
|
||||
( \
|
||||
pointPatchVectorField, \
|
||||
type##PointPatchVectorField \
|
||||
); \
|
||||
makeTemplatePointPatchTypeField \
|
||||
( \
|
||||
pointPatchSphericalTensorField, \
|
||||
type##PointPatchSphericalTensorField \
|
||||
); \
|
||||
makeTemplatePointPatchTypeField \
|
||||
( \
|
||||
pointPatchSymmTensorField, \
|
||||
type##PointPatchSymmTensorField \
|
||||
); \
|
||||
makeTemplatePointPatchTypeField \
|
||||
( \
|
||||
pointPatchTensorField, \
|
||||
type##PointPatchTensorField \
|
||||
#define makePointPatchFields(type) \
|
||||
makeTemplatePointPatchTypeField \
|
||||
( \
|
||||
pointPatchScalarField, \
|
||||
type##PointPatchScalarField \
|
||||
); \
|
||||
makeTemplatePointPatchTypeField \
|
||||
( \
|
||||
pointPatchVectorField, \
|
||||
type##PointPatchVectorField \
|
||||
); \
|
||||
makeTemplatePointPatchTypeField \
|
||||
( \
|
||||
pointPatchSphericalTensorField, \
|
||||
type##PointPatchSphericalTensorField \
|
||||
); \
|
||||
makeTemplatePointPatchTypeField \
|
||||
( \
|
||||
pointPatchSymmTensorField, \
|
||||
type##PointPatchSymmTensorField \
|
||||
); \
|
||||
makeTemplatePointPatchTypeField \
|
||||
( \
|
||||
pointPatchTensorField, \
|
||||
type##PointPatchTensorField \
|
||||
);
|
||||
|
||||
|
||||
#define makePointPatchFieldsTypeName(type) \
|
||||
defineNamedTemplateTypeNameAndDebug(type##PointPatchScalarField, 0); \
|
||||
defineNamedTemplateTypeNameAndDebug(type##PointPatchVectorField, 0); \
|
||||
defineNamedTemplateTypeNameAndDebug \
|
||||
( \
|
||||
type##PointPatchSphericalTensorField, 0 \
|
||||
); \
|
||||
defineNamedTemplateTypeNameAndDebug(type##PointPatchSymmTensorField, 0); \
|
||||
#define makePointPatchFieldsTypeName(type) \
|
||||
defineNamedTemplateTypeNameAndDebug(type##PointPatchScalarField, 0); \
|
||||
defineNamedTemplateTypeNameAndDebug(type##PointPatchVectorField, 0); \
|
||||
defineNamedTemplateTypeNameAndDebug \
|
||||
( \
|
||||
type##PointPatchSphericalTensorField, 0 \
|
||||
); \
|
||||
defineNamedTemplateTypeNameAndDebug(type##PointPatchSymmTensorField, 0); \
|
||||
defineNamedTemplateTypeNameAndDebug(type##PointPatchTensorField, 0)
|
||||
|
||||
|
||||
#define makePointPatchFieldTypedefs(type) \
|
||||
typedef type##PointPatchField<scalar> type##PointPatchScalarField; \
|
||||
typedef type##PointPatchField<vector> type##PointPatchVectorField; \
|
||||
typedef type##PointPatchField<sphericalTensor> \
|
||||
type##PointPatchSphericalTensorField; \
|
||||
#define makePointPatchFieldTypedefs(type) \
|
||||
typedef type##PointPatchField<scalar> type##PointPatchScalarField; \
|
||||
typedef type##PointPatchField<vector> type##PointPatchVectorField; \
|
||||
typedef type##PointPatchField<sphericalTensor> \
|
||||
type##PointPatchSphericalTensorField; \
|
||||
typedef type##PointPatchField<symmTensor> type##PointPatchSymmTensorField;\
|
||||
typedef type##PointPatchField<tensor> type##PointPatchTensorField;
|
||||
|
||||
|
||||
@ -101,24 +101,24 @@ inline void cmptMag
|
||||
{}
|
||||
|
||||
|
||||
#define BINARY_FUNCTION(func) \
|
||||
\
|
||||
template<class Type> \
|
||||
inline void func \
|
||||
( \
|
||||
pointPatchField<Type>& f, \
|
||||
const pointPatchField<Type>& f1, \
|
||||
const pointPatchField<Type>& f2 \
|
||||
) \
|
||||
{} \
|
||||
\
|
||||
template<class Type> \
|
||||
inline void func \
|
||||
( \
|
||||
pointPatchField<Type>& f, \
|
||||
const pointPatchField<Type>& f1, \
|
||||
const Type& s \
|
||||
) \
|
||||
#define BINARY_FUNCTION(func) \
|
||||
\
|
||||
template<class Type> \
|
||||
inline void func \
|
||||
( \
|
||||
pointPatchField<Type>& f, \
|
||||
const pointPatchField<Type>& f1, \
|
||||
const pointPatchField<Type>& f2 \
|
||||
) \
|
||||
{} \
|
||||
\
|
||||
template<class Type> \
|
||||
inline void func \
|
||||
( \
|
||||
pointPatchField<Type>& f, \
|
||||
const pointPatchField<Type>& f1, \
|
||||
const Type& s \
|
||||
) \
|
||||
{}
|
||||
|
||||
BINARY_FUNCTION(max)
|
||||
@ -129,54 +129,54 @@ BINARY_FUNCTION(cmptDivide)
|
||||
|
||||
/* * * * * * * * * * * * * * * * Global operators * * * * * * * * * * * * * */
|
||||
|
||||
#define UNARY_OPERATOR(op, opFunc) \
|
||||
\
|
||||
template<class Type> \
|
||||
inline void opFunc \
|
||||
( \
|
||||
pointPatchField<Type>& f, \
|
||||
const pointPatchField<Type>& f1 \
|
||||
) \
|
||||
#define UNARY_OPERATOR(op, opFunc) \
|
||||
\
|
||||
template<class Type> \
|
||||
inline void opFunc \
|
||||
( \
|
||||
pointPatchField<Type>& f, \
|
||||
const pointPatchField<Type>& f1 \
|
||||
) \
|
||||
{}
|
||||
|
||||
UNARY_OPERATOR(-, negate)
|
||||
|
||||
#define BINARY_OPERATOR(Type1, Type2, op, opFunc) \
|
||||
\
|
||||
template<class Type> \
|
||||
inline void opFunc \
|
||||
( \
|
||||
pointPatchField<Type>& f, \
|
||||
const pointPatchField<Type1>& f1, \
|
||||
const pointPatchField<Type2>& f2 \
|
||||
) \
|
||||
#define BINARY_OPERATOR(Type1, Type2, op, opFunc) \
|
||||
\
|
||||
template<class Type> \
|
||||
inline void opFunc \
|
||||
( \
|
||||
pointPatchField<Type>& f, \
|
||||
const pointPatchField<Type1>& f1, \
|
||||
const pointPatchField<Type2>& f2 \
|
||||
) \
|
||||
{}
|
||||
|
||||
BINARY_OPERATOR(scalar, Type, *, multiply)
|
||||
BINARY_OPERATOR(Type, scalar, *, multiply)
|
||||
BINARY_OPERATOR(Type, scalar, /, divide)
|
||||
|
||||
#define BINARY_TYPE_OPERATOR_SF(TYPE, op, opFunc) \
|
||||
\
|
||||
template<class Type> \
|
||||
inline void opFunc \
|
||||
( \
|
||||
pointPatchField<Type>& f, \
|
||||
const TYPE& s, \
|
||||
const pointPatchField<Type>& f1 \
|
||||
) \
|
||||
#define BINARY_TYPE_OPERATOR_SF(TYPE, op, opFunc) \
|
||||
\
|
||||
template<class Type> \
|
||||
inline void opFunc \
|
||||
( \
|
||||
pointPatchField<Type>& f, \
|
||||
const TYPE& s, \
|
||||
const pointPatchField<Type>& f1 \
|
||||
) \
|
||||
{}
|
||||
|
||||
|
||||
#define BINARY_TYPE_OPERATOR_FS(TYPE, op, opFunc) \
|
||||
\
|
||||
template<class Type> \
|
||||
inline void opFunc \
|
||||
( \
|
||||
pointPatchField<Type>& f, \
|
||||
const pointPatchField<Type>& f1, \
|
||||
const TYPE& s \
|
||||
) \
|
||||
#define BINARY_TYPE_OPERATOR_FS(TYPE, op, opFunc) \
|
||||
\
|
||||
template<class Type> \
|
||||
inline void opFunc \
|
||||
( \
|
||||
pointPatchField<Type>& f, \
|
||||
const pointPatchField<Type>& f1, \
|
||||
const TYPE& s \
|
||||
) \
|
||||
{}
|
||||
|
||||
|
||||
@ -185,52 +185,52 @@ BINARY_TYPE_OPERATOR_FS(scalar, *, multiply)
|
||||
BINARY_TYPE_OPERATOR_FS(scalar, /, divide)
|
||||
|
||||
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Type1, \
|
||||
class Type2 \
|
||||
> \
|
||||
inline void opFunc \
|
||||
( \
|
||||
pointPatchField \
|
||||
<typename product<Type1, Type2>::type>& f, \
|
||||
const pointPatchField<Type1>& f1, \
|
||||
const pointPatchField<Type2>& f2 \
|
||||
) \
|
||||
{} \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Type, \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt \
|
||||
> \
|
||||
inline void opFunc \
|
||||
( \
|
||||
pointPatchField \
|
||||
<typename product<Type, Form>::type>& f, \
|
||||
const pointPatchField<Type>& f1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{} \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type \
|
||||
> \
|
||||
inline void opFunc \
|
||||
( \
|
||||
pointPatchField \
|
||||
<typename product<Form, Type>::type>& f, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const pointPatchField<Type>& f1 \
|
||||
) \
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Type1, \
|
||||
class Type2 \
|
||||
> \
|
||||
inline void opFunc \
|
||||
( \
|
||||
pointPatchField \
|
||||
<typename product<Type1, Type2>::type>& f, \
|
||||
const pointPatchField<Type1>& f1, \
|
||||
const pointPatchField<Type2>& f2 \
|
||||
) \
|
||||
{} \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Type, \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt \
|
||||
> \
|
||||
inline void opFunc \
|
||||
( \
|
||||
pointPatchField \
|
||||
<typename product<Type, Form>::type>& f, \
|
||||
const pointPatchField<Type>& f1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs \
|
||||
) \
|
||||
{} \
|
||||
\
|
||||
template \
|
||||
< \
|
||||
class Form, \
|
||||
class Cmpt, \
|
||||
int nCmpt, \
|
||||
class Type \
|
||||
> \
|
||||
inline void opFunc \
|
||||
( \
|
||||
pointPatchField \
|
||||
<typename product<Form, Type>::type>& f, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
|
||||
const pointPatchField<Type>& f1 \
|
||||
) \
|
||||
{}
|
||||
|
||||
PRODUCT_OPERATOR(typeOfSum, +, add)
|
||||
|
||||
@ -32,16 +32,16 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
#define makePointPatchField(pointPatchTypeField) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(pointPatchTypeField, 0); \
|
||||
template<> \
|
||||
int pointPatchTypeField::disallowGenericPointPatchField \
|
||||
( \
|
||||
debug::debugSwitch("disallowGenericPointPatchField", 0) \
|
||||
); \
|
||||
defineTemplateRunTimeSelectionTable(pointPatchTypeField, pointPatch); \
|
||||
defineTemplateRunTimeSelectionTable(pointPatchTypeField, patchMapper); \
|
||||
#define makePointPatchField(pointPatchTypeField) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(pointPatchTypeField, 0); \
|
||||
template<> \
|
||||
int pointPatchTypeField::disallowGenericPointPatchField \
|
||||
( \
|
||||
debug::debugSwitch("disallowGenericPointPatchField", 0) \
|
||||
); \
|
||||
defineTemplateRunTimeSelectionTable(pointPatchTypeField, pointPatch); \
|
||||
defineTemplateRunTimeSelectionTable(pointPatchTypeField, patchMapper); \
|
||||
defineTemplateRunTimeSelectionTable(pointPatchTypeField, dictionary);
|
||||
|
||||
makePointPatchField(pointPatchScalarField)
|
||||
|
||||
@ -93,100 +93,100 @@ T dimensionedConstant
|
||||
|
||||
|
||||
//- Defined dimensioned constant , lookup as \a Name
|
||||
#define defineDimensionedConstant(Group,Switch,Tag,Name) \
|
||||
const Foam::dimensionedScalar Switch; \
|
||||
class add##Tag##ToDimensionedConstant \
|
||||
: \
|
||||
public Foam::simpleRegIOobject \
|
||||
{ \
|
||||
public: \
|
||||
add##Tag##ToDimensionedConstant(const char* name) \
|
||||
: \
|
||||
Foam::simpleRegIOobject \
|
||||
(Foam::debug::addDimensionedConstantObject,name) \
|
||||
{ \
|
||||
Foam::dimensionedScalar ds \
|
||||
( \
|
||||
Foam::dimensionedConstant \
|
||||
( \
|
||||
Group, \
|
||||
Name \
|
||||
) \
|
||||
); \
|
||||
#define defineDimensionedConstant(Group,Switch,Tag,Name) \
|
||||
const Foam::dimensionedScalar Switch; \
|
||||
class add##Tag##ToDimensionedConstant \
|
||||
: \
|
||||
public Foam::simpleRegIOobject \
|
||||
{ \
|
||||
public: \
|
||||
add##Tag##ToDimensionedConstant(const char* name) \
|
||||
: \
|
||||
Foam::simpleRegIOobject \
|
||||
(Foam::debug::addDimensionedConstantObject,name) \
|
||||
{ \
|
||||
Foam::dimensionedScalar ds \
|
||||
( \
|
||||
Foam::dimensionedConstant \
|
||||
( \
|
||||
Group, \
|
||||
Name \
|
||||
) \
|
||||
); \
|
||||
Foam::dimensionedScalar& s = const_cast<Foam::dimensionedScalar&> \
|
||||
( \
|
||||
Switch \
|
||||
); \
|
||||
s.dimensions().reset(ds.dimensions()); \
|
||||
s = ds; \
|
||||
} \
|
||||
virtual ~add##Tag##ToDimensionedConstant() \
|
||||
{} \
|
||||
virtual void readData(Foam::Istream& is) \
|
||||
{ \
|
||||
const_cast<Foam::dimensionedScalar&>(Switch) = \
|
||||
Foam::dimensionedConstant \
|
||||
( \
|
||||
Group, \
|
||||
Name \
|
||||
); \
|
||||
} \
|
||||
virtual void writeData(Foam::Ostream& os) const \
|
||||
{ \
|
||||
os << Switch; \
|
||||
} \
|
||||
}; \
|
||||
( \
|
||||
Switch \
|
||||
); \
|
||||
s.dimensions().reset(ds.dimensions()); \
|
||||
s = ds; \
|
||||
} \
|
||||
virtual ~add##Tag##ToDimensionedConstant() \
|
||||
{} \
|
||||
virtual void readData(Foam::Istream& is) \
|
||||
{ \
|
||||
const_cast<Foam::dimensionedScalar&>(Switch) = \
|
||||
Foam::dimensionedConstant \
|
||||
( \
|
||||
Group, \
|
||||
Name \
|
||||
); \
|
||||
} \
|
||||
virtual void writeData(Foam::Ostream& os) const \
|
||||
{ \
|
||||
os << Switch; \
|
||||
} \
|
||||
}; \
|
||||
add##Tag##ToDimensionedConstant add##Tag##ToDimensionedConstant_(Name)
|
||||
|
||||
|
||||
//- Defined dimensioned constant with default , lookup as \a Name
|
||||
#define defineDimensionedConstantWithDefault\
|
||||
(Group,Switch,DefaultExpr,Tag,Name) \
|
||||
const Foam::dimensionedScalar Switch; \
|
||||
class add##Tag##ToDimensionedConstantWithDefault \
|
||||
: \
|
||||
public Foam::simpleRegIOobject \
|
||||
{ \
|
||||
public: \
|
||||
add##Tag##ToDimensionedConstantWithDefault(const char* name) \
|
||||
: \
|
||||
Foam::simpleRegIOobject \
|
||||
(Foam::debug::addDimensionedConstantObject,name) \
|
||||
{ \
|
||||
Foam::dimensionedScalar ds \
|
||||
( \
|
||||
Foam::dimensionedConstant \
|
||||
( \
|
||||
Group, \
|
||||
Name, \
|
||||
Foam::dimensionedScalar(Name,DefaultExpr) \
|
||||
) \
|
||||
); \
|
||||
(Group,Switch,DefaultExpr,Tag,Name) \
|
||||
const Foam::dimensionedScalar Switch; \
|
||||
class add##Tag##ToDimensionedConstantWithDefault \
|
||||
: \
|
||||
public Foam::simpleRegIOobject \
|
||||
{ \
|
||||
public: \
|
||||
add##Tag##ToDimensionedConstantWithDefault(const char* name) \
|
||||
: \
|
||||
Foam::simpleRegIOobject \
|
||||
(Foam::debug::addDimensionedConstantObject,name) \
|
||||
{ \
|
||||
Foam::dimensionedScalar ds \
|
||||
( \
|
||||
Foam::dimensionedConstant \
|
||||
( \
|
||||
Group, \
|
||||
Name, \
|
||||
Foam::dimensionedScalar(Name,DefaultExpr) \
|
||||
) \
|
||||
); \
|
||||
Foam::dimensionedScalar& s = const_cast<Foam::dimensionedScalar&> \
|
||||
( \
|
||||
Switch \
|
||||
); \
|
||||
s.dimensions().reset(ds.dimensions()); \
|
||||
s = ds; \
|
||||
} \
|
||||
virtual ~add##Tag##ToDimensionedConstantWithDefault() \
|
||||
{} \
|
||||
virtual void readData(Foam::Istream& is) \
|
||||
{ \
|
||||
const_cast<Foam::dimensionedScalar&>(Switch) = \
|
||||
Foam::dimensionedConstant \
|
||||
( \
|
||||
Group, \
|
||||
Name, \
|
||||
Foam::dimensionedScalar(Name,DefaultExpr) \
|
||||
); \
|
||||
} \
|
||||
virtual void writeData(Foam::Ostream& os) const \
|
||||
{ \
|
||||
os << Switch; \
|
||||
} \
|
||||
}; \
|
||||
add##Tag##ToDimensionedConstantWithDefault \
|
||||
( \
|
||||
Switch \
|
||||
); \
|
||||
s.dimensions().reset(ds.dimensions()); \
|
||||
s = ds; \
|
||||
} \
|
||||
virtual ~add##Tag##ToDimensionedConstantWithDefault() \
|
||||
{} \
|
||||
virtual void readData(Foam::Istream& is) \
|
||||
{ \
|
||||
const_cast<Foam::dimensionedScalar&>(Switch) = \
|
||||
Foam::dimensionedConstant \
|
||||
( \
|
||||
Group, \
|
||||
Name, \
|
||||
Foam::dimensionedScalar(Name,DefaultExpr) \
|
||||
); \
|
||||
} \
|
||||
virtual void writeData(Foam::Ostream& os) const \
|
||||
{ \
|
||||
os << Switch; \
|
||||
} \
|
||||
}; \
|
||||
add##Tag##ToDimensionedConstantWithDefault \
|
||||
add##Tag##ToDimensionedConstantWithDefault_(Name)
|
||||
|
||||
|
||||
|
||||
@ -74,64 +74,64 @@ public:
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
#define registerTemplateDebugSwitchWithName(Type,Name) \
|
||||
template<> \
|
||||
const Foam::RegisterDebugSwitch<Type> \
|
||||
#define registerTemplateDebugSwitchWithName(Type,Name) \
|
||||
template<> \
|
||||
const Foam::RegisterDebugSwitch<Type> \
|
||||
Foam::RegisterDebugSwitch<Type>::registerDebugSwitch(Name)
|
||||
|
||||
|
||||
//- Define the debug information, lookup as \a Name
|
||||
#define registerDebugSwitchWithName(Type,Tag,Name) \
|
||||
class add##Tag##ToDebug \
|
||||
: \
|
||||
public ::Foam::simpleRegIOobject \
|
||||
{ \
|
||||
public: \
|
||||
add##Tag##ToDebug(const char* name) \
|
||||
: \
|
||||
::Foam::simpleRegIOobject(Foam::debug::addDebugObject, name) \
|
||||
{} \
|
||||
virtual ~add##Tag##ToDebug() \
|
||||
{} \
|
||||
virtual void readData(Foam::Istream& is) \
|
||||
{ \
|
||||
Type::debug = readLabel(is); \
|
||||
} \
|
||||
virtual void writeData(Foam::Ostream& os) const \
|
||||
{ \
|
||||
os << Type::debug; \
|
||||
} \
|
||||
}; \
|
||||
#define registerDebugSwitchWithName(Type,Tag,Name) \
|
||||
class add##Tag##ToDebug \
|
||||
: \
|
||||
public ::Foam::simpleRegIOobject \
|
||||
{ \
|
||||
public: \
|
||||
add##Tag##ToDebug(const char* name) \
|
||||
: \
|
||||
::Foam::simpleRegIOobject(Foam::debug::addDebugObject, name) \
|
||||
{} \
|
||||
virtual ~add##Tag##ToDebug() \
|
||||
{} \
|
||||
virtual void readData(Foam::Istream& is) \
|
||||
{ \
|
||||
Type::debug = readLabel(is); \
|
||||
} \
|
||||
virtual void writeData(Foam::Ostream& os) const \
|
||||
{ \
|
||||
os << Type::debug; \
|
||||
} \
|
||||
}; \
|
||||
add##Tag##ToDebug add##Tag##ToDebug_(Name)
|
||||
|
||||
|
||||
//- Define the debug information, lookup as \a Name
|
||||
#define defineDebugSwitchWithName(Type, Name, DebugSwitch) \
|
||||
#define defineDebugSwitchWithName(Type, Name, DebugSwitch) \
|
||||
int Type::debug(::Foam::debug::debugSwitch(Name, DebugSwitch))
|
||||
|
||||
//- Define the debug information
|
||||
#define defineDebugSwitch(Type, DebugSwitch) \
|
||||
defineDebugSwitchWithName(Type, Type::typeName_(), DebugSwitch); \
|
||||
#define defineDebugSwitch(Type, DebugSwitch) \
|
||||
defineDebugSwitchWithName(Type, Type::typeName_(), DebugSwitch); \
|
||||
registerDebugSwitchWithName(Type, Type, Type::typeName_())
|
||||
|
||||
//- Define the debug information for templates, lookup as \a Name
|
||||
# define defineTemplateDebugSwitchWithName(Type, Name, DebugSwitch) \
|
||||
template<> \
|
||||
defineDebugSwitchWithName(Type, Name, DebugSwitch); \
|
||||
# define defineTemplateDebugSwitchWithName(Type, Name, DebugSwitch) \
|
||||
template<> \
|
||||
defineDebugSwitchWithName(Type, Name, DebugSwitch); \
|
||||
registerTemplateDebugSwitchWithName(Type, Name)
|
||||
//- Define the debug information for templates sub-classes, lookup as \a Name
|
||||
# define defineTemplate2DebugSwitchWithName(Type, Name, DebugSwitch) \
|
||||
template<> \
|
||||
defineDebugSwitchWithName(Type, Name, DebugSwitch); \
|
||||
# define defineTemplate2DebugSwitchWithName(Type, Name, DebugSwitch) \
|
||||
template<> \
|
||||
defineDebugSwitchWithName(Type, Name, DebugSwitch); \
|
||||
registerTemplateDebugSwitchWithName(Type, Name)
|
||||
|
||||
//- Define the debug information for templates
|
||||
// Useful with typedefs
|
||||
#define defineTemplateDebugSwitch(Type, DebugSwitch) \
|
||||
#define defineTemplateDebugSwitch(Type, DebugSwitch) \
|
||||
defineTemplateDebugSwitchWithName(Type, #Type, DebugSwitch)
|
||||
|
||||
//- Define the debug information directly for templates
|
||||
#define defineNamedTemplateDebugSwitch(Type, DebugSwitch) \
|
||||
#define defineNamedTemplateDebugSwitch(Type, DebugSwitch) \
|
||||
defineTemplateDebugSwitchWithName(Type, Type::typeName_(), DebugSwitch)
|
||||
|
||||
|
||||
@ -139,11 +139,11 @@ public:
|
||||
|
||||
//- Define the debug information for templates
|
||||
// Useful with typedefs
|
||||
#define defineTemplate2DebugSwitch(Type, DebugSwitch) \
|
||||
#define defineTemplate2DebugSwitch(Type, DebugSwitch) \
|
||||
defineTemplate2DebugSwitchWithName(Type, #Type, DebugSwitch)
|
||||
|
||||
//- Define the debug information directly for templates
|
||||
#define defineNamedTemplate2DebugSwitch(Type, DebugSwitch) \
|
||||
#define defineNamedTemplate2DebugSwitch(Type, DebugSwitch) \
|
||||
defineTemplate2DebugSwitchWithName(Type, Type::typeName_(), DebugSwitch)
|
||||
|
||||
|
||||
|
||||
@ -32,8 +32,8 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
#define defineTableReaderType(dataType) \
|
||||
defineNamedTemplateTypeNameAndDebug(tableReader<dataType >, 0); \
|
||||
#define defineTableReaderType(dataType) \
|
||||
defineNamedTemplateTypeNameAndDebug(tableReader<dataType >, 0); \
|
||||
defineTemplatedRunTimeSelectionTable(tableReader, dictionary, dataType);
|
||||
|
||||
defineTableReaderType(scalar);
|
||||
|
||||
@ -35,36 +35,36 @@ SourceFiles
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Only used internally
|
||||
#define makeTypeTableReadersTypeName(typeTableReader, dataType) \
|
||||
\
|
||||
#define makeTypeTableReadersTypeName(typeTableReader, dataType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(typeTableReader<dataType>, 0)
|
||||
|
||||
// Sometimes used externally
|
||||
#define makeTableReadersTypeName(typeTableReader) \
|
||||
\
|
||||
makeTypeTableReadersTypeName(typeTableReader, scalar); \
|
||||
makeTypeTableReadersTypeName(typeTableReader, vector); \
|
||||
makeTypeTableReadersTypeName(typeTableReader, sphericalTensor); \
|
||||
makeTypeTableReadersTypeName(typeTableReader, symmTensor); \
|
||||
#define makeTableReadersTypeName(typeTableReader) \
|
||||
\
|
||||
makeTypeTableReadersTypeName(typeTableReader, scalar); \
|
||||
makeTypeTableReadersTypeName(typeTableReader, vector); \
|
||||
makeTypeTableReadersTypeName(typeTableReader, sphericalTensor); \
|
||||
makeTypeTableReadersTypeName(typeTableReader, symmTensor); \
|
||||
makeTypeTableReadersTypeName(typeTableReader, tensor)
|
||||
|
||||
// Define type info for single dataType template instantiation (eg, vector)
|
||||
#define makeTableReaderType(typeTableReader, dataType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(typeTableReader<dataType>, 0); \
|
||||
addTemplatedToRunTimeSelectionTable \
|
||||
( \
|
||||
tableReader, typeTableReader, dataType, dictionary \
|
||||
#define makeTableReaderType(typeTableReader, dataType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(typeTableReader<dataType>, 0); \
|
||||
addTemplatedToRunTimeSelectionTable \
|
||||
( \
|
||||
tableReader, typeTableReader, dataType, dictionary \
|
||||
)
|
||||
|
||||
|
||||
// Define type info for scalar, vector etc. instantiations
|
||||
#define makeTableReaders(typeTableReader) \
|
||||
\
|
||||
makeTableReaderType(typeTableReader, scalar); \
|
||||
makeTableReaderType(typeTableReader, vector); \
|
||||
makeTableReaderType(typeTableReader, sphericalTensor); \
|
||||
makeTableReaderType(typeTableReader, symmTensor); \
|
||||
#define makeTableReaders(typeTableReader) \
|
||||
\
|
||||
makeTableReaderType(typeTableReader, scalar); \
|
||||
makeTableReaderType(typeTableReader, vector); \
|
||||
makeTableReaderType(typeTableReader, sphericalTensor); \
|
||||
makeTableReaderType(typeTableReader, symmTensor); \
|
||||
makeTableReaderType(typeTableReader, tensor)
|
||||
|
||||
|
||||
|
||||
@ -664,130 +664,130 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeLduMatrix(Type, DType, LUType) \
|
||||
\
|
||||
typedef Foam::LduMatrix<Type, DType, LUType> \
|
||||
ldu##Type##DType##LUType##Matrix; \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(ldu##Type##DType##LUType##Matrix, 0); \
|
||||
\
|
||||
\
|
||||
typedef LduMatrix<Type, DType, LUType>::smoother \
|
||||
ldu##Type##DType##LUType##Smoother; \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
ldu##Type##DType##LUType##Smoother, \
|
||||
symMatrix \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
ldu##Type##DType##LUType##Smoother, \
|
||||
asymMatrix \
|
||||
); \
|
||||
\
|
||||
\
|
||||
typedef LduMatrix<Type, DType, LUType>::preconditioner \
|
||||
ldu##Type##DType##LUType##Preconditioner; \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
ldu##Type##DType##LUType##Preconditioner, \
|
||||
symMatrix \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
ldu##Type##DType##LUType##Preconditioner, \
|
||||
asymMatrix \
|
||||
); \
|
||||
\
|
||||
\
|
||||
typedef LduMatrix<Type, DType, LUType>::solver \
|
||||
ldu##Type##DType##LUType##Solver; \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
ldu##Type##DType##LUType##Solver, \
|
||||
symMatrix \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
ldu##Type##DType##LUType##Solver, \
|
||||
asymMatrix \
|
||||
#define makeLduMatrix(Type, DType, LUType) \
|
||||
\
|
||||
typedef Foam::LduMatrix<Type, DType, LUType> \
|
||||
ldu##Type##DType##LUType##Matrix; \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(ldu##Type##DType##LUType##Matrix, 0); \
|
||||
\
|
||||
\
|
||||
typedef LduMatrix<Type, DType, LUType>::smoother \
|
||||
ldu##Type##DType##LUType##Smoother; \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
ldu##Type##DType##LUType##Smoother, \
|
||||
symMatrix \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
ldu##Type##DType##LUType##Smoother, \
|
||||
asymMatrix \
|
||||
); \
|
||||
\
|
||||
\
|
||||
typedef LduMatrix<Type, DType, LUType>::preconditioner \
|
||||
ldu##Type##DType##LUType##Preconditioner; \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
ldu##Type##DType##LUType##Preconditioner, \
|
||||
symMatrix \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
ldu##Type##DType##LUType##Preconditioner, \
|
||||
asymMatrix \
|
||||
); \
|
||||
\
|
||||
\
|
||||
typedef LduMatrix<Type, DType, LUType>::solver \
|
||||
ldu##Type##DType##LUType##Solver; \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
ldu##Type##DType##LUType##Solver, \
|
||||
symMatrix \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
ldu##Type##DType##LUType##Solver, \
|
||||
asymMatrix \
|
||||
);
|
||||
|
||||
|
||||
#define makeLduPreconditioner(Precon, Type, DType, LUType) \
|
||||
\
|
||||
typedef Precon<Type, DType, LUType> \
|
||||
Precon##Type##DType##LUType##Preconditioner; \
|
||||
defineNamedTemplateTypeNameAndDebug \
|
||||
( \
|
||||
Precon##Type##DType##LUType##Preconditioner, \
|
||||
0 \
|
||||
#define makeLduPreconditioner(Precon, Type, DType, LUType) \
|
||||
\
|
||||
typedef Precon<Type, DType, LUType> \
|
||||
Precon##Type##DType##LUType##Preconditioner; \
|
||||
defineNamedTemplateTypeNameAndDebug \
|
||||
( \
|
||||
Precon##Type##DType##LUType##Preconditioner, \
|
||||
0 \
|
||||
);
|
||||
|
||||
#define makeLduSymPreconditioner(Precon, Type, DType, LUType) \
|
||||
\
|
||||
LduMatrix<Type, DType, LUType>::preconditioner:: \
|
||||
addsymMatrixConstructorToTable<Precon##Type##DType##LUType##Preconditioner> \
|
||||
#define makeLduSymPreconditioner(Precon, Type, DType, LUType) \
|
||||
\
|
||||
LduMatrix<Type, DType, LUType>::preconditioner:: \
|
||||
addsymMatrixConstructorToTable<Precon##Type##DType##LUType##Preconditioner> \
|
||||
add##Precon##Type##DType##LUType##PreconditionerSymMatrixConstructorToTable_;
|
||||
|
||||
#define makeLduAsymPreconditioner(Precon, Type, DType, LUType) \
|
||||
\
|
||||
LduMatrix<Type, DType, LUType>::preconditioner:: \
|
||||
addasymMatrixConstructorToTable<Precon##Type##DType##LUType##Preconditioner> \
|
||||
#define makeLduAsymPreconditioner(Precon, Type, DType, LUType) \
|
||||
\
|
||||
LduMatrix<Type, DType, LUType>::preconditioner:: \
|
||||
addasymMatrixConstructorToTable<Precon##Type##DType##LUType##Preconditioner> \
|
||||
add##Precon##Type##DType##LUType##PreconditionerAsymMatrixConstructorToTable_;
|
||||
|
||||
|
||||
#define makeLduSmoother(Smoother, Type, DType, LUType) \
|
||||
\
|
||||
typedef Smoother<Type, DType, LUType> \
|
||||
Smoother##Type##DType##LUType##Smoother; \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug \
|
||||
( \
|
||||
Smoother##Type##DType##LUType##Smoother, \
|
||||
0 \
|
||||
#define makeLduSmoother(Smoother, Type, DType, LUType) \
|
||||
\
|
||||
typedef Smoother<Type, DType, LUType> \
|
||||
Smoother##Type##DType##LUType##Smoother; \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug \
|
||||
( \
|
||||
Smoother##Type##DType##LUType##Smoother, \
|
||||
0 \
|
||||
);
|
||||
|
||||
#define makeLduSymSmoother(Smoother, Type, DType, LUType) \
|
||||
\
|
||||
LduMatrix<Type, DType, LUType>::smoother:: \
|
||||
addsymMatrixConstructorToTable<Smoother##Type##DType##LUType##Smoother> \
|
||||
#define makeLduSymSmoother(Smoother, Type, DType, LUType) \
|
||||
\
|
||||
LduMatrix<Type, DType, LUType>::smoother:: \
|
||||
addsymMatrixConstructorToTable<Smoother##Type##DType##LUType##Smoother> \
|
||||
add##Smoother##Type##DType##LUType##SymMatrixConstructorToTable_;
|
||||
|
||||
#define makeLduAsymSmoother(Smoother, Type, DType, LUType) \
|
||||
\
|
||||
LduMatrix<Type, DType, LUType>::smoother:: \
|
||||
addasymMatrixConstructorToTable<Smoother##Type##DType##LUType##Smoother> \
|
||||
#define makeLduAsymSmoother(Smoother, Type, DType, LUType) \
|
||||
\
|
||||
LduMatrix<Type, DType, LUType>::smoother:: \
|
||||
addasymMatrixConstructorToTable<Smoother##Type##DType##LUType##Smoother> \
|
||||
add##Smoother##Type##DType##LUType##AsymMatrixConstructorToTable_;
|
||||
|
||||
|
||||
#define makeLduSolver(Solver, Type, DType, LUType) \
|
||||
\
|
||||
typedef Solver<Type, DType, LUType> \
|
||||
Solver##Type##DType##LUType##Solver; \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug \
|
||||
( \
|
||||
Solver##Type##DType##LUType##Solver, \
|
||||
0 \
|
||||
#define makeLduSolver(Solver, Type, DType, LUType) \
|
||||
\
|
||||
typedef Solver<Type, DType, LUType> \
|
||||
Solver##Type##DType##LUType##Solver; \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug \
|
||||
( \
|
||||
Solver##Type##DType##LUType##Solver, \
|
||||
0 \
|
||||
);
|
||||
|
||||
#define makeLduSymSolver(Solver, Type, DType, LUType) \
|
||||
\
|
||||
LduMatrix<Type, DType, LUType>::solver:: \
|
||||
addsymMatrixConstructorToTable<Solver##Type##DType##LUType##Solver> \
|
||||
#define makeLduSymSolver(Solver, Type, DType, LUType) \
|
||||
\
|
||||
LduMatrix<Type, DType, LUType>::solver:: \
|
||||
addsymMatrixConstructorToTable<Solver##Type##DType##LUType##Solver> \
|
||||
add##Solver##Type##DType##LUType##SymMatrixConstructorToTable_;
|
||||
|
||||
#define makeLduAsymSolver(Solver, Type, DType, LUType) \
|
||||
\
|
||||
LduMatrix<Type, DType, LUType>::solver:: \
|
||||
addasymMatrixConstructorToTable<Solver##Type##DType##LUType##Solver> \
|
||||
#define makeLduAsymSolver(Solver, Type, DType, LUType) \
|
||||
\
|
||||
LduMatrix<Type, DType, LUType>::solver:: \
|
||||
addasymMatrixConstructorToTable<Solver##Type##DType##LUType##Solver> \
|
||||
add##Solver##Type##DType##LUType##AsymMatrixConstructorToTable_;
|
||||
|
||||
|
||||
|
||||
@ -271,21 +271,21 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeSolverPerformance(Type) \
|
||||
\
|
||||
typedef Foam::SolverPerformance<Type> \
|
||||
solverPerformance##Type; \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(solverPerformance##Type, 0); \
|
||||
\
|
||||
template<> \
|
||||
const scalar solverPerformance##Type::great_(1e20); \
|
||||
\
|
||||
template<> \
|
||||
const scalar solverPerformance##Type::small_(1e-20); \
|
||||
\
|
||||
template<> \
|
||||
const scalar solverPerformance##Type::vsmall_(VSMALL); \
|
||||
#define makeSolverPerformance(Type) \
|
||||
\
|
||||
typedef Foam::SolverPerformance<Type> \
|
||||
solverPerformance##Type; \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(solverPerformance##Type, 0); \
|
||||
\
|
||||
template<> \
|
||||
const scalar solverPerformance##Type::great_(1e20); \
|
||||
\
|
||||
template<> \
|
||||
const scalar solverPerformance##Type::small_(1e-20); \
|
||||
\
|
||||
template<> \
|
||||
const scalar solverPerformance##Type::vsmall_(VSMALL); \
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -28,17 +28,17 @@ License
|
||||
#include "TDILUPreconditioner.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
#define makeLduPreconditioners(Type, DType, LUType) \
|
||||
\
|
||||
makeLduPreconditioner(NoPreconditioner, Type, DType, LUType); \
|
||||
makeLduSymPreconditioner(NoPreconditioner, Type, DType, LUType); \
|
||||
makeLduAsymPreconditioner(NoPreconditioner, Type, DType, LUType); \
|
||||
\
|
||||
makeLduPreconditioner(DiagonalPreconditioner, Type, DType, LUType); \
|
||||
makeLduSymPreconditioner(DiagonalPreconditioner, Type, DType, LUType); \
|
||||
makeLduAsymPreconditioner(DiagonalPreconditioner, Type, DType, LUType); \
|
||||
\
|
||||
makeLduPreconditioner(TDILUPreconditioner, Type, DType, LUType); \
|
||||
#define makeLduPreconditioners(Type, DType, LUType) \
|
||||
\
|
||||
makeLduPreconditioner(NoPreconditioner, Type, DType, LUType); \
|
||||
makeLduSymPreconditioner(NoPreconditioner, Type, DType, LUType); \
|
||||
makeLduAsymPreconditioner(NoPreconditioner, Type, DType, LUType); \
|
||||
\
|
||||
makeLduPreconditioner(DiagonalPreconditioner, Type, DType, LUType); \
|
||||
makeLduSymPreconditioner(DiagonalPreconditioner, Type, DType, LUType); \
|
||||
makeLduAsymPreconditioner(DiagonalPreconditioner, Type, DType, LUType); \
|
||||
\
|
||||
makeLduPreconditioner(TDILUPreconditioner, Type, DType, LUType); \
|
||||
makeLduAsymPreconditioner(TDILUPreconditioner, Type, DType, LUType);
|
||||
|
||||
namespace Foam
|
||||
|
||||
@ -26,10 +26,10 @@ License
|
||||
#include "TGaussSeidelSmoother.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
#define makeLduSmoothers(Type, DType, LUType) \
|
||||
\
|
||||
makeLduSmoother(TGaussSeidelSmoother, Type, DType, LUType); \
|
||||
makeLduSymSmoother(TGaussSeidelSmoother, Type, DType, LUType); \
|
||||
#define makeLduSmoothers(Type, DType, LUType) \
|
||||
\
|
||||
makeLduSmoother(TGaussSeidelSmoother, Type, DType, LUType); \
|
||||
makeLduSymSmoother(TGaussSeidelSmoother, Type, DType, LUType); \
|
||||
makeLduAsymSmoother(TGaussSeidelSmoother, Type, DType, LUType);
|
||||
|
||||
namespace Foam
|
||||
|
||||
@ -29,23 +29,23 @@ License
|
||||
#include "SmoothSolver.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
#define makeLduSolvers(Type, DType, LUType) \
|
||||
\
|
||||
makeLduSolver(DiagonalSolver, Type, DType, LUType); \
|
||||
makeLduSymSolver(DiagonalSolver, Type, DType, LUType); \
|
||||
makeLduAsymSolver(DiagonalSolver, Type, DType, LUType); \
|
||||
\
|
||||
makeLduSolver(PCICG, Type, DType, LUType); \
|
||||
makeLduSymSolver(PCICG, Type, DType, LUType); \
|
||||
\
|
||||
makeLduSolver(PBiCCCG, Type, DType, LUType); \
|
||||
makeLduAsymSolver(PBiCCCG, Type, DType, LUType); \
|
||||
\
|
||||
makeLduSolver(PBiCICG, Type, DType, LUType); \
|
||||
makeLduAsymSolver(PBiCICG, Type, DType, LUType); \
|
||||
\
|
||||
makeLduSolver(SmoothSolver, Type, DType, LUType); \
|
||||
makeLduSymSolver(SmoothSolver, Type, DType, LUType); \
|
||||
#define makeLduSolvers(Type, DType, LUType) \
|
||||
\
|
||||
makeLduSolver(DiagonalSolver, Type, DType, LUType); \
|
||||
makeLduSymSolver(DiagonalSolver, Type, DType, LUType); \
|
||||
makeLduAsymSolver(DiagonalSolver, Type, DType, LUType); \
|
||||
\
|
||||
makeLduSolver(PCICG, Type, DType, LUType); \
|
||||
makeLduSymSolver(PCICG, Type, DType, LUType); \
|
||||
\
|
||||
makeLduSolver(PBiCCCG, Type, DType, LUType); \
|
||||
makeLduAsymSolver(PBiCCCG, Type, DType, LUType); \
|
||||
\
|
||||
makeLduSolver(PBiCICG, Type, DType, LUType); \
|
||||
makeLduAsymSolver(PBiCICG, Type, DType, LUType); \
|
||||
\
|
||||
makeLduSolver(SmoothSolver, Type, DType, LUType); \
|
||||
makeLduSymSolver(SmoothSolver, Type, DType, LUType); \
|
||||
makeLduAsymSolver(SmoothSolver, Type, DType, LUType);
|
||||
|
||||
namespace Foam
|
||||
|
||||
@ -205,22 +205,22 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeDataEntry(Type) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(DataEntry<Type>, 0); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
DataEntry<Type>, \
|
||||
dictionary \
|
||||
#define makeDataEntry(Type) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(DataEntry<Type>, 0); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
DataEntry<Type>, \
|
||||
dictionary \
|
||||
);
|
||||
|
||||
|
||||
#define makeDataEntryType(SS, Type) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
|
||||
\
|
||||
DataEntry<Type>::adddictionaryConstructorToTable<SS<Type>> \
|
||||
#define makeDataEntryType(SS, Type) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
|
||||
\
|
||||
DataEntry<Type>::adddictionaryConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##ConstructorToTable_;
|
||||
|
||||
|
||||
|
||||
@ -113,14 +113,14 @@ Description
|
||||
// rotates.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define bitMixer(a, b, c) \
|
||||
{ \
|
||||
a -= c; a ^= bitRotateLeft(c, 4); c += b; \
|
||||
b -= a; b ^= bitRotateLeft(a, 6); a += c; \
|
||||
c -= b; c ^= bitRotateLeft(b, 8); b += a; \
|
||||
a -= c; a ^= bitRotateLeft(c,16); c += b; \
|
||||
b -= a; b ^= bitRotateLeft(a,19); a += c; \
|
||||
c -= b; c ^= bitRotateLeft(b, 4); b += a; \
|
||||
#define bitMixer(a, b, c) \
|
||||
{ \
|
||||
a -= c; a ^= bitRotateLeft(c, 4); c += b; \
|
||||
b -= a; b ^= bitRotateLeft(a, 6); a += c; \
|
||||
c -= b; c ^= bitRotateLeft(b, 8); b += a; \
|
||||
a -= c; a ^= bitRotateLeft(c,16); c += b; \
|
||||
b -= a; b ^= bitRotateLeft(a,19); a += c; \
|
||||
c -= b; c ^= bitRotateLeft(b, 4); b += a; \
|
||||
}
|
||||
|
||||
|
||||
@ -148,15 +148,15 @@ Description
|
||||
// 11 8 15 26 3 22 24
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define bitMixerFinal(a, b, c) \
|
||||
{ \
|
||||
c ^= b; c -= bitRotateLeft(b, 14); \
|
||||
a ^= c; a -= bitRotateLeft(c, 11); \
|
||||
b ^= a; b -= bitRotateLeft(a, 25); \
|
||||
c ^= b; c -= bitRotateLeft(b, 16); \
|
||||
a ^= c; a -= bitRotateLeft(c, 4); \
|
||||
b ^= a; b -= bitRotateLeft(a, 14); \
|
||||
c ^= b; c -= bitRotateLeft(b, 24); \
|
||||
#define bitMixerFinal(a, b, c) \
|
||||
{ \
|
||||
c ^= b; c -= bitRotateLeft(b, 14); \
|
||||
a ^= c; a -= bitRotateLeft(c, 11); \
|
||||
b ^= a; b -= bitRotateLeft(a, 25); \
|
||||
c ^= b; c -= bitRotateLeft(b, 16); \
|
||||
a ^= c; a -= bitRotateLeft(c, 4); \
|
||||
b ^= a; b -= bitRotateLeft(a, 14); \
|
||||
c ^= b; c -= bitRotateLeft(b, 24); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -206,15 +206,15 @@ void Foam::SHA1::processBlock(const void *data, size_t len)
|
||||
// rotate left uint32_t by n bits
|
||||
#define rol_uint32(x, nbits) (((x) << (nbits)) | ((x) >> (32 - (nbits))))
|
||||
|
||||
#define M(I) ( tm = x[I & 0x0F] ^ x[(I-14) & 0x0F] \
|
||||
^ x[(I-8) & 0x0F] ^ x[(I-3) & 0x0F] \
|
||||
#define M(I) ( tm = x[I & 0x0F] ^ x[(I-14) & 0x0F] \
|
||||
^ x[(I-8) & 0x0F] ^ x[(I-3) & 0x0F] \
|
||||
, (x[I & 0x0F] = rol_uint32(tm, 1)) )
|
||||
|
||||
#define R(A,B,C,D,E,F,K,M) \
|
||||
do \
|
||||
{ \
|
||||
E += rol_uint32(A, 5) + F(B, C, D) + K + M; \
|
||||
B = rol_uint32(B, 30); \
|
||||
#define R(A,B,C,D,E,F,K,M) \
|
||||
do \
|
||||
{ \
|
||||
E += rol_uint32(A, 5) + F(B, C, D) + K + M; \
|
||||
B = rol_uint32(B, 30); \
|
||||
} while (0)
|
||||
|
||||
while (words < endp)
|
||||
|
||||
@ -43,28 +43,28 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define EqOp(opName, op) \
|
||||
\
|
||||
template<class T1, class T2> \
|
||||
class opName##Op2 \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
void operator()(T1& x, const T2& y) const \
|
||||
{ \
|
||||
op; \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
template<class T> \
|
||||
class opName##Op \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
void operator()(T& x, const T& y) const \
|
||||
{ \
|
||||
op; \
|
||||
} \
|
||||
#define EqOp(opName, op) \
|
||||
\
|
||||
template<class T1, class T2> \
|
||||
class opName##Op2 \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
void operator()(T1& x, const T2& y) const \
|
||||
{ \
|
||||
op; \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
template<class T> \
|
||||
class opName##Op \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
void operator()(T& x, const T& y) const \
|
||||
{ \
|
||||
op; \
|
||||
} \
|
||||
};
|
||||
|
||||
EqOp(eq, x = y)
|
||||
@ -96,67 +96,67 @@ EqOp(nopEq, (void)x)
|
||||
#define WARNRETURN
|
||||
#endif
|
||||
|
||||
#define Op(opName, op) \
|
||||
\
|
||||
template<class T, class T1, class T2> \
|
||||
class opName##Op3 \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
T operator()(const T1& x, const T2& y) const WARNRETURN \
|
||||
{ \
|
||||
return op; \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
template<class T1, class T2> \
|
||||
class opName##Op2 \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
T1 operator()(const T1& x, const T2& y) const WARNRETURN \
|
||||
{ \
|
||||
return op; \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
template<class T> \
|
||||
class opName##Op \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
T operator()(const T& x, const T& y) const WARNRETURN \
|
||||
{ \
|
||||
return op; \
|
||||
} \
|
||||
#define Op(opName, op) \
|
||||
\
|
||||
template<class T, class T1, class T2> \
|
||||
class opName##Op3 \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
T operator()(const T1& x, const T2& y) const WARNRETURN \
|
||||
{ \
|
||||
return op; \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
template<class T1, class T2> \
|
||||
class opName##Op2 \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
T1 operator()(const T1& x, const T2& y) const WARNRETURN \
|
||||
{ \
|
||||
return op; \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
template<class T> \
|
||||
class opName##Op \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
T operator()(const T& x, const T& y) const WARNRETURN \
|
||||
{ \
|
||||
return op; \
|
||||
} \
|
||||
};
|
||||
|
||||
|
||||
#define weightedOp(opName, op) \
|
||||
\
|
||||
template<class Type, class CombineOp> \
|
||||
class opName##WeightedOp \
|
||||
{ \
|
||||
const CombineOp& cop_; \
|
||||
\
|
||||
public: \
|
||||
\
|
||||
opName##WeightedOp(const CombineOp& cop) \
|
||||
: \
|
||||
cop_(cop) \
|
||||
{} \
|
||||
\
|
||||
void operator() \
|
||||
( \
|
||||
Type& x, \
|
||||
const label index, \
|
||||
const Type& y, \
|
||||
const scalar weight \
|
||||
) const \
|
||||
{ \
|
||||
cop_(x, op); \
|
||||
} \
|
||||
}; \
|
||||
#define weightedOp(opName, op) \
|
||||
\
|
||||
template<class Type, class CombineOp> \
|
||||
class opName##WeightedOp \
|
||||
{ \
|
||||
const CombineOp& cop_; \
|
||||
\
|
||||
public: \
|
||||
\
|
||||
opName##WeightedOp(const CombineOp& cop) \
|
||||
: \
|
||||
cop_(cop) \
|
||||
{} \
|
||||
\
|
||||
void operator() \
|
||||
( \
|
||||
Type& x, \
|
||||
const label index, \
|
||||
const Type& y, \
|
||||
const scalar weight \
|
||||
) const \
|
||||
{ \
|
||||
cop_(x, op); \
|
||||
} \
|
||||
}; \
|
||||
|
||||
|
||||
Op(sum, x + y)
|
||||
|
||||
@ -44,7 +44,7 @@ License
|
||||
dictionary \
|
||||
); \
|
||||
\
|
||||
typedef TDModel<BaseModel<Transport>> \
|
||||
typedef TDModel<BaseModel<Transport>> \
|
||||
Transport##BaseModel; \
|
||||
\
|
||||
\
|
||||
@ -60,7 +60,7 @@ License
|
||||
); \
|
||||
\
|
||||
\
|
||||
typedef RASModel<EddyDiffusivity<Transport##BaseModel>> \
|
||||
typedef RASModel<EddyDiffusivity<Transport##BaseModel>> \
|
||||
RAS##Transport##BaseModel; \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(RAS##Transport##BaseModel, 0); \
|
||||
@ -76,7 +76,7 @@ License
|
||||
); \
|
||||
\
|
||||
\
|
||||
typedef LESModel<EddyDiffusivity<Transport##BaseModel>> \
|
||||
typedef LESModel<EddyDiffusivity<Transport##BaseModel>> \
|
||||
LES##Transport##BaseModel; \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(LES##Transport##BaseModel, 0); \
|
||||
@ -102,7 +102,7 @@ License
|
||||
{ \
|
||||
namespace SType##Models \
|
||||
{ \
|
||||
typedef Type<EddyDiffusivity<BaseModel>> Type##SType##BaseModel; \
|
||||
typedef Type<EddyDiffusivity<BaseModel>> Type##SType##BaseModel; \
|
||||
\
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
|
||||
@ -32,8 +32,8 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
#define defineSetWriterType(dataType) \
|
||||
defineNamedTemplateTypeNameAndDebug(writer<dataType >, 0); \
|
||||
#define defineSetWriterType(dataType) \
|
||||
defineNamedTemplateTypeNameAndDebug(writer<dataType >, 0); \
|
||||
defineTemplatedRunTimeSelectionTable(writer, word, dataType);
|
||||
|
||||
defineSetWriterType(scalar);
|
||||
|
||||
@ -39,36 +39,36 @@ SourceFiles
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Only used internally
|
||||
#define makeTypeSetWritersTypeName(typeWriter, dataType) \
|
||||
\
|
||||
#define makeTypeSetWritersTypeName(typeWriter, dataType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(typeWriter<dataType>, 0)
|
||||
|
||||
// Sometimes used externally
|
||||
#define makeSetWritersTypeName(typeWriter) \
|
||||
\
|
||||
makeTypeSetWritersTypeName(typeWriter, scalar); \
|
||||
makeTypeSetWritersTypeName(typeWriter, vector); \
|
||||
makeTypeSetWritersTypeName(typeWriter, sphericalTensor); \
|
||||
makeTypeSetWritersTypeName(typeWriter, symmTensor); \
|
||||
#define makeSetWritersTypeName(typeWriter) \
|
||||
\
|
||||
makeTypeSetWritersTypeName(typeWriter, scalar); \
|
||||
makeTypeSetWritersTypeName(typeWriter, vector); \
|
||||
makeTypeSetWritersTypeName(typeWriter, sphericalTensor); \
|
||||
makeTypeSetWritersTypeName(typeWriter, symmTensor); \
|
||||
makeTypeSetWritersTypeName(typeWriter, tensor)
|
||||
|
||||
// Define type info for single dataType template instantiation (eg, vector)
|
||||
#define makeSetWriterType(typeWriter, dataType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(typeWriter<dataType>, 0); \
|
||||
addTemplatedToRunTimeSelectionTable \
|
||||
( \
|
||||
writer, typeWriter, dataType, word \
|
||||
#define makeSetWriterType(typeWriter, dataType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(typeWriter<dataType>, 0); \
|
||||
addTemplatedToRunTimeSelectionTable \
|
||||
( \
|
||||
writer, typeWriter, dataType, word \
|
||||
)
|
||||
|
||||
|
||||
// Define type info for scalar, vector etc. instantiations
|
||||
#define makeSetWriters(typeWriter) \
|
||||
\
|
||||
makeSetWriterType(typeWriter, scalar); \
|
||||
makeSetWriterType(typeWriter, vector); \
|
||||
makeSetWriterType(typeWriter, sphericalTensor); \
|
||||
makeSetWriterType(typeWriter, symmTensor); \
|
||||
#define makeSetWriters(typeWriter) \
|
||||
\
|
||||
makeSetWriterType(typeWriter, scalar); \
|
||||
makeSetWriterType(typeWriter, vector); \
|
||||
makeSetWriterType(typeWriter, sphericalTensor); \
|
||||
makeSetWriterType(typeWriter, symmTensor); \
|
||||
makeSetWriterType(typeWriter, tensor)
|
||||
|
||||
|
||||
|
||||
@ -31,17 +31,17 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeFvOption(Option, Type) \
|
||||
\
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
( \
|
||||
Foam::fv::Option<Foam::Type>, \
|
||||
#Type#Option, \
|
||||
0 \
|
||||
); \
|
||||
\
|
||||
Foam::fv::option::adddictionaryConstructorToTable \
|
||||
<Foam::fv::Option<Foam::Type>> \
|
||||
#define makeFvOption(Option, Type) \
|
||||
\
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
( \
|
||||
Foam::fv::Option<Foam::Type>, \
|
||||
#Type#Option, \
|
||||
0 \
|
||||
); \
|
||||
\
|
||||
Foam::fv::option::adddictionaryConstructorToTable \
|
||||
<Foam::fv::Option<Foam::Type>> \
|
||||
add##Option##Type##dictionary##ConstructorTooptionTable_
|
||||
|
||||
|
||||
|
||||
@ -571,123 +571,123 @@ public:
|
||||
#endif
|
||||
|
||||
|
||||
#define makeFvPatchField(fvPatchTypeField) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(fvPatchTypeField, 0); \
|
||||
template<> \
|
||||
int fvPatchTypeField::disallowGenericFvPatchField \
|
||||
( \
|
||||
debug::debugSwitch("disallowGenericFvPatchField", 0) \
|
||||
); \
|
||||
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patch); \
|
||||
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patchMapper); \
|
||||
#define makeFvPatchField(fvPatchTypeField) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(fvPatchTypeField, 0); \
|
||||
template<> \
|
||||
int fvPatchTypeField::disallowGenericFvPatchField \
|
||||
( \
|
||||
debug::debugSwitch("disallowGenericFvPatchField", 0) \
|
||||
); \
|
||||
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patch); \
|
||||
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patchMapper); \
|
||||
defineTemplateRunTimeSelectionTable(fvPatchTypeField, dictionary);
|
||||
|
||||
|
||||
#define addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
patch \
|
||||
); \
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
patchMapper \
|
||||
); \
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
dictionary \
|
||||
#define addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
patch \
|
||||
); \
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
patchMapper \
|
||||
); \
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
dictionary \
|
||||
);
|
||||
|
||||
|
||||
// use with caution
|
||||
#define addRemovableToPatchFieldRunTimeSelection\
|
||||
(PatchTypeField, typePatchTypeField) \
|
||||
\
|
||||
addRemovableToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
patch \
|
||||
); \
|
||||
addRemovableToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
patchMapper \
|
||||
); \
|
||||
addRemovableToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
dictionary \
|
||||
(PatchTypeField, typePatchTypeField) \
|
||||
\
|
||||
addRemovableToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
patch \
|
||||
); \
|
||||
addRemovableToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
patchMapper \
|
||||
); \
|
||||
addRemovableToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
dictionary \
|
||||
);
|
||||
|
||||
|
||||
// for non-templated patch fields
|
||||
#define makePatchTypeField(PatchTypeField, typePatchTypeField) \
|
||||
defineTypeNameAndDebug(typePatchTypeField, 0); \
|
||||
#define makePatchTypeField(PatchTypeField, typePatchTypeField) \
|
||||
defineTypeNameAndDebug(typePatchTypeField, 0); \
|
||||
addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField)
|
||||
|
||||
// for non-templated patch fields - use with caution
|
||||
#define makeRemovablePatchTypeField(PatchTypeField, typePatchTypeField) \
|
||||
defineTypeNameAndDebug(typePatchTypeField, 0); \
|
||||
#define makeRemovablePatchTypeField(PatchTypeField, typePatchTypeField) \
|
||||
defineTypeNameAndDebug(typePatchTypeField, 0); \
|
||||
addRemovableToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField)
|
||||
|
||||
|
||||
// for templated patch fields
|
||||
#define makeTemplatePatchTypeField(PatchTypeField, typePatchTypeField) \
|
||||
defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
|
||||
#define makeTemplatePatchTypeField(PatchTypeField, typePatchTypeField) \
|
||||
defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
|
||||
addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField)
|
||||
|
||||
|
||||
#define makePatchFields(type) \
|
||||
makeTemplatePatchTypeField \
|
||||
( \
|
||||
fvPatchScalarField, \
|
||||
type##FvPatchScalarField \
|
||||
); \
|
||||
makeTemplatePatchTypeField \
|
||||
( \
|
||||
fvPatchVectorField, \
|
||||
type##FvPatchVectorField \
|
||||
); \
|
||||
makeTemplatePatchTypeField \
|
||||
( \
|
||||
fvPatchSphericalTensorField, \
|
||||
type##FvPatchSphericalTensorField \
|
||||
); \
|
||||
makeTemplatePatchTypeField \
|
||||
( \
|
||||
fvPatchSymmTensorField, \
|
||||
type##FvPatchSymmTensorField \
|
||||
); \
|
||||
makeTemplatePatchTypeField \
|
||||
( \
|
||||
fvPatchTensorField, \
|
||||
type##FvPatchTensorField \
|
||||
#define makePatchFields(type) \
|
||||
makeTemplatePatchTypeField \
|
||||
( \
|
||||
fvPatchScalarField, \
|
||||
type##FvPatchScalarField \
|
||||
); \
|
||||
makeTemplatePatchTypeField \
|
||||
( \
|
||||
fvPatchVectorField, \
|
||||
type##FvPatchVectorField \
|
||||
); \
|
||||
makeTemplatePatchTypeField \
|
||||
( \
|
||||
fvPatchSphericalTensorField, \
|
||||
type##FvPatchSphericalTensorField \
|
||||
); \
|
||||
makeTemplatePatchTypeField \
|
||||
( \
|
||||
fvPatchSymmTensorField, \
|
||||
type##FvPatchSymmTensorField \
|
||||
); \
|
||||
makeTemplatePatchTypeField \
|
||||
( \
|
||||
fvPatchTensorField, \
|
||||
type##FvPatchTensorField \
|
||||
);
|
||||
|
||||
|
||||
#define makePatchFieldsTypeName(type) \
|
||||
defineNamedTemplateTypeNameAndDebug(type##FvPatchScalarField, 0); \
|
||||
defineNamedTemplateTypeNameAndDebug(type##FvPatchVectorField, 0); \
|
||||
#define makePatchFieldsTypeName(type) \
|
||||
defineNamedTemplateTypeNameAndDebug(type##FvPatchScalarField, 0); \
|
||||
defineNamedTemplateTypeNameAndDebug(type##FvPatchVectorField, 0); \
|
||||
defineNamedTemplateTypeNameAndDebug(type##FvPatchSphericalTensorField, 0);\
|
||||
defineNamedTemplateTypeNameAndDebug(type##FvPatchSymmTensorField, 0); \
|
||||
defineNamedTemplateTypeNameAndDebug(type##FvPatchSymmTensorField, 0); \
|
||||
defineNamedTemplateTypeNameAndDebug(type##FvPatchTensorField, 0)
|
||||
|
||||
|
||||
#define makePatchTypeFieldTypedefs(type) \
|
||||
typedef type##FvPatchField<scalar> type##FvPatchScalarField; \
|
||||
typedef type##FvPatchField<vector> type##FvPatchVectorField; \
|
||||
typedef type##FvPatchField<sphericalTensor> \
|
||||
type##FvPatchSphericalTensorField; \
|
||||
typedef type##FvPatchField<symmTensor> type##FvPatchSymmTensorField; \
|
||||
#define makePatchTypeFieldTypedefs(type) \
|
||||
typedef type##FvPatchField<scalar> type##FvPatchScalarField; \
|
||||
typedef type##FvPatchField<vector> type##FvPatchVectorField; \
|
||||
typedef type##FvPatchField<sphericalTensor> \
|
||||
type##FvPatchSphericalTensorField; \
|
||||
typedef type##FvPatchField<symmTensor> type##FvPatchSymmTensorField; \
|
||||
typedef type##FvPatchField<tensor> type##FvPatchTensorField;
|
||||
|
||||
|
||||
|
||||
@ -386,60 +386,60 @@ public:
|
||||
#endif
|
||||
|
||||
|
||||
#define makeFvsPatchTypeFieldTypeName(type) \
|
||||
\
|
||||
#define makeFvsPatchTypeFieldTypeName(type) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(type, 0);
|
||||
|
||||
#define makeFvsPatchFieldsTypeName(type) \
|
||||
\
|
||||
makeFvsPatchTypeFieldTypeName(type##FvsPatchScalarField); \
|
||||
makeFvsPatchTypeFieldTypeName(type##FvsPatchVectorField); \
|
||||
makeFvsPatchTypeFieldTypeName(type##FvsPatchSphericalTensorField); \
|
||||
makeFvsPatchTypeFieldTypeName(type##FvsPatchSymmTensorField); \
|
||||
#define makeFvsPatchFieldsTypeName(type) \
|
||||
\
|
||||
makeFvsPatchTypeFieldTypeName(type##FvsPatchScalarField); \
|
||||
makeFvsPatchTypeFieldTypeName(type##FvsPatchVectorField); \
|
||||
makeFvsPatchTypeFieldTypeName(type##FvsPatchSphericalTensorField); \
|
||||
makeFvsPatchTypeFieldTypeName(type##FvsPatchSymmTensorField); \
|
||||
makeFvsPatchTypeFieldTypeName(type##FvsPatchTensorField);
|
||||
|
||||
#define makeFvsPatchTypeField(PatchTypeField, typePatchTypeField) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
|
||||
\
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, typePatchTypeField, patch \
|
||||
); \
|
||||
\
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
patchMapper \
|
||||
); \
|
||||
\
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, typePatchTypeField, dictionary \
|
||||
#define makeFvsPatchTypeField(PatchTypeField, typePatchTypeField) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
|
||||
\
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, typePatchTypeField, patch \
|
||||
); \
|
||||
\
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, \
|
||||
typePatchTypeField, \
|
||||
patchMapper \
|
||||
); \
|
||||
\
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
PatchTypeField, typePatchTypeField, dictionary \
|
||||
);
|
||||
|
||||
|
||||
#define makeFvsPatchFields(type) \
|
||||
\
|
||||
makeFvsPatchTypeField(fvsPatchScalarField, type##FvsPatchScalarField); \
|
||||
makeFvsPatchTypeField(fvsPatchVectorField, type##FvsPatchVectorField); \
|
||||
makeFvsPatchTypeField \
|
||||
( \
|
||||
fvsPatchSphericalTensorField, \
|
||||
type##FvsPatchSphericalTensorField \
|
||||
); \
|
||||
#define makeFvsPatchFields(type) \
|
||||
\
|
||||
makeFvsPatchTypeField(fvsPatchScalarField, type##FvsPatchScalarField); \
|
||||
makeFvsPatchTypeField(fvsPatchVectorField, type##FvsPatchVectorField); \
|
||||
makeFvsPatchTypeField \
|
||||
( \
|
||||
fvsPatchSphericalTensorField, \
|
||||
type##FvsPatchSphericalTensorField \
|
||||
); \
|
||||
makeFvsPatchTypeField(fvsPatchSymmTensorField, type##FvsPatchSymmTensorField); \
|
||||
makeFvsPatchTypeField(fvsPatchTensorField, type##FvsPatchTensorField);
|
||||
|
||||
|
||||
#define makeFvsPatchTypeFieldTypedefs(type) \
|
||||
\
|
||||
typedef type##FvsPatchField<scalar> type##FvsPatchScalarField; \
|
||||
typedef type##FvsPatchField<vector> type##FvsPatchVectorField; \
|
||||
typedef type##FvsPatchField<sphericalTensor> \
|
||||
type##FvsPatchSphericalTensorField; \
|
||||
typedef type##FvsPatchField<symmTensor> type##FvsPatchSymmTensorField; \
|
||||
#define makeFvsPatchTypeFieldTypedefs(type) \
|
||||
\
|
||||
typedef type##FvsPatchField<scalar> type##FvsPatchScalarField; \
|
||||
typedef type##FvsPatchField<vector> type##FvsPatchVectorField; \
|
||||
typedef type##FvsPatchField<sphericalTensor> \
|
||||
type##FvsPatchSphericalTensorField; \
|
||||
typedef type##FvsPatchField<symmTensor> type##FvsPatchSymmTensorField; \
|
||||
typedef type##FvsPatchField<tensor> type##FvsPatchTensorField;
|
||||
|
||||
|
||||
|
||||
@ -32,16 +32,16 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
#define makeFvsPatchField(fvsPatchTypeField) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(fvsPatchTypeField, 0); \
|
||||
template<> \
|
||||
int fvsPatchTypeField::disallowGenericFvsPatchField \
|
||||
( \
|
||||
debug::debugSwitch("disallowGenericFvsPatchField", 0) \
|
||||
); \
|
||||
defineTemplateRunTimeSelectionTable(fvsPatchTypeField, patch); \
|
||||
defineTemplateRunTimeSelectionTable(fvsPatchTypeField, patchMapper); \
|
||||
#define makeFvsPatchField(fvsPatchTypeField) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(fvsPatchTypeField, 0); \
|
||||
template<> \
|
||||
int fvsPatchTypeField::disallowGenericFvsPatchField \
|
||||
( \
|
||||
debug::debugSwitch("disallowGenericFvsPatchField", 0) \
|
||||
); \
|
||||
defineTemplateRunTimeSelectionTable(fvsPatchTypeField, patch); \
|
||||
defineTemplateRunTimeSelectionTable(fvsPatchTypeField, patchMapper); \
|
||||
defineTemplateRunTimeSelectionTable(fvsPatchTypeField, dictionary);
|
||||
|
||||
makeFvsPatchField(fvsPatchScalarField)
|
||||
|
||||
@ -210,7 +210,7 @@ public:
|
||||
{ \
|
||||
namespace fv \
|
||||
{ \
|
||||
convectionScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
|
||||
convectionScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##IstreamConstructorToTable_; \
|
||||
} \
|
||||
}
|
||||
@ -232,7 +232,7 @@ makeFvConvectionTypeScheme(SS, tensor)
|
||||
namespace fv \
|
||||
{ \
|
||||
convectionScheme<Type>:: \
|
||||
addMultivariateConstructorToTable<SS<Type>> \
|
||||
addMultivariateConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##MultivariateConstructorToTable_; \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -41,18 +41,18 @@ namespace fv
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Define the constructor function hash tables
|
||||
|
||||
#define makeBaseConvectionScheme(Type) \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
convectionScheme<Type>, \
|
||||
Istream \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
convectionScheme<Type>, \
|
||||
Multivariate \
|
||||
#define makeBaseConvectionScheme(Type) \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
convectionScheme<Type>, \
|
||||
Istream \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
convectionScheme<Type>, \
|
||||
Multivariate \
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -187,7 +187,7 @@ public:
|
||||
{ \
|
||||
namespace fv \
|
||||
{ \
|
||||
d2dt2Scheme<Type>::addIstreamConstructorToTable<SS<Type>> \
|
||||
d2dt2Scheme<Type>::addIstreamConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##IstreamConstructorToTable_; \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -263,7 +263,7 @@ public:
|
||||
{ \
|
||||
namespace fv \
|
||||
{ \
|
||||
ddtScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
|
||||
ddtScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##IstreamConstructorToTable_; \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ public:
|
||||
{ \
|
||||
namespace fv \
|
||||
{ \
|
||||
divScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
|
||||
divScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##IstreamConstructorToTable_; \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -157,7 +157,7 @@ public:
|
||||
LeastSquaresGrad##TYPE##STENCIL##_; \
|
||||
\
|
||||
gradScheme<Foam::TYPE>::addIstreamConstructorToTable \
|
||||
<LeastSquaresGrad<Foam::TYPE, Foam::STENCIL>> \
|
||||
<LeastSquaresGrad<Foam::TYPE, Foam::STENCIL>> \
|
||||
add##SS##STENCIL##TYPE##IstreamConstructorToTable_; \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ public:
|
||||
{ \
|
||||
namespace fv \
|
||||
{ \
|
||||
gradScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
|
||||
gradScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##IstreamConstructorToTable_; \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -139,21 +139,21 @@ public:
|
||||
// Use macros to emulate partial-specialisation of the the Laplacian functions
|
||||
// for scalar diffusivity gamma
|
||||
|
||||
#define defineFvmLaplacianScalarGamma(Type) \
|
||||
\
|
||||
template<> \
|
||||
tmp<fvMatrix<Type>> gaussLaplacianScheme<Type, scalar>::fvmLaplacian \
|
||||
( \
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh>&, \
|
||||
const GeometricField<Type, fvPatchField, volMesh>& \
|
||||
); \
|
||||
\
|
||||
template<> \
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> \
|
||||
gaussLaplacianScheme<Type, scalar>::fvcLaplacian \
|
||||
( \
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh>&, \
|
||||
const GeometricField<Type, fvPatchField, volMesh>& \
|
||||
#define defineFvmLaplacianScalarGamma(Type) \
|
||||
\
|
||||
template<> \
|
||||
tmp<fvMatrix<Type>> gaussLaplacianScheme<Type, scalar>::fvmLaplacian \
|
||||
( \
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh>&, \
|
||||
const GeometricField<Type, fvPatchField, volMesh>& \
|
||||
); \
|
||||
\
|
||||
template<> \
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> \
|
||||
gaussLaplacianScheme<Type, scalar>::fvcLaplacian \
|
||||
( \
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh>&, \
|
||||
const GeometricField<Type, fvPatchField, volMesh>& \
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -30,81 +30,81 @@ License
|
||||
|
||||
makeFvLaplacianScheme(gaussLaplacianScheme)
|
||||
|
||||
#define declareFvmLaplacianScalarGamma(Type) \
|
||||
\
|
||||
template<> \
|
||||
Foam::tmp<Foam::fvMatrix<Foam::Type>> \
|
||||
Foam::fv::gaussLaplacianScheme<Foam::Type, Foam::scalar>::fvmLaplacian \
|
||||
( \
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh>& gamma, \
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf \
|
||||
) \
|
||||
{ \
|
||||
const fvMesh& mesh = this->mesh(); \
|
||||
\
|
||||
GeometricField<scalar, fvsPatchField, surfaceMesh> gammaMagSf \
|
||||
( \
|
||||
gamma*mesh.magSf() \
|
||||
); \
|
||||
\
|
||||
tmp<fvMatrix<Type>> tfvm = fvmLaplacianUncorrected \
|
||||
( \
|
||||
gammaMagSf, \
|
||||
this->tsnGradScheme_().deltaCoeffs(vf), \
|
||||
vf \
|
||||
); \
|
||||
fvMatrix<Type>& fvm = tfvm(); \
|
||||
\
|
||||
if (this->tsnGradScheme_().corrected()) \
|
||||
{ \
|
||||
if (mesh.fluxRequired(vf.name())) \
|
||||
{ \
|
||||
fvm.faceFluxCorrectionPtr() = new \
|
||||
GeometricField<Type, fvsPatchField, surfaceMesh> \
|
||||
( \
|
||||
gammaMagSf*this->tsnGradScheme_().correction(vf) \
|
||||
); \
|
||||
\
|
||||
fvm.source() -= \
|
||||
mesh.V()* \
|
||||
fvc::div \
|
||||
( \
|
||||
*fvm.faceFluxCorrectionPtr() \
|
||||
)().internalField(); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
fvm.source() -= \
|
||||
mesh.V()* \
|
||||
fvc::div \
|
||||
( \
|
||||
gammaMagSf*this->tsnGradScheme_().correction(vf) \
|
||||
)().internalField(); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
return tfvm; \
|
||||
} \
|
||||
\
|
||||
\
|
||||
template<> \
|
||||
#define declareFvmLaplacianScalarGamma(Type) \
|
||||
\
|
||||
template<> \
|
||||
Foam::tmp<Foam::fvMatrix<Foam::Type>> \
|
||||
Foam::fv::gaussLaplacianScheme<Foam::Type, Foam::scalar>::fvmLaplacian \
|
||||
( \
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh>& gamma, \
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf \
|
||||
) \
|
||||
{ \
|
||||
const fvMesh& mesh = this->mesh(); \
|
||||
\
|
||||
GeometricField<scalar, fvsPatchField, surfaceMesh> gammaMagSf \
|
||||
( \
|
||||
gamma*mesh.magSf() \
|
||||
); \
|
||||
\
|
||||
tmp<fvMatrix<Type>> tfvm = fvmLaplacianUncorrected \
|
||||
( \
|
||||
gammaMagSf, \
|
||||
this->tsnGradScheme_().deltaCoeffs(vf), \
|
||||
vf \
|
||||
); \
|
||||
fvMatrix<Type>& fvm = tfvm(); \
|
||||
\
|
||||
if (this->tsnGradScheme_().corrected()) \
|
||||
{ \
|
||||
if (mesh.fluxRequired(vf.name())) \
|
||||
{ \
|
||||
fvm.faceFluxCorrectionPtr() = new \
|
||||
GeometricField<Type, fvsPatchField, surfaceMesh> \
|
||||
( \
|
||||
gammaMagSf*this->tsnGradScheme_().correction(vf) \
|
||||
); \
|
||||
\
|
||||
fvm.source() -= \
|
||||
mesh.V()* \
|
||||
fvc::div \
|
||||
( \
|
||||
*fvm.faceFluxCorrectionPtr() \
|
||||
)().internalField(); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
fvm.source() -= \
|
||||
mesh.V()* \
|
||||
fvc::div \
|
||||
( \
|
||||
gammaMagSf*this->tsnGradScheme_().correction(vf) \
|
||||
)().internalField(); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
return tfvm; \
|
||||
} \
|
||||
\
|
||||
\
|
||||
template<> \
|
||||
Foam::tmp<Foam::GeometricField<Foam::Type, Foam::fvPatchField, Foam::volMesh>>\
|
||||
Foam::fv::gaussLaplacianScheme<Foam::Type, Foam::scalar>::fvcLaplacian \
|
||||
( \
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh>& gamma, \
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf \
|
||||
) \
|
||||
{ \
|
||||
const fvMesh& mesh = this->mesh(); \
|
||||
\
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> tLaplacian \
|
||||
( \
|
||||
fvc::div(gamma*this->tsnGradScheme_().snGrad(vf)*mesh.magSf()) \
|
||||
); \
|
||||
\
|
||||
Foam::fv::gaussLaplacianScheme<Foam::Type, Foam::scalar>::fvcLaplacian \
|
||||
( \
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh>& gamma, \
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf \
|
||||
) \
|
||||
{ \
|
||||
const fvMesh& mesh = this->mesh(); \
|
||||
\
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> tLaplacian \
|
||||
( \
|
||||
fvc::div(gamma*this->tsnGradScheme_().snGrad(vf)*mesh.magSf()) \
|
||||
); \
|
||||
\
|
||||
tLaplacian().rename("laplacian(" + gamma.name() + ',' + vf.name() + ')');\
|
||||
\
|
||||
return tLaplacian; \
|
||||
\
|
||||
return tLaplacian; \
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -224,7 +224,7 @@ public:
|
||||
typedef SS<Type, GType> SS##Type##GType; \
|
||||
\
|
||||
laplacianScheme<Type, GType>:: \
|
||||
addIstreamConstructorToTable<SS<Type, GType>> \
|
||||
addIstreamConstructorToTable<SS<Type, GType>> \
|
||||
add##SS##Type##GType##IstreamConstructorToTable_; \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -38,13 +38,13 @@ namespace fv
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Define the constructor function hash tables
|
||||
|
||||
#define makeLaplacianGTypeScheme(Type, GType) \
|
||||
typedef laplacianScheme<Type, GType> laplacianScheme##Type##GType; \
|
||||
#define makeLaplacianGTypeScheme(Type, GType) \
|
||||
typedef laplacianScheme<Type, GType> laplacianScheme##Type##GType; \
|
||||
defineTemplateRunTimeSelectionTable(laplacianScheme##Type##GType, Istream);
|
||||
|
||||
#define makeLaplacianScheme(Type) \
|
||||
makeLaplacianGTypeScheme(Type, scalar); \
|
||||
makeLaplacianGTypeScheme(Type, symmTensor); \
|
||||
#define makeLaplacianScheme(Type) \
|
||||
makeLaplacianGTypeScheme(Type, scalar); \
|
||||
makeLaplacianGTypeScheme(Type, symmTensor); \
|
||||
makeLaplacianGTypeScheme(Type, tensor);
|
||||
|
||||
makeLaplacianScheme(scalar);
|
||||
|
||||
@ -169,7 +169,7 @@ public:
|
||||
namespace fv \
|
||||
{ \
|
||||
snGradScheme<TYPE>::addMeshConstructorToTable \
|
||||
<CentredFitSnGradScheme<TYPE, POLYNOMIAL, STENCIL>> \
|
||||
<CentredFitSnGradScheme<TYPE, POLYNOMIAL, STENCIL>> \
|
||||
add##SS##STENCIL##TYPE##MeshConstructorToTable_; \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ public:
|
||||
{ \
|
||||
namespace fv \
|
||||
{ \
|
||||
snGradScheme<Type>::addMeshConstructorToTable<SS<Type>> \
|
||||
snGradScheme<Type>::addMeshConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##MeshConstructorToTable_; \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ public:
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
|
||||
\
|
||||
interpolation<Type>::adddictionaryConstructorToTable<SS<Type>> \
|
||||
interpolation<Type>::adddictionaryConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##ConstructorToTable_;
|
||||
|
||||
|
||||
|
||||
@ -148,85 +148,85 @@ public:
|
||||
// Add the patch constructor functions to the hash tables
|
||||
|
||||
#define makeLimitedSurfaceInterpolationTypeScheme\
|
||||
( \
|
||||
SS, \
|
||||
LIMITER, \
|
||||
NVDTVD, \
|
||||
LIMFUNC, \
|
||||
TYPE \
|
||||
) \
|
||||
\
|
||||
typedef LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC> \
|
||||
LimitedScheme##TYPE##LIMITER##NVDTVD##LIMFUNC##_; \
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
(LimitedScheme##TYPE##LIMITER##NVDTVD##LIMFUNC##_, #SS, 0); \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC>> \
|
||||
add##SS##LIMFUNC##TYPE##MeshConstructorToTable_; \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC>> \
|
||||
add##SS##LIMFUNC##TYPE##MeshFluxConstructorToTable_; \
|
||||
\
|
||||
limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC>> \
|
||||
add##SS##LIMFUNC##TYPE##MeshConstructorToLimitedTable_; \
|
||||
\
|
||||
limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC>> \
|
||||
( \
|
||||
SS, \
|
||||
LIMITER, \
|
||||
NVDTVD, \
|
||||
LIMFUNC, \
|
||||
TYPE \
|
||||
) \
|
||||
\
|
||||
typedef LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC> \
|
||||
LimitedScheme##TYPE##LIMITER##NVDTVD##LIMFUNC##_; \
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
(LimitedScheme##TYPE##LIMITER##NVDTVD##LIMFUNC##_, #SS, 0); \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC>> \
|
||||
add##SS##LIMFUNC##TYPE##MeshConstructorToTable_; \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC>> \
|
||||
add##SS##LIMFUNC##TYPE##MeshFluxConstructorToTable_; \
|
||||
\
|
||||
limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC>> \
|
||||
add##SS##LIMFUNC##TYPE##MeshConstructorToLimitedTable_; \
|
||||
\
|
||||
limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<LimitedScheme<TYPE, LIMITER<NVDTVD>, limitFuncs::LIMFUNC>> \
|
||||
add##SS##LIMFUNC##TYPE##MeshFluxConstructorToLimitedTable_;
|
||||
|
||||
|
||||
#define makeLimitedSurfaceInterpolationScheme(SS, LIMITER) \
|
||||
\
|
||||
makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,scalar) \
|
||||
makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,vector) \
|
||||
makeLimitedSurfaceInterpolationTypeScheme \
|
||||
( \
|
||||
SS, \
|
||||
LIMITER, \
|
||||
NVDTVD, \
|
||||
magSqr, \
|
||||
sphericalTensor \
|
||||
) \
|
||||
#define makeLimitedSurfaceInterpolationScheme(SS, LIMITER) \
|
||||
\
|
||||
makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,scalar) \
|
||||
makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,vector) \
|
||||
makeLimitedSurfaceInterpolationTypeScheme \
|
||||
( \
|
||||
SS, \
|
||||
LIMITER, \
|
||||
NVDTVD, \
|
||||
magSqr, \
|
||||
sphericalTensor \
|
||||
) \
|
||||
makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,symmTensor)\
|
||||
makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,tensor)
|
||||
|
||||
|
||||
#define makeLimitedVSurfaceInterpolationScheme(SS, LIMITER) \
|
||||
#define makeLimitedVSurfaceInterpolationScheme(SS, LIMITER) \
|
||||
makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDVTVDV,null,vector)
|
||||
|
||||
|
||||
#define makeLLimitedSurfaceInterpolationTypeScheme\
|
||||
( \
|
||||
SS, \
|
||||
LLIMITER, \
|
||||
LIMITER, \
|
||||
NVDTVD, \
|
||||
LIMFUNC, \
|
||||
TYPE \
|
||||
) \
|
||||
\
|
||||
typedef LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC> \
|
||||
LimitedScheme##TYPE##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_; \
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
(LimitedScheme##TYPE##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_, #SS, 0); \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC>> \
|
||||
add##SS##LIMFUNC##TYPE##MeshConstructorToTable_; \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC>> \
|
||||
add##SS##LIMFUNC##TYPE##MeshFluxConstructorToTable_; \
|
||||
\
|
||||
limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC>> \
|
||||
add##SS##LIMFUNC##TYPE##MeshConstructorToLimitedTable_; \
|
||||
\
|
||||
limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC>> \
|
||||
( \
|
||||
SS, \
|
||||
LLIMITER, \
|
||||
LIMITER, \
|
||||
NVDTVD, \
|
||||
LIMFUNC, \
|
||||
TYPE \
|
||||
) \
|
||||
\
|
||||
typedef LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC> \
|
||||
LimitedScheme##TYPE##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_; \
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
(LimitedScheme##TYPE##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_, #SS, 0); \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC>> \
|
||||
add##SS##LIMFUNC##TYPE##MeshConstructorToTable_; \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC>> \
|
||||
add##SS##LIMFUNC##TYPE##MeshFluxConstructorToTable_; \
|
||||
\
|
||||
limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC>> \
|
||||
add##SS##LIMFUNC##TYPE##MeshConstructorToLimitedTable_; \
|
||||
\
|
||||
limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<LimitedScheme<TYPE, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC>> \
|
||||
add##SS##LIMFUNC##TYPE##MeshFluxConstructorToLimitedTable_;
|
||||
|
||||
|
||||
|
||||
@ -141,13 +141,13 @@ typedef PhiScheme<TYPE, WEIGHT> Phischeme##WEIGHT_; \
|
||||
defineTemplateTypeNameAndDebugWithName(Phischeme##WEIGHT_, #SS, 0); \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshConstructorToTable_; \
|
||||
<PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshConstructorToTable_; \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshFluxConstructorToTable_; \
|
||||
<PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshFluxConstructorToTable_; \
|
||||
\
|
||||
limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshConstructorToLimitedTable_; \
|
||||
<PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshConstructorToLimitedTable_; \
|
||||
\
|
||||
limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshFluxConstructorToLimitedTable_;
|
||||
|
||||
@ -204,17 +204,17 @@ public:
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
|
||||
\
|
||||
surfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type>> \
|
||||
surfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##MeshConstructorToTable_; \
|
||||
\
|
||||
surfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type>> \
|
||||
surfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##MeshFluxConstructorToTable_; \
|
||||
\
|
||||
limitedSurfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type>> \
|
||||
limitedSurfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##MeshConstructorToLimitedTable_; \
|
||||
\
|
||||
limitedSurfaceInterpolationScheme<Type>:: \
|
||||
addMeshFluxConstructorToTable<SS<Type>> \
|
||||
addMeshFluxConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##MeshFluxConstructorToLimitedTable_;
|
||||
|
||||
#define makelimitedSurfaceInterpolationScheme(SS) \
|
||||
|
||||
@ -32,24 +32,24 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeBaseLimitedSurfaceInterpolationScheme(Type) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug \
|
||||
( \
|
||||
limitedSurfaceInterpolationScheme<Type>, \
|
||||
0 \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
limitedSurfaceInterpolationScheme<Type>, \
|
||||
Mesh \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
limitedSurfaceInterpolationScheme<Type>, \
|
||||
MeshFlux \
|
||||
#define makeBaseLimitedSurfaceInterpolationScheme(Type) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug \
|
||||
( \
|
||||
limitedSurfaceInterpolationScheme<Type>, \
|
||||
0 \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
limitedSurfaceInterpolationScheme<Type>, \
|
||||
Mesh \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
limitedSurfaceInterpolationScheme<Type>, \
|
||||
MeshFlux \
|
||||
);
|
||||
|
||||
makeBaseLimitedSurfaceInterpolationScheme(scalar)
|
||||
|
||||
@ -181,7 +181,7 @@ multivariateSurfaceInterpolationScheme<scalar>::addIstreamConstructorToTable \
|
||||
typedef multivariateScheme \
|
||||
< \
|
||||
scalar, \
|
||||
LimitedScheme<scalar, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC> \
|
||||
LimitedScheme<scalar, LLIMITER<LIMITER<NVDTVD>>, limitFuncs::LIMFUNC> \
|
||||
> \
|
||||
multivariateScheme##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_; \
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
|
||||
@ -212,7 +212,7 @@ public:
|
||||
defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
|
||||
\
|
||||
multivariateSurfaceInterpolationScheme<Type>:: \
|
||||
addIstreamConstructorToTable<SS<Type>> \
|
||||
addIstreamConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##ConstructorToTable_;
|
||||
|
||||
|
||||
|
||||
@ -148,37 +148,37 @@ public:
|
||||
// Add the patch constructor functions to the hash tables
|
||||
|
||||
#define makeCentredFitSurfaceInterpolationTypeScheme\
|
||||
( \
|
||||
SS, \
|
||||
POLYNOMIAL, \
|
||||
STENCIL, \
|
||||
TYPE \
|
||||
) \
|
||||
\
|
||||
typedef CentredFitScheme<TYPE, POLYNOMIAL, STENCIL> \
|
||||
CentredFitScheme##TYPE##POLYNOMIAL##STENCIL##_; \
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
(CentredFitScheme##TYPE##POLYNOMIAL##STENCIL##_, #SS, 0); \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<CentredFitScheme<TYPE, POLYNOMIAL, STENCIL>> \
|
||||
add##SS##STENCIL##TYPE##MeshConstructorToTable_; \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<CentredFitScheme<TYPE, POLYNOMIAL, STENCIL>> \
|
||||
( \
|
||||
SS, \
|
||||
POLYNOMIAL, \
|
||||
STENCIL, \
|
||||
TYPE \
|
||||
) \
|
||||
\
|
||||
typedef CentredFitScheme<TYPE, POLYNOMIAL, STENCIL> \
|
||||
CentredFitScheme##TYPE##POLYNOMIAL##STENCIL##_; \
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
(CentredFitScheme##TYPE##POLYNOMIAL##STENCIL##_, #SS, 0); \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<CentredFitScheme<TYPE, POLYNOMIAL, STENCIL>> \
|
||||
add##SS##STENCIL##TYPE##MeshConstructorToTable_; \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<CentredFitScheme<TYPE, POLYNOMIAL, STENCIL>> \
|
||||
add##SS##STENCIL##TYPE##MeshFluxConstructorToTable_;
|
||||
|
||||
#define makeCentredFitSurfaceInterpolationScheme(SS, POLYNOMIAL, STENCIL) \
|
||||
\
|
||||
makeCentredFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,scalar) \
|
||||
makeCentredFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,vector) \
|
||||
makeCentredFitSurfaceInterpolationTypeScheme \
|
||||
( \
|
||||
SS, \
|
||||
POLYNOMIAL, \
|
||||
STENCIL, \
|
||||
sphericalTensor \
|
||||
) \
|
||||
#define makeCentredFitSurfaceInterpolationScheme(SS, POLYNOMIAL, STENCIL) \
|
||||
\
|
||||
makeCentredFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,scalar) \
|
||||
makeCentredFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,vector) \
|
||||
makeCentredFitSurfaceInterpolationTypeScheme \
|
||||
( \
|
||||
SS, \
|
||||
POLYNOMIAL, \
|
||||
STENCIL, \
|
||||
sphericalTensor \
|
||||
) \
|
||||
makeCentredFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,symmTensor)\
|
||||
makeCentredFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,tensor)
|
||||
|
||||
|
||||
@ -155,44 +155,44 @@ public:
|
||||
// Add the patch constructor functions to the hash tables
|
||||
|
||||
#define makePureUpwindFitSurfaceInterpolationTypeScheme\
|
||||
( \
|
||||
SS, \
|
||||
POLYNOMIAL, \
|
||||
STENCIL, \
|
||||
TYPE \
|
||||
) \
|
||||
\
|
||||
typedef PureUpwindFitScheme<TYPE, POLYNOMIAL, STENCIL> \
|
||||
PureUpwindFitScheme##TYPE##POLYNOMIAL##STENCIL##_; \
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
(PureUpwindFitScheme##TYPE##POLYNOMIAL##STENCIL##_, #SS, 0); \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<PureUpwindFitScheme<TYPE, POLYNOMIAL, STENCIL>> \
|
||||
add##SS##STENCIL##TYPE##MeshConstructorToTable_; \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<PureUpwindFitScheme<TYPE, POLYNOMIAL, STENCIL>> \
|
||||
( \
|
||||
SS, \
|
||||
POLYNOMIAL, \
|
||||
STENCIL, \
|
||||
TYPE \
|
||||
) \
|
||||
\
|
||||
typedef PureUpwindFitScheme<TYPE, POLYNOMIAL, STENCIL> \
|
||||
PureUpwindFitScheme##TYPE##POLYNOMIAL##STENCIL##_; \
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
(PureUpwindFitScheme##TYPE##POLYNOMIAL##STENCIL##_, #SS, 0); \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<PureUpwindFitScheme<TYPE, POLYNOMIAL, STENCIL>> \
|
||||
add##SS##STENCIL##TYPE##MeshConstructorToTable_; \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<PureUpwindFitScheme<TYPE, POLYNOMIAL, STENCIL>> \
|
||||
add##SS##STENCIL##TYPE##MeshFluxConstructorToTable_;
|
||||
|
||||
#define makePureUpwindFitSurfaceInterpolationScheme(SS, POLYNOMIAL, STENCIL) \
|
||||
\
|
||||
#define makePureUpwindFitSurfaceInterpolationScheme(SS, POLYNOMIAL, STENCIL) \
|
||||
\
|
||||
makePureUpwindFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,scalar) \
|
||||
makePureUpwindFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,vector) \
|
||||
makePureUpwindFitSurfaceInterpolationTypeScheme \
|
||||
( \
|
||||
SS, \
|
||||
POLYNOMIAL, \
|
||||
STENCIL, \
|
||||
sphericalTensor \
|
||||
) \
|
||||
makePureUpwindFitSurfaceInterpolationTypeScheme \
|
||||
( \
|
||||
SS, \
|
||||
POLYNOMIAL, \
|
||||
STENCIL, \
|
||||
symmTensor \
|
||||
) \
|
||||
makePureUpwindFitSurfaceInterpolationTypeScheme \
|
||||
( \
|
||||
SS, \
|
||||
POLYNOMIAL, \
|
||||
STENCIL, \
|
||||
sphericalTensor \
|
||||
) \
|
||||
makePureUpwindFitSurfaceInterpolationTypeScheme \
|
||||
( \
|
||||
SS, \
|
||||
POLYNOMIAL, \
|
||||
STENCIL, \
|
||||
symmTensor \
|
||||
) \
|
||||
makePureUpwindFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,tensor)
|
||||
|
||||
|
||||
|
||||
@ -159,37 +159,37 @@ public:
|
||||
// Add the patch constructor functions to the hash tables
|
||||
|
||||
#define makeUpwindFitSurfaceInterpolationTypeScheme\
|
||||
( \
|
||||
SS, \
|
||||
POLYNOMIAL, \
|
||||
STENCIL, \
|
||||
TYPE \
|
||||
) \
|
||||
\
|
||||
typedef UpwindFitScheme<TYPE, POLYNOMIAL, STENCIL> \
|
||||
UpwindFitScheme##TYPE##POLYNOMIAL##STENCIL##_; \
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
(UpwindFitScheme##TYPE##POLYNOMIAL##STENCIL##_, #SS, 0); \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<UpwindFitScheme<TYPE, POLYNOMIAL, STENCIL>> \
|
||||
add##SS##STENCIL##TYPE##MeshConstructorToTable_; \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<UpwindFitScheme<TYPE, POLYNOMIAL, STENCIL>> \
|
||||
( \
|
||||
SS, \
|
||||
POLYNOMIAL, \
|
||||
STENCIL, \
|
||||
TYPE \
|
||||
) \
|
||||
\
|
||||
typedef UpwindFitScheme<TYPE, POLYNOMIAL, STENCIL> \
|
||||
UpwindFitScheme##TYPE##POLYNOMIAL##STENCIL##_; \
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
(UpwindFitScheme##TYPE##POLYNOMIAL##STENCIL##_, #SS, 0); \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
|
||||
<UpwindFitScheme<TYPE, POLYNOMIAL, STENCIL>> \
|
||||
add##SS##STENCIL##TYPE##MeshConstructorToTable_; \
|
||||
\
|
||||
surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
|
||||
<UpwindFitScheme<TYPE, POLYNOMIAL, STENCIL>> \
|
||||
add##SS##STENCIL##TYPE##MeshFluxConstructorToTable_;
|
||||
|
||||
#define makeUpwindFitSurfaceInterpolationScheme(SS, POLYNOMIAL, STENCIL) \
|
||||
\
|
||||
makeUpwindFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,scalar) \
|
||||
makeUpwindFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,vector) \
|
||||
makeUpwindFitSurfaceInterpolationTypeScheme \
|
||||
( \
|
||||
SS, \
|
||||
POLYNOMIAL, \
|
||||
STENCIL, \
|
||||
sphericalTensor \
|
||||
) \
|
||||
#define makeUpwindFitSurfaceInterpolationScheme(SS, POLYNOMIAL, STENCIL) \
|
||||
\
|
||||
makeUpwindFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,scalar) \
|
||||
makeUpwindFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,vector) \
|
||||
makeUpwindFitSurfaceInterpolationTypeScheme \
|
||||
( \
|
||||
SS, \
|
||||
POLYNOMIAL, \
|
||||
STENCIL, \
|
||||
sphericalTensor \
|
||||
) \
|
||||
makeUpwindFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,symmTensor) \
|
||||
makeUpwindFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,tensor)
|
||||
|
||||
|
||||
@ -213,10 +213,10 @@ public:
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
|
||||
\
|
||||
surfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type>> \
|
||||
surfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##MeshConstructorToTable_; \
|
||||
\
|
||||
surfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type>> \
|
||||
surfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##MeshFluxConstructorToTable_;
|
||||
|
||||
#define makeSurfaceInterpolationScheme(SS) \
|
||||
|
||||
@ -32,20 +32,20 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeBaseSurfaceInterpolationScheme(Type) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(surfaceInterpolationScheme<Type>, 0); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
surfaceInterpolationScheme<Type>, \
|
||||
Mesh \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
surfaceInterpolationScheme<Type>, \
|
||||
MeshFlux \
|
||||
#define makeBaseSurfaceInterpolationScheme(Type) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(surfaceInterpolationScheme<Type>, 0); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
surfaceInterpolationScheme<Type>, \
|
||||
Mesh \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
surfaceInterpolationScheme<Type>, \
|
||||
MeshFlux \
|
||||
);
|
||||
|
||||
makeBaseSurfaceInterpolationScheme(scalar)
|
||||
|
||||
@ -151,27 +151,27 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeBinaryCollisionModel(CloudType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug \
|
||||
( \
|
||||
BinaryCollisionModel<CloudType>, \
|
||||
0 \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
BinaryCollisionModel<CloudType>, \
|
||||
dictionary \
|
||||
#define makeBinaryCollisionModel(CloudType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug \
|
||||
( \
|
||||
BinaryCollisionModel<CloudType>, \
|
||||
0 \
|
||||
); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
BinaryCollisionModel<CloudType>, \
|
||||
dictionary \
|
||||
);
|
||||
|
||||
|
||||
#define makeBinaryCollisionModelType(SS, CloudType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \
|
||||
\
|
||||
BinaryCollisionModel<CloudType>:: \
|
||||
adddictionaryConstructorToTable<SS<CloudType>> \
|
||||
#define makeBinaryCollisionModelType(SS, CloudType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \
|
||||
\
|
||||
BinaryCollisionModel<CloudType>:: \
|
||||
adddictionaryConstructorToTable<SS<CloudType>> \
|
||||
add##SS##CloudType##ConstructorToTable_;
|
||||
|
||||
|
||||
|
||||
@ -141,23 +141,23 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeInflowBoundaryModel(CloudType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(InflowBoundaryModel<CloudType>, 0); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
InflowBoundaryModel<CloudType>, \
|
||||
dictionary \
|
||||
#define makeInflowBoundaryModel(CloudType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(InflowBoundaryModel<CloudType>, 0); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
InflowBoundaryModel<CloudType>, \
|
||||
dictionary \
|
||||
);
|
||||
|
||||
|
||||
#define makeInflowBoundaryModelType(SS, CloudType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \
|
||||
\
|
||||
InflowBoundaryModel<CloudType>:: \
|
||||
adddictionaryConstructorToTable<SS<CloudType>> \
|
||||
#define makeInflowBoundaryModelType(SS, CloudType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \
|
||||
\
|
||||
InflowBoundaryModel<CloudType>:: \
|
||||
adddictionaryConstructorToTable<SS<CloudType>> \
|
||||
add##SS##CloudType##ConstructorToTable_;
|
||||
|
||||
|
||||
|
||||
@ -141,23 +141,23 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeWallInteractionModel(CloudType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(WallInteractionModel<CloudType>, 0); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
WallInteractionModel<CloudType>, \
|
||||
dictionary \
|
||||
#define makeWallInteractionModel(CloudType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(WallInteractionModel<CloudType>, 0); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
WallInteractionModel<CloudType>, \
|
||||
dictionary \
|
||||
);
|
||||
|
||||
|
||||
#define makeWallInteractionModelType(SS, CloudType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \
|
||||
\
|
||||
WallInteractionModel<CloudType>:: \
|
||||
adddictionaryConstructorToTable<SS<CloudType>> \
|
||||
#define makeWallInteractionModelType(SS, CloudType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \
|
||||
\
|
||||
WallInteractionModel<CloudType>:: \
|
||||
adddictionaryConstructorToTable<SS<CloudType>> \
|
||||
add##SS##CloudType##ConstructorToTable_;
|
||||
|
||||
|
||||
|
||||
@ -39,23 +39,23 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define DefinePropertyList(str) \
|
||||
\
|
||||
static string propertyList_; \
|
||||
\
|
||||
static string propertyList() \
|
||||
{ \
|
||||
return str; \
|
||||
#define DefinePropertyList(str) \
|
||||
\
|
||||
static string propertyList_; \
|
||||
\
|
||||
static string propertyList() \
|
||||
{ \
|
||||
return str; \
|
||||
}
|
||||
|
||||
|
||||
#define AddToPropertyList(ParcelType, str) \
|
||||
\
|
||||
static string propertyList_; \
|
||||
\
|
||||
static string propertyList() \
|
||||
{ \
|
||||
return ParcelType::propertyList() + str; \
|
||||
#define AddToPropertyList(ParcelType, str) \
|
||||
\
|
||||
static string propertyList_; \
|
||||
\
|
||||
static string propertyList() \
|
||||
{ \
|
||||
return ParcelType::propertyList() + str; \
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -37,16 +37,16 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeCoalParcelSurfaceReactionModels(CloudType) \
|
||||
\
|
||||
makeSurfaceReactionModelType(COxidationDiffusionLimitedRate, CloudType); \
|
||||
makeSurfaceReactionModelType \
|
||||
( \
|
||||
COxidationKineticDiffusionLimitedRate, \
|
||||
CloudType \
|
||||
); \
|
||||
makeSurfaceReactionModelType(COxidationIntrinsicRate, CloudType); \
|
||||
makeSurfaceReactionModelType(COxidationHurtMitchell, CloudType); \
|
||||
#define makeCoalParcelSurfaceReactionModels(CloudType) \
|
||||
\
|
||||
makeSurfaceReactionModelType(COxidationDiffusionLimitedRate, CloudType); \
|
||||
makeSurfaceReactionModelType \
|
||||
( \
|
||||
COxidationKineticDiffusionLimitedRate, \
|
||||
CloudType \
|
||||
); \
|
||||
makeSurfaceReactionModelType(COxidationIntrinsicRate, CloudType); \
|
||||
makeSurfaceReactionModelType(COxidationHurtMitchell, CloudType); \
|
||||
makeSurfaceReactionModelType(COxidationMurphyShaddix, CloudType);
|
||||
|
||||
|
||||
|
||||
@ -190,22 +190,22 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeIntegrationScheme(Type) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(IntegrationScheme<Type>, 0); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
IntegrationScheme<Type>, \
|
||||
dictionary \
|
||||
#define makeIntegrationScheme(Type) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(IntegrationScheme<Type>, 0); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
IntegrationScheme<Type>, \
|
||||
dictionary \
|
||||
);
|
||||
|
||||
|
||||
#define makeIntegrationSchemeType(SS, Type) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
|
||||
\
|
||||
IntegrationScheme<Type>::adddictionaryConstructorToTable<SS<Type>> \
|
||||
#define makeIntegrationSchemeType(SS, Type) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
|
||||
\
|
||||
IntegrationScheme<Type>::adddictionaryConstructorToTable<SS<Type>> \
|
||||
add##SS##Type##ConstructorToTable_;
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user