diff --git a/src/OpenFOAM/primitives/DiagTensor/diagTensor/diagTensor.C b/src/OpenFOAM/primitives/DiagTensor/diagTensor/diagTensor.C index 3466da0700..38ef499099 100644 --- a/src/OpenFOAM/primitives/DiagTensor/diagTensor/diagTensor.C +++ b/src/OpenFOAM/primitives/DiagTensor/diagTensor/diagTensor.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,5 +75,11 @@ const Foam::diagTensor Foam::diagTensor::vsType::rootMin diagTensor::uniform(-rootVGreat) ); +template<> +const Foam::diagTensor Foam::diagTensor::vsType::nan +( + diagTensor::uniform(NaN) +); + // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/Scalar/Scalar.C b/src/OpenFOAM/primitives/Scalar/Scalar.C index 0b5b88293e..fd95cb1a51 100644 --- a/src/OpenFOAM/primitives/Scalar/Scalar.C +++ b/src/OpenFOAM/primitives/Scalar/Scalar.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,6 +37,7 @@ const Scalar pTraits::min = -ScalarVGreat; const Scalar pTraits::max = ScalarVGreat; const Scalar pTraits::rootMin = -ScalarRootVGreat; const Scalar pTraits::rootMax = ScalarRootVGreat; +const Scalar pTraits::nan = ScalarNaN; const char* const pTraits::componentNames[] = { "" }; diff --git a/src/OpenFOAM/primitives/Scalar/Scalar.H b/src/OpenFOAM/primitives/Scalar/Scalar.H index dc915c0bfc..cc08918f34 100644 --- a/src/OpenFOAM/primitives/Scalar/Scalar.H +++ b/src/OpenFOAM/primitives/Scalar/Scalar.H @@ -76,6 +76,7 @@ public: static const Scalar min; static const Scalar rootMax; static const Scalar rootMin; + static const Scalar nan; // Constructors diff --git a/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.C b/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.C index 51f200dde9..bb64bed8a7 100644 --- a/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.C +++ b/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,6 +35,7 @@ License #define ScalarVSmall doubleScalarVSmall #define ScalarRootVGreat doubleScalarRootVGreat #define ScalarRootVSmall doubleScalarRootVSmall +#define ScalarNaN doubleScalarNaN #define readScalar readDoubleScalar #include "Scalar.C" #undef Scalar @@ -42,6 +43,7 @@ License #undef ScalarVSmall #undef ScalarRootVGreat #undef ScalarRootVSmall +#undef ScalarNaN #undef readScalar // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H b/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H index fb5620d7ef..9e37681191 100644 --- a/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H +++ b/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,6 +85,7 @@ inline bool readScalar(const char* buf, doubleScalar& s) #define ScalarVSmall doubleScalarVSmall #define ScalarRootVGreat doubleScalarRootVGreat #define ScalarRootVSmall doubleScalarRootVSmall +#define ScalarNaN doubleScalarNaN #define readScalar readDoubleScalar inline Scalar mag(const Scalar s) @@ -158,6 +159,7 @@ inline Scalar yn(const int n, const Scalar s) #undef ScalarVSmall #undef ScalarRootVGreat #undef ScalarRootVSmall +#undef ScalarNaN #undef readScalar #undef transFunc diff --git a/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.C b/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.C index 68c6505284..bda5978f7b 100644 --- a/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.C +++ b/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,6 +35,7 @@ License #define ScalarVSmall floatScalarVSmall #define ScalarRootVGreat floatScalarRootVGreat #define ScalarRootVSmall floatScalarRootVSmall +#define ScalarNaN floatScalarNaN #define readScalar readFloatScalar #include "Scalar.C" #undef Scalar @@ -42,6 +43,7 @@ License #undef ScalarVSmall #undef ScalarRootVGreat #undef ScalarRootVSmall +#undef ScalarNaN #undef readScalar // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H b/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H index 3714510d0e..c97fccfdc3 100644 --- a/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H +++ b/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,6 +85,7 @@ inline bool readScalar(const char* buf, floatScalar& s) #define ScalarVSmall floatScalarVSmall #define ScalarRootVGreat floatScalarRootVGreat #define ScalarRootVSmall floatScalarRootVSmall +#define ScalarNaN floatScalarNaN #define readScalar readFloatScalar inline Scalar mag(const Scalar s) @@ -157,6 +158,7 @@ inline Scalar yn(const int n, const Scalar s) #undef ScalarVSmall #undef ScalarRootVGreat #undef ScalarRootVSmall +#undef ScalarNaN #undef readScalar #undef transFunc diff --git a/src/OpenFOAM/primitives/Scalar/longDoubleScalar/longDoubleScalar.C b/src/OpenFOAM/primitives/Scalar/longDoubleScalar/longDoubleScalar.C index 4f5b993eb7..1df33ff74c 100644 --- a/src/OpenFOAM/primitives/Scalar/longDoubleScalar/longDoubleScalar.C +++ b/src/OpenFOAM/primitives/Scalar/longDoubleScalar/longDoubleScalar.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,6 +35,7 @@ License #define ScalarVSmall longDoubleScalarVSmall #define ScalarRootVGreat longDoubleScalarRootVGreat #define ScalarRootVSmall longDoubleScalarRootVSmall +#define ScalarNaN longDoubleScalarNaN #define readScalar readLongDoubleScalar #include "Scalar.C" #undef Scalar @@ -42,6 +43,7 @@ License #undef ScalarVSmall #undef ScalarRootVGreat #undef ScalarRootVSmall +#undef ScalarNaN #undef readScalar // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/Scalar/longDoubleScalar/longDoubleScalar.H b/src/OpenFOAM/primitives/Scalar/longDoubleScalar/longDoubleScalar.H index 86a3197b70..b886589722 100644 --- a/src/OpenFOAM/primitives/Scalar/longDoubleScalar/longDoubleScalar.H +++ b/src/OpenFOAM/primitives/Scalar/longDoubleScalar/longDoubleScalar.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -89,6 +89,7 @@ inline bool readScalar(const char* buf, longDoubleScalar& s) #define ScalarVSmall longDoubleScalarVSmall #define ScalarRootVGreat longDoubleScalarRootVGreat #define ScalarRootVSmall longDoubleScalarRootVSmall +#define ScalarNaN longDoubleScalarNaN #define readScalar readLongDoubleScalar inline Scalar mag(const Scalar s) @@ -163,6 +164,7 @@ inline Scalar yn(const int n, const Scalar s) #undef ScalarVSmall #undef ScalarRootVGreat #undef ScalarRootVSmall +#undef ScalarNaN #undef readScalar #undef transFunc diff --git a/src/OpenFOAM/primitives/SphericalTensor/labelSphericalTensor/labelSphericalTensor.C b/src/OpenFOAM/primitives/SphericalTensor/labelSphericalTensor/labelSphericalTensor.C index 11ac4f929a..5e6c41cc46 100644 --- a/src/OpenFOAM/primitives/SphericalTensor/labelSphericalTensor/labelSphericalTensor.C +++ b/src/OpenFOAM/primitives/SphericalTensor/labelSphericalTensor/labelSphericalTensor.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,18 +64,6 @@ const Foam::labelSphericalTensor Foam::labelSphericalTensor::vsType::min labelSphericalTensor::uniform(-labelMax) ); -template<> -const Foam::labelSphericalTensor Foam::labelSphericalTensor::vsType::rootMax -( - labelSphericalTensor::uniform(sqrt(scalar(labelMax))) -); - -template<> -const Foam::labelSphericalTensor Foam::labelSphericalTensor::vsType::rootMin -( - labelSphericalTensor::uniform(-sqrt(scalar(labelMax))) -); - template<> const Foam::labelSphericalTensor Foam::labelSphericalTensor::I(1); diff --git a/src/OpenFOAM/primitives/SphericalTensor/sphericalTensor/sphericalTensor.C b/src/OpenFOAM/primitives/SphericalTensor/sphericalTensor/sphericalTensor.C index f2c91f9fcb..a67dcf3bd0 100644 --- a/src/OpenFOAM/primitives/SphericalTensor/sphericalTensor/sphericalTensor.C +++ b/src/OpenFOAM/primitives/SphericalTensor/sphericalTensor/sphericalTensor.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,6 +69,12 @@ const Foam::sphericalTensor Foam::sphericalTensor::vsType::rootMin sphericalTensor::uniform(-rootVGreat) ); +template<> +const Foam::sphericalTensor Foam::sphericalTensor::vsType::nan +( + sphericalTensor::uniform(NaN) +); + template<> const Foam::sphericalTensor Foam::sphericalTensor::I(1); diff --git a/src/OpenFOAM/primitives/SphericalTensor2D/sphericalTensor2D/sphericalTensor2D.C b/src/OpenFOAM/primitives/SphericalTensor2D/sphericalTensor2D/sphericalTensor2D.C index 03196e6248..6208570676 100644 --- a/src/OpenFOAM/primitives/SphericalTensor2D/sphericalTensor2D/sphericalTensor2D.C +++ b/src/OpenFOAM/primitives/SphericalTensor2D/sphericalTensor2D/sphericalTensor2D.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,6 +75,12 @@ const Foam::sphericalTensor2D Foam::sphericalTensor2D::vsType::rootMin sphericalTensor2D::uniform(-rootVGreat) ); +template<> +const Foam::sphericalTensor2D Foam::sphericalTensor2D::vsType::nan +( + sphericalTensor2D::uniform(NaN) +); + template<> const Foam::sphericalTensor2D Foam::sphericalTensor2D::I(1); diff --git a/src/OpenFOAM/primitives/SymmTensor/labelSymmTensor/labelSymmTensor.C b/src/OpenFOAM/primitives/SymmTensor/labelSymmTensor/labelSymmTensor.C index f71026b4d4..e432f29b92 100644 --- a/src/OpenFOAM/primitives/SymmTensor/labelSymmTensor/labelSymmTensor.C +++ b/src/OpenFOAM/primitives/SymmTensor/labelSymmTensor/labelSymmTensor.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -62,18 +62,6 @@ const Foam::labelSymmTensor Foam::labelSymmTensor::vsType::min labelSymmTensor::uniform(-labelMax) ); -template<> -const Foam::labelSymmTensor Foam::labelSymmTensor::vsType::rootMax -( - labelSymmTensor::uniform(sqrt(scalar(labelMax))) -); - -template<> -const Foam::labelSymmTensor Foam::labelSymmTensor::vsType::rootMin -( - labelSymmTensor::uniform(-sqrt(scalar(labelMax))) -); - template<> const Foam::labelSymmTensor Foam::labelSymmTensor::I ( diff --git a/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.C b/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.C index e5c1f05e12..764b02d5a9 100644 --- a/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.C +++ b/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,6 +74,12 @@ const Foam::symmTensor Foam::symmTensor::vsType::rootMin symmTensor::uniform(-rootVGreat) ); +template<> +const Foam::symmTensor Foam::symmTensor::vsType::nan +( + symmTensor::uniform(NaN) +); + template<> const Foam::symmTensor Foam::symmTensor::I ( diff --git a/src/OpenFOAM/primitives/SymmTensor2D/symmTensor2D/symmTensor2D.C b/src/OpenFOAM/primitives/SymmTensor2D/symmTensor2D/symmTensor2D.C index b773806a57..f9b3b835da 100644 --- a/src/OpenFOAM/primitives/SymmTensor2D/symmTensor2D/symmTensor2D.C +++ b/src/OpenFOAM/primitives/SymmTensor2D/symmTensor2D/symmTensor2D.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -73,6 +73,12 @@ const Foam::symmTensor2D Foam::symmTensor2D::vsType::rootMin symmTensor2D::uniform(-rootVGreat) ); +template<> +const Foam::symmTensor2D Foam::symmTensor2D::vsType::nan +( + symmTensor2D::uniform(NaN) +); + template<> const Foam::symmTensor2D Foam::symmTensor2D::I ( diff --git a/src/OpenFOAM/primitives/Tensor/floatTensor/floatTensor.C b/src/OpenFOAM/primitives/Tensor/floatTensor/floatTensor.C index d5bf2bc53d..1cb2126118 100644 --- a/src/OpenFOAM/primitives/Tensor/floatTensor/floatTensor.C +++ b/src/OpenFOAM/primitives/Tensor/floatTensor/floatTensor.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,6 +74,12 @@ const Foam::floatTensor Foam::floatTensor::vsType::rootMin floatTensor::uniform(-floatScalarRootVGreat) ); +template<> +const Foam::floatTensor Foam::floatTensor::vsType::nan +( + floatTensor::uniform(-floatScalarNaN) +); + template<> const Foam::floatTensor Foam::floatTensor::I ( diff --git a/src/OpenFOAM/primitives/Tensor/labelTensor/labelTensor.C b/src/OpenFOAM/primitives/Tensor/labelTensor/labelTensor.C index 6f09f480b2..d8e1ef73af 100644 --- a/src/OpenFOAM/primitives/Tensor/labelTensor/labelTensor.C +++ b/src/OpenFOAM/primitives/Tensor/labelTensor/labelTensor.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -63,17 +63,5 @@ const Foam::labelTensor Foam::labelTensor::vsType::min labelTensor::uniform(-labelMax) ); -template<> -const Foam::labelTensor Foam::labelTensor::vsType::rootMax -( - labelTensor::uniform(sqrt(scalar(labelMax))) -); - -template<> -const Foam::labelTensor Foam::labelTensor::vsType::rootMin -( - labelTensor::uniform(-sqrt(scalar(labelMax))) -); - // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/Tensor/tensor/tensor.C b/src/OpenFOAM/primitives/Tensor/tensor/tensor.C index 7c78df2306..ceb2dc14a4 100644 --- a/src/OpenFOAM/primitives/Tensor/tensor/tensor.C +++ b/src/OpenFOAM/primitives/Tensor/tensor/tensor.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,6 +60,9 @@ const Foam::tensor Foam::tensor::vsType::rootMax(tensor::uniform(rootVGreat)); template<> const Foam::tensor Foam::tensor::vsType::rootMin(tensor::uniform(-rootVGreat)); +template<> +const Foam::tensor Foam::tensor::vsType::nan(tensor::uniform(NaN)); + template<> const Foam::tensor Foam::tensor::I ( diff --git a/src/OpenFOAM/primitives/Tensor2D/tensor2D/tensor2D.C b/src/OpenFOAM/primitives/Tensor2D/tensor2D/tensor2D.C index f43faa649d..7a9ec55895 100644 --- a/src/OpenFOAM/primitives/Tensor2D/tensor2D/tensor2D.C +++ b/src/OpenFOAM/primitives/Tensor2D/tensor2D/tensor2D.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,6 +74,12 @@ const Foam::tensor2D Foam::tensor2D::vsType::rootMin tensor2D::uniform(-rootVGreat) ); +template<> +const Foam::tensor2D Foam::tensor2D::vsType::nan +( + tensor2D::uniform(NaN) +); + template<> const Foam::tensor2D Foam::tensor2D::I ( diff --git a/src/OpenFOAM/primitives/Vector/complexVector/complexVector.C b/src/OpenFOAM/primitives/Vector/complexVector/complexVector.C index 7ab895844c..423fa06dfb 100644 --- a/src/OpenFOAM/primitives/Vector/complexVector/complexVector.C +++ b/src/OpenFOAM/primitives/Vector/complexVector/complexVector.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,5 +75,11 @@ const Foam::complexVector Foam::complexVector::vsType::rootMin complexVector::uniform(complex(-rootVGreat, -rootVGreat)) ); +template<> +const Foam::complexVector Foam::complexVector::vsType::nan +( + complexVector::uniform(complex(NaN, NaN)) +); + // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/Vector/floatVector/floatVector.C b/src/OpenFOAM/primitives/Vector/floatVector/floatVector.C index db51f512d9..f63f470fce 100644 --- a/src/OpenFOAM/primitives/Vector/floatVector/floatVector.C +++ b/src/OpenFOAM/primitives/Vector/floatVector/floatVector.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,5 +75,11 @@ const Foam::floatVector Foam::floatVector::vsType::rootMin floatVector::uniform(-floatScalarRootVGreat) ); +template<> +const Foam::floatVector Foam::floatVector::vsType::nan +( + floatVector::uniform(-floatScalarNaN) +); + // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/Vector/labelVector/labelVector.C b/src/OpenFOAM/primitives/Vector/labelVector/labelVector.C index 525ae4a6aa..cbb739c3f8 100644 --- a/src/OpenFOAM/primitives/Vector/labelVector/labelVector.C +++ b/src/OpenFOAM/primitives/Vector/labelVector/labelVector.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,17 +60,5 @@ const Foam::labelVector Foam::labelVector::vsType::min labelVector::uniform(-labelMax) ); -template<> -const Foam::labelVector Foam::labelVector::vsType::rootMax -( - labelVector::uniform(sqrt(scalar(labelMax))) -); - -template<> -const Foam::labelVector Foam::labelVector::vsType::rootMin -( - labelVector::uniform(-sqrt(scalar(labelMax))) -); - // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/Vector/vector/vector.C b/src/OpenFOAM/primitives/Vector/vector/vector.C index fcd4d26f77..13fbd32045 100644 --- a/src/OpenFOAM/primitives/Vector/vector/vector.C +++ b/src/OpenFOAM/primitives/Vector/vector/vector.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,5 +54,8 @@ const Foam::vector Foam::vector::vsType::rootMax(vector::uniform(rootVGreat)); template<> const Foam::vector Foam::vector::vsType::rootMin(vector::uniform(-rootVGreat)); +template<> +const Foam::vector Foam::vector::vsType::nan(vector::uniform(NaN)); + // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/Vector2D/vector2D/vector2D.C b/src/OpenFOAM/primitives/Vector2D/vector2D/vector2D.C index 7c896b0e2c..a3795bf6df 100644 --- a/src/OpenFOAM/primitives/Vector2D/vector2D/vector2D.C +++ b/src/OpenFOAM/primitives/Vector2D/vector2D/vector2D.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,5 +72,11 @@ const Foam::vector2D Foam::vector2D::vsType::rootMin vector2D::uniform(-rootVGreat) ); +template<> +const Foam::vector2D Foam::vector2D::vsType::nan +( + vector2D::uniform(NaN) +); + // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H b/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H index 6d0e8fda2a..1e31a84574 100644 --- a/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H +++ b/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H @@ -122,6 +122,7 @@ public: static const Form min; static const Form rootMax; static const Form rootMin; + static const Form nan; // Sub-Block Classes diff --git a/src/OpenFOAM/primitives/ints/int32/int32.C b/src/OpenFOAM/primitives/ints/int32/int32.C index 1fcdd615fe..424493ecd1 100644 --- a/src/OpenFOAM/primitives/ints/int32/int32.C +++ b/src/OpenFOAM/primitives/ints/int32/int32.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,8 +31,6 @@ const int32_t Foam::pTraits::zero = 0; const int32_t Foam::pTraits::one = 1; const int32_t Foam::pTraits::min = INT32_MIN; const int32_t Foam::pTraits::max = INT32_MAX; -const int32_t Foam::pTraits::rootMin = pTraits::min; -const int32_t Foam::pTraits::rootMax = pTraits::max; const char* const Foam::pTraits::componentNames[] = { "" }; diff --git a/src/OpenFOAM/primitives/ints/int32/int32.H b/src/OpenFOAM/primitives/ints/int32/int32.H index 99db35b697..2fa3df6bff 100644 --- a/src/OpenFOAM/primitives/ints/int32/int32.H +++ b/src/OpenFOAM/primitives/ints/int32/int32.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -110,8 +110,6 @@ public: static const int32_t one; static const int32_t min; static const int32_t max; - static const int32_t rootMax; - static const int32_t rootMin; // Constructors diff --git a/src/OpenFOAM/primitives/ints/int64/int64.C b/src/OpenFOAM/primitives/ints/int64/int64.C index b3202aa0c3..fd08f79a66 100644 --- a/src/OpenFOAM/primitives/ints/int64/int64.C +++ b/src/OpenFOAM/primitives/ints/int64/int64.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,8 +31,6 @@ const int64_t Foam::pTraits::zero = 0; const int64_t Foam::pTraits::one = 1; const int64_t Foam::pTraits::min = INT64_MIN; const int64_t Foam::pTraits::max = INT64_MAX; -const int64_t Foam::pTraits::rootMin = pTraits::min; -const int64_t Foam::pTraits::rootMax = pTraits::max; const char* const Foam::pTraits::componentNames[] = { "" }; diff --git a/src/OpenFOAM/primitives/ints/int64/int64.H b/src/OpenFOAM/primitives/ints/int64/int64.H index a9fe1c743a..c39286b996 100644 --- a/src/OpenFOAM/primitives/ints/int64/int64.H +++ b/src/OpenFOAM/primitives/ints/int64/int64.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -106,8 +106,6 @@ public: static const int64_t one; static const int64_t min; static const int64_t max; - static const int64_t rootMax; - static const int64_t rootMin; // Constructors diff --git a/src/OpenFOAM/primitives/ints/uint32/uint32.C b/src/OpenFOAM/primitives/ints/uint32/uint32.C index c37bfa2eb0..560473c3ea 100644 --- a/src/OpenFOAM/primitives/ints/uint32/uint32.C +++ b/src/OpenFOAM/primitives/ints/uint32/uint32.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,8 +31,6 @@ const uint32_t Foam::pTraits::zero = 0; const uint32_t Foam::pTraits::one = 1; const uint32_t Foam::pTraits::min = 0; const uint32_t Foam::pTraits::max = UINT32_MAX; -const uint32_t Foam::pTraits::rootMin = 0; -const uint32_t Foam::pTraits::rootMax = pTraits::max; const char* const Foam::pTraits::componentNames[] = { "" }; diff --git a/src/OpenFOAM/primitives/ints/uint32/uint32.H b/src/OpenFOAM/primitives/ints/uint32/uint32.H index 1cf74e1127..871c2e78ec 100644 --- a/src/OpenFOAM/primitives/ints/uint32/uint32.H +++ b/src/OpenFOAM/primitives/ints/uint32/uint32.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -96,8 +96,6 @@ public: static const uint32_t one; static const uint32_t min; static const uint32_t max; - static const uint32_t rootMax; - static const uint32_t rootMin; // Constructors diff --git a/src/OpenFOAM/primitives/ints/uint64/uint64.C b/src/OpenFOAM/primitives/ints/uint64/uint64.C index 4163761e43..c3d77ca851 100644 --- a/src/OpenFOAM/primitives/ints/uint64/uint64.C +++ b/src/OpenFOAM/primitives/ints/uint64/uint64.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,8 +31,6 @@ const uint64_t Foam::pTraits::zero = 0; const uint64_t Foam::pTraits::one = 1; const uint64_t Foam::pTraits::min = 0; const uint64_t Foam::pTraits::max = UINT64_MAX; -const uint64_t Foam::pTraits::rootMin = 0; -const uint64_t Foam::pTraits::rootMax = pTraits::max; const char* const Foam::pTraits::componentNames[] = { "" }; diff --git a/src/OpenFOAM/primitives/ints/uint64/uint64.H b/src/OpenFOAM/primitives/ints/uint64/uint64.H index 146e6bd55b..31d2a0aa36 100644 --- a/src/OpenFOAM/primitives/ints/uint64/uint64.H +++ b/src/OpenFOAM/primitives/ints/uint64/uint64.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -100,8 +100,6 @@ public: static const uint64_t one; static const uint64_t min; static const uint64_t max; - static const uint64_t rootMax; - static const uint64_t rootMin; // Constructors diff --git a/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensor/compactSpatialTensor/compactSpatialTensor.C b/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensor/compactSpatialTensor/compactSpatialTensor.C index 58c4131f9c..5d4b0bc479 100644 --- a/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensor/compactSpatialTensor/compactSpatialTensor.C +++ b/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensor/compactSpatialTensor/compactSpatialTensor.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,5 +80,11 @@ const Foam::compactSpatialTensor Foam::compactSpatialTensor::vsType::rootMin compactSpatialTensor::uniform(-rootVGreat) ); +template<> +const Foam::compactSpatialTensor Foam::compactSpatialTensor::vsType::nan +( + compactSpatialTensor::uniform(NaN) +); + // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/spatialVectorAlgebra/SpatialTensor/spatialTensor/spatialTensor.C b/src/OpenFOAM/primitives/spatialVectorAlgebra/SpatialTensor/spatialTensor/spatialTensor.C index 1cfe66ef4d..eae8457062 100644 --- a/src/OpenFOAM/primitives/spatialVectorAlgebra/SpatialTensor/spatialTensor/spatialTensor.C +++ b/src/OpenFOAM/primitives/spatialVectorAlgebra/SpatialTensor/spatialTensor/spatialTensor.C @@ -78,6 +78,12 @@ const Foam::spatialTensor Foam::spatialTensor::vsType::rootMin spatialTensor::uniform(-rootVGreat) ); +template<> +const Foam::spatialTensor Foam::spatialTensor::vsType::nan +( + spatialTensor::uniform(NaN) +); + template<> const Foam::spatialTensor Foam::spatialTensor::I ( diff --git a/src/OpenFOAM/primitives/spatialVectorAlgebra/SpatialVector/spatialVector/spatialVector.C b/src/OpenFOAM/primitives/spatialVectorAlgebra/SpatialVector/spatialVector/spatialVector.C index cac8426f1b..aab55d4d6f 100644 --- a/src/OpenFOAM/primitives/spatialVectorAlgebra/SpatialVector/spatialVector/spatialVector.C +++ b/src/OpenFOAM/primitives/spatialVectorAlgebra/SpatialVector/spatialVector/spatialVector.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,5 +75,11 @@ const Foam::spatialVector Foam::spatialVector::vsType::rootMin spatialVector::uniform(-rootVGreat) ); +template<> +const Foam::spatialVector Foam::spatialVector::vsType::nan +( + spatialVector::uniform(NaN) +); + // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/transform/transformer/transformer.H b/src/OpenFOAM/primitives/transform/transformer/transformer.H index 606676460d..1f62401942 100644 --- a/src/OpenFOAM/primitives/transform/transformer/transformer.H +++ b/src/OpenFOAM/primitives/transform/transformer/transformer.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,7 +122,6 @@ public: static const char* const typeName; static const transformer zero; - static const transformer I; //- Null transformer diff --git a/src/OpenFOAM/primitives/triad/triad.C b/src/OpenFOAM/primitives/triad/triad.C index 1c396e6c26..6ab3753704 100644 --- a/src/OpenFOAM/primitives/triad/triad.C +++ b/src/OpenFOAM/primitives/triad/triad.C @@ -71,6 +71,12 @@ const Foam::Vector Foam::triad::vsType::rootMin triad::uniform(vector::uniform(-rootVGreat)) ); +template<> +const Foam::Vector Foam::triad::vsType::nan +( + triad::uniform(vector::uniform(NaN)) +); + const Foam::triad Foam::triad::I ( vector(1, 0, 0), diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/sixDoFMotion/sixDoFMotion.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/sixDoFMotion/sixDoFMotion.C index 4b90cf8c18..c08b52c862 100644 --- a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/sixDoFMotion/sixDoFMotion.C +++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/sixDoFMotion/sixDoFMotion.C @@ -86,6 +86,9 @@ const trvType trvType::vsType::rootMin trvType::uniform(vector::uniform(-rootVGreat)) ); +template<> +const trvType trvType::vsType::nan(trvType::uniform(vector::uniform(NaN))); + namespace Foam { makeFunction1s(trvType, nullArg); diff --git a/src/fvMeshTopoChangers/meshToMesh/MeshToMeshMapGeometricFields.H b/src/fvMeshTopoChangers/meshToMesh/MeshToMeshMapGeometricFields.H index 3e2ed6544c..0e2e2ab937 100644 --- a/src/fvMeshTopoChangers/meshToMesh/MeshToMeshMapGeometricFields.H +++ b/src/fvMeshTopoChangers/meshToMesh/MeshToMeshMapGeometricFields.H @@ -112,13 +112,6 @@ void NaNGeometricFields { typedef GeometricField GField; - Type NaN; - - for (direction cmpt = 0; cmpt < pTraits::nComponents; cmpt++) - { - setComponent(NaN, cmpt) = std::numeric_limits::signaling_NaN(); - } - UPtrList fields(mesh.curFields()); forAll(fields, i) @@ -137,7 +130,7 @@ void NaNGeometricFields const typename GField::Mesh& mesh = field.mesh(); field.primitiveFieldRef().setSize(GeoMesh::size(mesh)); - field.primitiveFieldRef() = NaN; + field.primitiveFieldRef() = pTraits::nan; field.boundaryFieldRef().setSize(mesh.boundary().size()); @@ -162,7 +155,7 @@ void NaNGeometricFields pf.map(pf, setSizeFieldMapper(pf.patch().size())); } - field.boundaryFieldRef()[patchi] == NaN; + field.boundaryFieldRef()[patchi] == pTraits::nan; } field.instance() = field.time().name(); diff --git a/src/fvModels/derived/sixDoFAcceleration/sixDoFAcceleration.C b/src/fvModels/derived/sixDoFAcceleration/sixDoFAcceleration.C index 556dee4784..a16ed3a262 100644 --- a/src/fvModels/derived/sixDoFAcceleration/sixDoFAcceleration.C +++ b/src/fvModels/derived/sixDoFAcceleration/sixDoFAcceleration.C @@ -85,6 +85,9 @@ const avType avType::vsType::rootMin avType::uniform(vector::uniform(-rootVGreat)) ); +template<> +const avType avType::vsType::nan(avType::uniform(vector::uniform(NaN))); + namespace Foam { makeFunction1s(avType, nullArg); diff --git a/src/meshTools/patchToPatch/intersection/intersectionPatchToPatch.H b/src/meshTools/patchToPatch/intersection/intersectionPatchToPatch.H index 976bf6f346..d9c1a5af3c 100644 --- a/src/meshTools/patchToPatch/intersection/intersectionPatchToPatch.H +++ b/src/meshTools/patchToPatch/intersection/intersectionPatchToPatch.H @@ -75,7 +75,7 @@ public: part() : area(Zero), - centre(patchToPatchTools::NaN()) + centre(pTraits::nan) {} //- Default construct diff --git a/src/meshTools/patchToPatchTools/patchToPatchTools.H b/src/meshTools/patchToPatchTools/patchToPatchTools.H index 4478d6e2ac..e223c7bc9a 100644 --- a/src/meshTools/patchToPatchTools/patchToPatchTools.H +++ b/src/meshTools/patchToPatchTools/patchToPatchTools.H @@ -137,10 +137,6 @@ void rDistributeTgtAddressing List>& tgtLocalSrcFaces ); -//- Return a primitive with all components set to NaN -template -static Type NaN(); - //- Interpolate with normalisation template static tmp> interpolate diff --git a/src/meshTools/patchToPatchTools/patchToPatchToolsTemplates.C b/src/meshTools/patchToPatchTools/patchToPatchToolsTemplates.C index 37cabb2e2c..37a85c254d 100644 --- a/src/meshTools/patchToPatchTools/patchToPatchToolsTemplates.C +++ b/src/meshTools/patchToPatchTools/patchToPatchToolsTemplates.C @@ -82,20 +82,6 @@ void Foam::patchToPatchTools::rDistributeListList } -template -Type Foam::patchToPatchTools::NaN() -{ - Type result; - - for (direction cmpt = 0; cmpt < pTraits::nComponents; cmpt++) - { - setComponent(result, cmpt) = Foam::NaN; - } - - return result; -} - - template Foam::tmp> Foam::patchToPatchTools::interpolate ( @@ -116,7 +102,10 @@ Foam::tmp> Foam::patchToPatchTools::interpolate otherMapPtr.valid() ? tLocalOtherFld() : otherFld; // Allocate the result - tmp> tFld(new Field(localOtherFaces.size(), NaN())); + tmp> tFld + ( + new Field(localOtherFaces.size(), pTraits::nan) + ); Field& fld = tFld.ref(); // Compute the result as a weighted sum @@ -163,7 +152,10 @@ Foam::tmp> Foam::patchToPatchTools::interpolate otherMapPtr.valid() ? tLocalOtherFld() : otherFld; // Allocate the result - tmp> tFld(new Field(localOtherFaces.size(), NaN())); + tmp> tFld + ( + new Field(localOtherFaces.size(), pTraits::nan) + ); Field& fld = tFld.ref(); // Compute the result as a weighted sum