mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: rename field methods clamp() -> clamp_range()
- this is slightly longer to write (but consistent with clamp_min etc). The main reason is that this allows easier use of the clamp() free function. STYLE: skip checks for bad/invalid clamping ranges - ranges are either already validated before calling, the caller logic has already made the branching decision.
This commit is contained in:
@ -162,9 +162,16 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "result: " << result << nl;
|
||||
|
||||
someField.clamp(zero_one{});
|
||||
|
||||
someField.clamp_range(zero_one{});
|
||||
Info<< "inplace: " << someField << nl;
|
||||
|
||||
scalar val(1.414);
|
||||
|
||||
Info<< "clamp " << val
|
||||
// nope << " : " << clamp(val, zero_one{})
|
||||
// nope << " : " << clamp(val, scalarMinMax(zero_one{}))
|
||||
<< " : " << clamp(val, 0, 1)
|
||||
<< nl;
|
||||
}
|
||||
|
||||
Info<< nl << "\nDone\n" << endl;
|
||||
|
||||
Reference in New Issue
Block a user