ENH: minMax, minMaxMag as functions and field functions

- Global functions are unary or combining binary functions, which are
  defined in MinMax.H (MinMaxOps.H).

  There are also global reduction functions (gMinMax, gMinMaxMag)
  as well as supporting 'Op' classes:

  - minMaxOp, minMaxEqOp, minMaxMagOp, minMaxMagEqOp

  Since the result of the functions represents a content reduction
  into a single MinMax<T> value (a min/max pair), field operations
  returning a field simply do not make sense.

- Implemented for lists, fields, field-fields, DimensionedField,
  GeometricField (parallel reducing, with boundaries).

- Since the minMax evaluates during its operation, this makes it more
  efficient for cases where both min/max values are required since it
  avoids looping twice through the data.

  * Changed GeometricField writeMinMax accordingly.

ENH: clip as field function

- clipping provides a more efficient, single-pass operation to apply
  lower/upper limits on single or multiple values.

  Examples,

    scalarMinMax limiter(0, 1);

    limiter.clip(value)

       -> returns a const-ref to the value if within the range, or else
          returns the appropriate lower/upper limit

    limiter.inplaceClip(value)

       -> Modifies the value if necessary to be within lower/upper limit

  Function calls

    clip(value, limiter)

       -> returns a copy after applying lower/upper limit

    clip(values, limiter)

       -> returns a tmp<Field> of clipped values
This commit is contained in:
Mark Olesen
2019-01-10 09:43:23 +01:00
parent 1370060da2
commit 9a7029004c
24 changed files with 950 additions and 204 deletions

View File

@ -79,6 +79,6 @@
rho = thermo.rho();
rho.relax();
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()
Info<< "rho min/max : " << min(rho).value() << " " << max(rho).value()
<< endl;
}