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:
@ -167,18 +167,24 @@ int main(int argc, char *argv[])
|
||||
Info<< "Generating kinetic energy field" << endl;
|
||||
volScalarField k("k", 0.5*magSqr(U));
|
||||
k.write();
|
||||
|
||||
auto limits = gMinMax(k);
|
||||
auto avg = gAverage(k);
|
||||
|
||||
Info<< "min/max/average k = "
|
||||
<< gMin(k) << ", " << gMax(k) << ", " << gAverage(k)
|
||||
<< endl;
|
||||
<< limits.min() << ", " << limits.max() << ", " << avg << endl;
|
||||
}
|
||||
|
||||
{
|
||||
Info<< "Generating div(U) field" << endl;
|
||||
volScalarField divU(fvc::div(U));
|
||||
divU.write();
|
||||
|
||||
auto limits = gMinMax(divU);
|
||||
auto avg = gAverage(divU);
|
||||
|
||||
Info<< "min/max/average div(U) = "
|
||||
<< gMin(divU) << ", " << gMax(divU) << ", " << gAverage(divU)
|
||||
<< endl;
|
||||
<< limits.min() << ", " << limits.max() << ", " << avg << endl;
|
||||
}
|
||||
|
||||
Info<< nl;
|
||||
|
||||
Reference in New Issue
Block a user