mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use clamp/clamp_range instead of min(max(..., upper), lower)
This commit is contained in:
@ -670,7 +670,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::processValues
|
||||
// Uniformity index
|
||||
const scalar ui = 1 - numer/(2*mag(mean*areaTotal) + ROOTVSMALL);
|
||||
|
||||
return min(max(ui, 0), 1);
|
||||
return clamp(ui, 0, 1);
|
||||
}
|
||||
|
||||
default:
|
||||
@ -756,7 +756,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::processValues
|
||||
// Uniformity index
|
||||
const scalar ui = 1 - numer/(2*mag(mean*areaTotal) + ROOTVSMALL);
|
||||
|
||||
return vector(min(max(ui, 0), 1), 0, 0);
|
||||
return vector(clamp(ui, 0, 1), 0, 0);
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
@ -417,7 +417,7 @@ bool Foam::functionObjects::stabilityBlendingFactor::init(bool first)
|
||||
max
|
||||
(
|
||||
indicator,
|
||||
min(max(scalar(0), (Co - Co1_)/(Co2_ - Co1_)), scalar(1))
|
||||
clamp((Co - Co1_)/(Co2_ - Co1_), zero_one{})
|
||||
);
|
||||
|
||||
if (first)
|
||||
|
||||
@ -152,7 +152,7 @@ Description
|
||||
For option 6, the following relation is used:
|
||||
|
||||
\f[
|
||||
fCoWeight = min(max((Co - Co1)/(Co2 - Co1), 0), 1)
|
||||
fCoWeight = clamp((Co - Co1)/(Co2 - Co1), 0, 1)
|
||||
\f]
|
||||
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user