pTraits: Added nan (not-a-number) to floating point types

This commit is contained in:
Will Bainbridge
2023-11-15 13:23:39 +00:00
parent 7afc28270a
commit 4ce4b5b0f9
44 changed files with 156 additions and 129 deletions

View File

@ -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)
);
// ************************************************************************* //

View File

@ -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<Scalar>::min = -ScalarVGreat;
const Scalar pTraits<Scalar>::max = ScalarVGreat;
const Scalar pTraits<Scalar>::rootMin = -ScalarRootVGreat;
const Scalar pTraits<Scalar>::rootMax = ScalarRootVGreat;
const Scalar pTraits<Scalar>::nan = ScalarNaN;
const char* const pTraits<Scalar>::componentNames[] = { "" };

View File

@ -76,6 +76,7 @@ public:
static const Scalar min;
static const Scalar rootMax;
static const Scalar rootMin;
static const Scalar nan;
// Constructors

View File

@ -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
// ************************************************************************* //

View File

@ -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

View File

@ -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
// ************************************************************************* //

View File

@ -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

View File

@ -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
// ************************************************************************* //

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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
(

View File

@ -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
(

View File

@ -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
(

View File

@ -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
(

View File

@ -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)))
);
// ************************************************************************* //

View File

@ -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
(

View File

@ -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
(

View File

@ -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))
);
// ************************************************************************* //

View File

@ -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)
);
// ************************************************************************* //

View File

@ -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)))
);
// ************************************************************************* //

View File

@ -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));
// ************************************************************************* //

View File

@ -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)
);
// ************************************************************************* //

View File

@ -122,6 +122,7 @@ public:
static const Form min;
static const Form rootMax;
static const Form rootMin;
static const Form nan;
// Sub-Block Classes

View File

@ -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<int32_t>::zero = 0;
const int32_t Foam::pTraits<int32_t>::one = 1;
const int32_t Foam::pTraits<int32_t>::min = INT32_MIN;
const int32_t Foam::pTraits<int32_t>::max = INT32_MAX;
const int32_t Foam::pTraits<int32_t>::rootMin = pTraits<int32_t>::min;
const int32_t Foam::pTraits<int32_t>::rootMax = pTraits<int32_t>::max;
const char* const Foam::pTraits<int32_t>::componentNames[] = { "" };

View File

@ -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

View File

@ -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<int64_t>::zero = 0;
const int64_t Foam::pTraits<int64_t>::one = 1;
const int64_t Foam::pTraits<int64_t>::min = INT64_MIN;
const int64_t Foam::pTraits<int64_t>::max = INT64_MAX;
const int64_t Foam::pTraits<int64_t>::rootMin = pTraits<int64_t>::min;
const int64_t Foam::pTraits<int64_t>::rootMax = pTraits<int64_t>::max;
const char* const Foam::pTraits<int64_t>::componentNames[] = { "" };

View File

@ -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

View File

@ -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<uint32_t>::zero = 0;
const uint32_t Foam::pTraits<uint32_t>::one = 1;
const uint32_t Foam::pTraits<uint32_t>::min = 0;
const uint32_t Foam::pTraits<uint32_t>::max = UINT32_MAX;
const uint32_t Foam::pTraits<uint32_t>::rootMin = 0;
const uint32_t Foam::pTraits<uint32_t>::rootMax = pTraits<uint32_t>::max;
const char* const Foam::pTraits<uint32_t>::componentNames[] = { "" };

View File

@ -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

View File

@ -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<uint64_t>::zero = 0;
const uint64_t Foam::pTraits<uint64_t>::one = 1;
const uint64_t Foam::pTraits<uint64_t>::min = 0;
const uint64_t Foam::pTraits<uint64_t>::max = UINT64_MAX;
const uint64_t Foam::pTraits<uint64_t>::rootMin = 0;
const uint64_t Foam::pTraits<uint64_t>::rootMax = pTraits<uint64_t>::max;
const char* const Foam::pTraits<uint64_t>::componentNames[] = { "" };

View File

@ -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

View File

@ -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)
);
// ************************************************************************* //

View File

@ -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
(

View File

@ -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)
);
// ************************************************************************* //

View File

@ -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

View File

@ -71,6 +71,12 @@ const Foam::Vector<Foam::vector> Foam::triad::vsType::rootMin
triad::uniform(vector::uniform(-rootVGreat))
);
template<>
const Foam::Vector<Foam::vector> Foam::triad::vsType::nan
(
triad::uniform(vector::uniform(NaN))
);
const Foam::triad Foam::triad::I
(
vector(1, 0, 0),

View File

@ -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);

View File

@ -112,13 +112,6 @@ void NaNGeometricFields
{
typedef GeometricField<Type, PatchField, GeoMesh> GField;
Type NaN;
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
setComponent(NaN, cmpt) = std::numeric_limits<scalar>::signaling_NaN();
}
UPtrList<GField> fields(mesh.curFields<GField>());
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<Type>::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<Type>::nan;
}
field.instance() = field.time().name();

View File

@ -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);

View File

@ -75,7 +75,7 @@ public:
part()
:
area(Zero),
centre(patchToPatchTools::NaN<point>())
centre(pTraits<point>::nan)
{}
//- Default construct

View File

@ -137,10 +137,6 @@ void rDistributeTgtAddressing
List<DynamicList<label>>& tgtLocalSrcFaces
);
//- Return a primitive with all components set to NaN
template<class Type>
static Type NaN();
//- Interpolate with normalisation
template<class Type, class LabelList, class ScalarList>
static tmp<Field<Type>> interpolate

View File

@ -82,20 +82,6 @@ void Foam::patchToPatchTools::rDistributeListList
}
template<class Type>
Type Foam::patchToPatchTools::NaN()
{
Type result;
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
setComponent(result, cmpt) = Foam::NaN;
}
return result;
}
template<class Type, class LabelList, class ScalarList>
Foam::tmp<Foam::Field<Type>> Foam::patchToPatchTools::interpolate
(
@ -116,7 +102,10 @@ Foam::tmp<Foam::Field<Type>> Foam::patchToPatchTools::interpolate
otherMapPtr.valid() ? tLocalOtherFld() : otherFld;
// Allocate the result
tmp<Field<Type>> tFld(new Field<Type>(localOtherFaces.size(), NaN<Type>()));
tmp<Field<Type>> tFld
(
new Field<Type>(localOtherFaces.size(), pTraits<Type>::nan)
);
Field<Type>& fld = tFld.ref();
// Compute the result as a weighted sum
@ -163,7 +152,10 @@ Foam::tmp<Foam::Field<Type>> Foam::patchToPatchTools::interpolate
otherMapPtr.valid() ? tLocalOtherFld() : otherFld;
// Allocate the result
tmp<Field<Type>> tFld(new Field<Type>(localOtherFaces.size(), NaN<Type>()));
tmp<Field<Type>> tFld
(
new Field<Type>(localOtherFaces.size(), pTraits<Type>::nan)
);
Field<Type>& fld = tFld.ref();
// Compute the result as a weighted sum