mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use gMinMax() instead of separate gMin(), gMax()
- for reciprocal values, gMinMax() first and then calculate the reciprocal, which avoids creating temporaries STYLE: prefer MinMax to separate min/max accounting COMP: namespace qualify min/max for deltaT, CourantNo, etc (#3348)
This commit is contained in:
@ -262,13 +262,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Check constant profile
|
||||
{
|
||||
const scalar max = gMax(one);
|
||||
const scalar min = gMin(one);
|
||||
auto limits = gMinMax(one);
|
||||
|
||||
Info<< "Uniform one field min = " << min
|
||||
<< " max = " << max << endl;
|
||||
Info<< "Uniform one field min = "
|
||||
<< limits.min() << " max = " << limits.max() << endl;
|
||||
|
||||
if (isNotEqual(max, 1) || isNotEqual(min, 1))
|
||||
if (isNotEqual(limits.min(), 1) || isNotEqual(limits.max(), 1))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Uniform volVectorField not preserved."
|
||||
@ -286,13 +285,12 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const scalarField diff = ccX-mesh.C().component(0);
|
||||
|
||||
const scalar max = gMax(diff);
|
||||
const scalar min = gMin(diff);
|
||||
auto limits = gMinMax(diff);
|
||||
|
||||
Info<< "Linear profile field min = " << min
|
||||
<< " max = " << max << endl;
|
||||
Info<< "Linear profile field min = "
|
||||
<< limits.min() << " max = " << limits.max() << endl;
|
||||
|
||||
if (isNotEqual(max, 0) || isNotEqual(min, 0))
|
||||
if (isNotEqual(limits.min(), 0) || isNotEqual(limits.max(), 0))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Linear profile not preserved."
|
||||
@ -309,13 +307,12 @@ int main(int argc, char *argv[])
|
||||
// Check face field mapping
|
||||
if (surfaceOne.size())
|
||||
{
|
||||
const scalar max = gMax(surfaceOne.primitiveField());
|
||||
const scalar min = gMin(surfaceOne.primitiveField());
|
||||
auto limits = gMinMax(surfaceOne.primitiveField());
|
||||
|
||||
Info<< "Uniform surface field min = " << min
|
||||
<< " max = " << max << endl;
|
||||
Info<< "Uniform surface field min = "
|
||||
<< limits.min() << " max = " << limits.max() << endl;
|
||||
|
||||
if (isNotEqual(max, 1) || isNotEqual(min, 1))
|
||||
if (isNotEqual(limits.min(), 1) || isNotEqual(limits.max(), 1))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Uniform surfaceScalarField not preserved."
|
||||
|
||||
Reference in New Issue
Block a user