COMP: avoid issues with new compilers and/or new C++ standards

- prevent automatic comparison rewriting (c++20)
- no bitwise operations between different enumerations
- template instantiation

ENH: add DimensionedField Internal typedef (simplifies handling)
This commit is contained in:
Mark Olesen
2023-10-19 10:38:11 +02:00
parent e4745d09ec
commit a7bb8edbad
18 changed files with 130 additions and 114 deletions

View File

@ -262,15 +262,6 @@ public:
//- Region type names
static const Enum<regionTypes> regionTypeNames_;
//- Bitmask values for operation variants
enum operationVariant
{
typeBase = 0, //!< Base operation
typeScalar = 0x100, //!< Operation returns a scalar
typeWeighted = 0x200, //!< Operation using weighting
typeAbsolute = 0x400, //!< Operation using mag (eg, for weighting)
};
//- Operation type enumeration
enum operationType
{
@ -291,10 +282,11 @@ public:
opAreaIntegrate, //!< Area integral
opCoV, //!< Coefficient of variation
// Scalar return values
// Operations returning scalar - bitmask value
typeScalar = 0x100,
//! Area average in normal direction (output is always scalar)
opAreaNormalAverage = typeScalar,
opAreaNormalAverage = (1 | typeScalar),
//! Area integral in normal direction (output is always scalar)
opAreaNormalIntegrate,
@ -303,6 +295,8 @@ public:
opUniformity,
// Weighted variants
// Operations using weighting - bitmask value
typeWeighted = 0x200,
//! Weighted sum
opWeightedSum = (opSum | typeWeighted),
@ -320,6 +314,8 @@ public:
opWeightedUniformity = (opUniformity | typeWeighted),
// Variants using absolute weighting
// Operation using mag (eg, for weighting) - bitmask value
typeAbsolute = 0x400,
//! Sum using abs weighting
opAbsWeightedSum = (opWeightedSum | typeAbsolute),

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2022 OpenCFD Ltd.
Copyright (C) 2015-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -147,6 +147,9 @@ processSameTypeValues
switch (operation_)
{
case opNone:
case typeScalar:
case typeWeighted:
case typeAbsolute:
{
break;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -148,15 +148,6 @@ public:
// Public Data Types
//- Bitmask values for operation variants
enum operationVariant
{
typeBase = 0, //!< Base operation
typeScalar = 0x100, //!< Operation returns a scalar
typeWeighted = 0x200, //!< Operation using weighting
typeAbsolute = 0x400, //!< Operation using mag (eg, for weighting)
};
//- Operation type enumeration
enum operationType
{
@ -172,7 +163,12 @@ public:
opVolIntegrate, //!< Volume integral
opCoV, //!< Coefficient of variation
// Operations returning scalar - bitmask value
typeScalar = 0x100,
// Weighted variants
// Operations using weighting - bitmask value
typeWeighted = 0x200,
//! Weighted sum
opWeightedSum = (opSum | typeWeighted),
@ -187,6 +183,8 @@ public:
opWeightedVolIntegrate = (opVolIntegrate | typeWeighted),
// Variants using absolute weighting
// Operation using mag (eg, for weighting) - bitmask value
typeAbsolute = 0x400,
};
//- Operation type names

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2021 OpenCFD Ltd.
Copyright (C) 2015-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -91,6 +91,9 @@ Type Foam::functionObjects::fieldValues::volFieldValue::processValues
switch (operation_)
{
case opNone:
case typeScalar:
case typeWeighted:
case typeAbsolute:
{
break;
}

View File

@ -131,7 +131,7 @@ class icoUncoupledKinematicCloud
icoUncoupledKinematicCloud(const icoUncoupledKinematicCloud&) = delete;
//- No copy assignment
void operator==(const icoUncoupledKinematicCloud&) = delete;
void operator=(const icoUncoupledKinematicCloud&) = delete;
public: