diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H index 68eb88e15..5ae504817 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.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-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -113,7 +113,7 @@ public: { forAll(sf, i) { - if (mag(sf[i]) >= scalar(floatScalarVSMALL)) + if (mag(sf[i]) >= scalar(floatScalarVSmall)) { str_ << setw(12) << sf[i] << nl; } diff --git a/src/OpenFOAM/primitives/Scalar/Scalar.C b/src/OpenFOAM/primitives/Scalar/Scalar.C index 0a3e09b0b..6a6c87d47 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-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,10 +33,10 @@ namespace Foam const char* const pTraits::typeName = "scalar"; 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 Scalar pTraits::min = -ScalarVGreat; +const Scalar pTraits::max = ScalarVGreat; +const Scalar pTraits::rootMin = -ScalarRootVGreat; +const Scalar pTraits::rootMax = ScalarRootVGreat; const char* const pTraits::componentNames[] = { "" }; diff --git a/src/OpenFOAM/primitives/Scalar/Scalar.H b/src/OpenFOAM/primitives/Scalar/Scalar.H index 146ea3fdb..c8774f9b8 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-2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -208,13 +208,13 @@ inline Scalar negPart(const Scalar s) inline bool equal(const Scalar& s1, const Scalar& s2) { - return mag(s1 - s2) <= ScalarVSMALL; + return mag(s1 - s2) <= ScalarVSmall; } inline bool notEqual(const Scalar s1, const Scalar s2) { - return mag(s1 - s2) > ScalarVSMALL; + return mag(s1 - s2) > ScalarVSmall; } @@ -343,7 +343,7 @@ inline Scalar sqrtSumSqr(const Scalar a, const Scalar b) } else { - return magb < ScalarVSMALL ? 0.0 : magb*sqrt(1.0 + sqr(maga/magb)); + return magb < ScalarVSmall ? 0.0 : magb*sqrt(1.0 + sqr(maga/magb)); } } diff --git a/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.C b/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.C index 378b7d592..a8f8eb70f 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-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,17 +31,17 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #define Scalar doubleScalar -#define ScalarVGREAT doubleScalarVGREAT -#define ScalarVSMALL doubleScalarVSMALL -#define ScalarROOTVGREAT doubleScalarROOTVGREAT -#define ScalarROOTVSMALL doubleScalarROOTVSMALL +#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 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 308994785..6644a8fdd 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 | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,6 +39,9 @@ SourceFiles #include "direction.H" #include "word.H" +#include +using std::numeric_limits; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -49,15 +52,17 @@ namespace Foam typedef double doubleScalar; // Largest and smallest scalar values allowed in certain parts of the code. -// (15 is the number of significant figures in an -// IEEE double precision number. See limits.h or float.h) -static const doubleScalar doubleScalarGREAT = 1.0e+15; -static const doubleScalar doubleScalarVGREAT = 1.0e+300; -static const doubleScalar doubleScalarROOTVGREAT = 1.0e+150; -static const doubleScalar doubleScalarSMALL = 1.0e-15; -static const doubleScalar doubleScalarROOTSMALL = 3.0e-8; -static const doubleScalar doubleScalarVSMALL = 1.0e-300; -static const doubleScalar doubleScalarROOTVSMALL = 1.0e-150; +static const doubleScalar doubleScalarVGreat = numeric_limits::max(); +static const doubleScalar doubleScalarVSmall = numeric_limits::min(); + +static const doubleScalar doubleScalarSmall = numeric_limits::epsilon(); +static const doubleScalar doubleScalarGreat = 1.0/doubleScalarSmall; + +static const doubleScalar doubleScalarRootVGreat = ::sqrt(doubleScalarVGreat); +static const doubleScalar doubleScalarRootVSmall = ::sqrt(doubleScalarVSmall); + +static const doubleScalar doubleScalarRootGreat = ::sqrt(doubleScalarGreat); +static const doubleScalar doubleScalarRootSmall = ::sqrt(doubleScalarSmall); //- Read whole of buf as a scalar. Return true if succesful. inline bool readScalar(const char* buf, doubleScalar& s) @@ -69,10 +74,10 @@ inline bool readScalar(const char* buf, doubleScalar& s) } #define Scalar doubleScalar -#define ScalarVGREAT doubleScalarVGREAT -#define ScalarVSMALL doubleScalarVSMALL -#define ScalarROOTVGREAT doubleScalarROOTVGREAT -#define ScalarROOTVSMALL doubleScalarROOTVSMALL +#define ScalarVGreat doubleScalarVGreat +#define ScalarVSmall doubleScalarVSmall +#define ScalarRootVGreat doubleScalarRootVGreat +#define ScalarRootVSmall doubleScalarRootVSmall #define readScalar readDoubleScalar inline Scalar mag(const Scalar s) @@ -122,10 +127,10 @@ inline Scalar yn(const int n, const Scalar s) } #undef Scalar -#undef ScalarVGREAT -#undef ScalarVSMALL -#undef ScalarROOTVGREAT -#undef ScalarROOTVSMALL +#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 dec0b215d..597402366 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-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,17 +31,17 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #define Scalar floatScalar -#define ScalarVGREAT floatScalarVGREAT -#define ScalarVSMALL floatScalarVSMALL -#define ScalarROOTVGREAT floatScalarROOTVGREAT -#define ScalarROOTVSMALL floatScalarROOTVSMALL +#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 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 1cfb728a2..a2b688bca 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 | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,6 +39,9 @@ SourceFiles #include "direction.H" #include "word.H" +#include +using std::numeric_limits; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -49,15 +52,17 @@ namespace Foam typedef float floatScalar; // Largest and smallest scalar values allowed in certain parts of the code -// (6 is the number of significant figures in an -// IEEE single precision number. See limits.h or float.h) -static const floatScalar floatScalarGREAT = 1.0e+6; -static const floatScalar floatScalarVGREAT = 1.0e+37; -static const floatScalar floatScalarROOTVGREAT = 1.0e+18; -static const floatScalar floatScalarSMALL = 1.0e-6; -static const floatScalar floatScalarROOTSMALL = 1.0e-3; -static const floatScalar floatScalarVSMALL = 1.0e-37; -static const floatScalar floatScalarROOTVSMALL = 1.0e-18; +static const floatScalar floatScalarVGreat = numeric_limits::max(); +static const floatScalar floatScalarVSmall = numeric_limits::min(); + +static const floatScalar floatScalarSmall = numeric_limits::epsilon(); +static const floatScalar floatScalarGreat = 1.0/floatScalarSmall; + +static const floatScalar floatScalarRootVGreat = ::sqrt(floatScalarVGreat); +static const floatScalar floatScalarRootVSmall = ::sqrt(floatScalarVSmall); + +static const floatScalar floatScalarRootGreat = ::sqrt(floatScalarGreat); +static const floatScalar floatScalarRootSmall = ::sqrt(floatScalarSmall); //- Read whole of buf as a scalar. Return true if succesful. inline bool readScalar(const char* buf, floatScalar& s) @@ -69,10 +74,10 @@ inline bool readScalar(const char* buf, floatScalar& s) } #define Scalar floatScalar -#define ScalarVGREAT floatScalarVGREAT -#define ScalarVSMALL floatScalarVSMALL -#define ScalarROOTVGREAT floatScalarROOTVGREAT -#define ScalarROOTVSMALL floatScalarROOTVSMALL +#define ScalarVGreat floatScalarVGreat +#define ScalarVSmall floatScalarVSmall +#define ScalarRootVGreat floatScalarRootVGreat +#define ScalarRootVSmall floatScalarRootVSmall #define readScalar readFloatScalar inline Scalar mag(const Scalar s) @@ -122,10 +127,10 @@ inline Scalar yn(const int n, const Scalar s) } #undef Scalar -#undef ScalarVGREAT -#undef ScalarVSMALL -#undef ScalarROOTVGREAT -#undef ScalarROOTVSMALL +#undef ScalarVGreat +#undef ScalarVSmall +#undef ScalarRootVGreat +#undef ScalarRootVSmall #undef readScalar #undef transFunc diff --git a/src/OpenFOAM/primitives/Scalar/scalar/scalar.H b/src/OpenFOAM/primitives/Scalar/scalar/scalar.H index 7c7c00cef..d8810c386 100644 --- a/src/OpenFOAM/primitives/Scalar/scalar/scalar.H +++ b/src/OpenFOAM/primitives/Scalar/scalar/scalar.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,13 +49,14 @@ namespace Foam { typedef floatScalar scalar; - static const scalar GREAT = floatScalarGREAT; - static const scalar VGREAT = floatScalarVGREAT; - static const scalar ROOTVGREAT = floatScalarROOTVGREAT; - static const scalar SMALL = floatScalarSMALL; - static const scalar ROOTSMALL = floatScalarROOTSMALL; - static const scalar VSMALL = floatScalarVSMALL; - static const scalar ROOTVSMALL = floatScalarROOTVSMALL; + static const scalar great = floatScalarGreat; + static const scalar rootGreat = floatScalarRootGreat; + static const scalar vGreat = floatScalarVGreat; + static const scalar rootVGreat = floatScalarRootVGreat; + static const scalar small = floatScalarSmall; + static const scalar rootSmall = floatScalarRootSmall; + static const scalar vSmall = floatScalarVSmall; + static const scalar rootVSmall = floatScalarRootVSmall; scalar readScalar(Istream& is); } @@ -68,19 +69,33 @@ namespace Foam { typedef doubleScalar scalar; - static const scalar GREAT = doubleScalarGREAT; - static const scalar VGREAT = doubleScalarVGREAT; - static const scalar ROOTVGREAT = doubleScalarROOTVGREAT; - static const scalar SMALL = doubleScalarSMALL; - static const scalar ROOTSMALL = doubleScalarROOTSMALL; - static const scalar VSMALL = doubleScalarVSMALL; - static const scalar ROOTVSMALL = doubleScalarROOTVSMALL; + static const scalar great = doubleScalarGreat; + static const scalar rootGreat = doubleScalarRootGreat; + static const scalar vGreat = doubleScalarVGreat; + static const scalar rootVGreat = doubleScalarRootVGreat; + static const scalar small = doubleScalarSmall; + static const scalar rootSmall = doubleScalarRootSmall; + static const scalar vSmall = doubleScalarVSmall; + static const scalar rootVSmall = doubleScalarRootVSmall; scalar readScalar(Istream& is); } #endif +//- Deprecated limit constant for backward-compatibility +namespace Foam +{ + static const scalar GREAT = great; + static const scalar ROOTGREAT = rootGreat; + static const scalar VGREAT = vGreat; + static const scalar ROOTVGREAT = rootVGreat; + static const scalar SMALL = small; + static const scalar ROOTSMALL = rootSmall; + static const scalar VSMALL = vSmall; + static const scalar ROOTVSMALL = rootVSmall; +} + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Additional transcendental functions diff --git a/src/OpenFOAM/primitives/Tensor/floatTensor/floatTensor.C b/src/OpenFOAM/primitives/Tensor/floatTensor/floatTensor.C index cdcf7d4aa..2d0ad18fb 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 | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,25 +53,25 @@ const Foam::floatTensor Foam::floatTensor::vsType::one template<> const Foam::floatTensor Foam::floatTensor::vsType::max ( - floatTensor::uniform(floatScalarVGREAT) + floatTensor::uniform(floatScalarVGreat) ); template<> const Foam::floatTensor Foam::floatTensor::vsType::min ( - floatTensor::uniform(-floatScalarVGREAT) + floatTensor::uniform(-floatScalarVGreat) ); template<> const Foam::floatTensor Foam::floatTensor::vsType::rootMax ( - floatTensor::uniform(floatScalarROOTVGREAT) + floatTensor::uniform(floatScalarRootVGreat) ); template<> const Foam::floatTensor Foam::floatTensor::vsType::rootMin ( - floatTensor::uniform(-floatScalarROOTVGREAT) + floatTensor::uniform(-floatScalarRootVGreat) ); template<> diff --git a/src/OpenFOAM/primitives/Vector/floatVector/floatVector.C b/src/OpenFOAM/primitives/Vector/floatVector/floatVector.C index 13ab567ba..85e284b8e 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 | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,25 +54,25 @@ const Foam::floatVector Foam::floatVector::vsType::one template<> const Foam::floatVector Foam::floatVector::vsType::max ( - floatVector::uniform(floatScalarVGREAT) + floatVector::uniform(floatScalarVGreat) ); template<> const Foam::floatVector Foam::floatVector::vsType::min ( - floatVector::uniform(-floatScalarVGREAT) + floatVector::uniform(-floatScalarVGreat) ); template<> const Foam::floatVector Foam::floatVector::vsType::rootMax ( - floatVector::uniform(floatScalarROOTVGREAT) + floatVector::uniform(floatScalarRootVGreat) ); template<> const Foam::floatVector Foam::floatVector::vsType::rootMin ( - floatVector::uniform(-floatScalarROOTVGREAT) + floatVector::uniform(-floatScalarRootVGreat) ); diff --git a/src/OpenFOAM/primitives/triad/triad.C b/src/OpenFOAM/primitives/triad/triad.C index 0a54dc4ac..49efdc667 100644 --- a/src/OpenFOAM/primitives/triad/triad.C +++ b/src/OpenFOAM/primitives/triad/triad.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -132,9 +132,18 @@ void Foam::triad::orthogonalize() { for (int i=0; i<2; i++) { - scalar o01 = mag(operator[](0) & operator[](1)); - scalar o02 = mag(operator[](0) & operator[](2)); - scalar o12 = mag(operator[](1) & operator[](2)); + const scalar o01 + ( + (set(0) && set(1)) ? mag(operator[](0) & operator[](1)) : VGREAT + ); + const scalar o02 + ( + (set(0) && set(2)) ? mag(operator[](0) & operator[](2)) : VGREAT + ); + const scalar o12 + ( + (set(1) && set(2)) ? mag(operator[](1) & operator[](2)) : VGREAT + ); if (o01 < o02 && o01 < o12) { diff --git a/src/conversion/ensight/file/ensightFile.C b/src/conversion/ensight/file/ensightFile.C index 09269edd3..ada85e6db 100644 --- a/src/conversion/ensight/file/ensightFile.C +++ b/src/conversion/ensight/file/ensightFile.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,7 +30,7 @@ License bool Foam::ensightFile::allowUndef_ = false; -Foam::scalar Foam::ensightFile::undefValue_ = Foam::floatScalarVGREAT; +Foam::scalar Foam::ensightFile::undefValue_ = Foam::floatScalarVGreat; // default is width 8 Foam::string Foam::ensightFile::mask_ = "********"; diff --git a/src/fileFormats/sampledSetWriters/ensight/ensightSetWriter.C b/src/fileFormats/sampledSetWriters/ensight/ensightSetWriter.C index ecaef7ea0..5ecfd6abc 100644 --- a/src/fileFormats/sampledSetWriters/ensight/ensightSetWriter.C +++ b/src/fileFormats/sampledSetWriters/ensight/ensightSetWriter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -125,7 +125,7 @@ void Foam::ensightSetWriter::write forAll(points, pointi) { const scalar comp = points[pointi][cmpt]; - if (mag(comp) >= scalar(floatScalarVSMALL)) + if (mag(comp) >= scalar(floatScalarVSmall)) { os << setw(12) << comp << nl; } @@ -160,7 +160,7 @@ void Foam::ensightSetWriter::write const scalarField fld(valueSets[setI]->component(cmpt)); forAll(fld, i) { - if (mag(fld[i]) >= scalar(floatScalarVSMALL)) + if (mag(fld[i]) >= scalar(floatScalarVSmall)) { os << setw(12) << fld[i] << nl; } @@ -243,7 +243,7 @@ void Foam::ensightSetWriter::write forAll(points, pointi) { const scalar comp = points[pointi][cmpt]; - if (mag(comp) >= scalar(floatScalarVSMALL)) + if (mag(comp) >= scalar(floatScalarVSmall)) { os << setw(12) << comp << nl; } @@ -296,7 +296,7 @@ void Foam::ensightSetWriter::write const scalarField fld(fieldVals[trackI].component(cmpt)); forAll(fld, i) { - if (mag(fld[i]) >= scalar(floatScalarVSMALL)) + if (mag(fld[i]) >= scalar(floatScalarVSmall)) { os << setw(12) << fld[i] << nl; } diff --git a/src/lagrangian/DSMC/clouds/Templates/DSMCCloud/DSMCCloud.C b/src/lagrangian/DSMC/clouds/Templates/DSMCCloud/DSMCCloud.C index 173d21d2d..be6c22515 100644 --- a/src/lagrangian/DSMC/clouds/Templates/DSMCCloud/DSMCCloud.C +++ b/src/lagrangian/DSMC/clouds/Templates/DSMCCloud/DSMCCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,7 +55,7 @@ void Foam::DSMCCloud::buildConstProps() const dictionary& molDict(moleculeProperties.subDict(id)); constProps_[i] = - typename ParcelType::constantProperties::constantProperties(molDict); + typename ParcelType::constantProperties(molDict); } } @@ -1034,11 +1034,11 @@ Foam::scalar Foam::DSMCCloud::equipartitionInternalEnergy { scalar Ei = 0.0; - if (iDof < SMALL) + if (iDof == 0) { return Ei; } - else if (iDof < 2.0 + SMALL && iDof > 2.0 - SMALL) + else if (iDof == 2) { // Special case for iDof = 2, i.e. diatomics; Ei = -log(rndGen_.scalar01())*physicoChemical::k.value()*temperature; diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/sweptFaceAreaWeightAMI/sweptFaceAreaWeightAMI.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/sweptFaceAreaWeightAMI/sweptFaceAreaWeightAMI.C index 288ebce6e..86182ab94 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/sweptFaceAreaWeightAMI/sweptFaceAreaWeightAMI.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/sweptFaceAreaWeightAMI/sweptFaceAreaWeightAMI.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -475,12 +475,14 @@ Foam::scalar Foam::sweptFaceAreaWeightAMI::interArea srcNrm[i+1], tgtTri ); + cutTriList<8> cutTrisTmp; - for (label i = 0; i < cutTris.size(); ++ i) + + for (label j = 0; j < cutTris.size(); ++j) { triCut ( - cutTris[i], + cutTris[j], cutPlane, cut::noOp(), cut::appendOp>(cutTrisTmp)