diff --git a/src/OpenFOAM/fields/Fields/Field/FieldFunctions.C b/src/OpenFOAM/fields/Fields/Field/FieldFunctions.C index ff38ae0917..b5a49f6881 100644 --- a/src/OpenFOAM/fields/Fields/Field/FieldFunctions.C +++ b/src/OpenFOAM/fields/Fields/Field/FieldFunctions.C @@ -379,7 +379,7 @@ Type maxMagSqr(const UList& f) } else { - return pTraits::min; + return pTraits::zero; } } @@ -406,7 +406,7 @@ Type minMagSqr(const UList& f) } else { - return pTraits::max; + return pTraits::rootMax; } } diff --git a/src/OpenFOAM/primitives/Scalar/Scalar.C b/src/OpenFOAM/primitives/Scalar/Scalar.C index 259c46706d..de2eb11e71 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 | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,6 +35,8 @@ const Scalar pTraits::zero = 0.0; const Scalar pTraits::one = 1.0; const Scalar pTraits::min = -ScalarVGREAT; const Scalar pTraits::max = ScalarVGREAT; +const Scalar pTraits::rootMin = -ScalarROOTVGREAT; +const Scalar pTraits::rootMax = ScalarROOTVGREAT; const char* pTraits::componentNames[] = { "x" }; diff --git a/src/OpenFOAM/primitives/Scalar/Scalar.H b/src/OpenFOAM/primitives/Scalar/Scalar.H index 7fee0a9687..b7234bc685 100644 --- a/src/OpenFOAM/primitives/Scalar/Scalar.H +++ b/src/OpenFOAM/primitives/Scalar/Scalar.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -62,6 +62,8 @@ public: static const Scalar one; static const Scalar max; static const Scalar min; + static const Scalar rootMax; + static const Scalar rootMin; // Constructors diff --git a/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.C b/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.C index 7e7396528e..378b7d592a 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 | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,11 +33,15 @@ License #define Scalar doubleScalar #define ScalarVGREAT doubleScalarVGREAT #define ScalarVSMALL doubleScalarVSMALL +#define ScalarROOTVGREAT doubleScalarROOTVGREAT +#define ScalarROOTVSMALL doubleScalarROOTVSMALL #define readScalar readDoubleScalar #include "Scalar.C" #undef Scalar #undef ScalarVGREAT #undef ScalarVSMALL +#undef ScalarROOTVGREAT +#undef ScalarROOTVSMALL #undef readScalar // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H b/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H index 13a70e475e..80687f6f07 100644 --- a/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H +++ b/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H @@ -70,6 +70,8 @@ inline bool readScalar(const char* buf, doubleScalar& s) #define Scalar doubleScalar #define ScalarVGREAT doubleScalarVGREAT #define ScalarVSMALL doubleScalarVSMALL +#define ScalarROOTVGREAT doubleScalarROOTVGREAT +#define ScalarROOTVSMALL doubleScalarROOTVSMALL #define readScalar readDoubleScalar inline Scalar mag(const Scalar s) @@ -108,6 +110,8 @@ inline Scalar yn(const int n, const Scalar s) #undef Scalar #undef ScalarVGREAT #undef ScalarVSMALL +#undef ScalarROOTVGREAT +#undef ScalarROOTVSMALL #undef readScalar #undef transFunc diff --git a/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.C b/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.C index 5f72b1539d..dec0b215d3 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 | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,11 +33,15 @@ License #define Scalar floatScalar #define ScalarVGREAT floatScalarVGREAT #define ScalarVSMALL floatScalarVSMALL +#define ScalarROOTVGREAT floatScalarROOTVGREAT +#define ScalarROOTVSMALL floatScalarROOTVSMALL #define readScalar readFloatScalar #include "Scalar.C" #undef Scalar #undef ScalarVSMALL #undef ScalarVSMALL +#undef ScalarROOTVGREAT +#undef ScalarROOTVSMALL #undef readScalar // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H b/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H index 5401bc79a6..c379e0fbda 100644 --- a/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H +++ b/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H @@ -70,6 +70,8 @@ inline bool readScalar(const char* buf, floatScalar& s) #define Scalar floatScalar #define ScalarVGREAT floatScalarVGREAT #define ScalarVSMALL floatScalarVSMALL +#define ScalarROOTVGREAT floatScalarROOTVGREAT +#define ScalarROOTVSMALL floatScalarROOTVSMALL #define readScalar readFloatScalar inline Scalar mag(const Scalar s) @@ -108,6 +110,8 @@ inline Scalar yn(const int n, const Scalar s) #undef Scalar #undef ScalarVGREAT #undef ScalarVSMALL +#undef ScalarROOTVGREAT +#undef ScalarROOTVSMALL #undef readScalar #undef transFunc diff --git a/src/OpenFOAM/primitives/Vector/Vector.H b/src/OpenFOAM/primitives/Vector/Vector.H index cb2e71d106..8eda8e99ab 100644 --- a/src/OpenFOAM/primitives/Vector/Vector.H +++ b/src/OpenFOAM/primitives/Vector/Vector.H @@ -82,6 +82,8 @@ public: static const Vector one; static const Vector max; static const Vector min; + static const Vector rootMax; + static const Vector rootMin; //- Component labeling enumeration diff --git a/src/OpenFOAM/primitives/Vector/vector/vector.C b/src/OpenFOAM/primitives/Vector/vector/vector.C index 3a684791a8..40b6e79c31 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 | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,6 +53,12 @@ const vector vector::max(VGREAT, VGREAT, VGREAT); template<> const vector vector::min(-VGREAT, -VGREAT, -VGREAT); +template<> +const vector vector::rootMax(ROOTVGREAT, ROOTVGREAT, ROOTVGREAT); + +template<> +const vector vector::rootMin(-ROOTVGREAT, -ROOTVGREAT, -ROOTVGREAT); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/primitives/ints/label/label.C b/src/OpenFOAM/primitives/ints/label/label.C index 3eec19bcf2..d0129af7da 100644 --- a/src/OpenFOAM/primitives/ints/label/label.C +++ b/src/OpenFOAM/primitives/ints/label/label.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,6 +38,8 @@ const label pTraits