ENH: use GeometricField clamp_min, clamp_max, clamp_range

- newer naming allows for less confusing code.
  Eg,
      max(lower)  ->  clamp_min(lower)
      min(upper)  ->  clamp_max(upper)

- prefer combined method, for few operations.
  Eg,
      max(lower) + min(upper) -> clamp_range(lower, upper)

  The updated naming also helps avoid some obvious coding errors.
  Eg,

     Re.min(1200.0);
     Re.max(18800.0);

  instead of
     Re.clamp_range(1200.0, 18800.0);

- can also use implicit conversion of zero_one to MinMax<Type> for
  this type of code:

      lambda_.clamp_range(zero_one{});
This commit is contained in:
Mark Olesen
2023-01-20 09:48:40 +01:00
parent 4d7180ae7c
commit 3d8a6a5433
45 changed files with 163 additions and 145 deletions

View File

@ -92,7 +92,7 @@ void blendField
volScalarField fld(fieldHeader, mesh);
scalarField& pf = fld.primitiveFieldRef();
pf = (1 - mask)*pf + mask*boundaryLayerField;
fld.max(SMALL);
fld.clamp_min(SMALL);
// Correct the processor patches only.
// Do not correct BC
@ -131,7 +131,7 @@ void calcOmegaField
scalarField& pf = omega.primitiveFieldRef();
pf = (1 - mask)*pf + mask*epsilonBL/(Cmu*kBL + SMALL);
omega.max(SMALL);
omega.clamp_min(SMALL);
// Correct the processor patches only.
// Do not correct BC