ENH: improve surfaceFieldValue sampling and writing (#1999)

- ensure surface writing is time-step and nFields aware.
  This avoids overwriting (ignoring) previous output fields.

- allow sampled surfaces to be used for weight fields as well.
  Not sure why this restriction was still there.

- remove old compatibility reading of orientedFields.
  Last used in v1612, now removed.

- only use face sampling. For surfaceFieldValue we can only do
  something meaningful with face values.

ENH: modify interface methods for surfaceWriter

- replace direct modification of values with setter methods.
  Eg,
     old: writer.isPointData() = true;
     new: writer.isPointData(true);

  This makes it possible to add internal hooks to catch state changes.

ENH: allow post-construction change to sampledSurface interpolation

- rename interpolate() method to isPointData() for consistency with
  other classes and to indicate that it is a query.

- additional isPointData(bool) setter method to change the expected
  representation type after construction

- remove 'interpolate' restriction on isoSurfacePoint which was
  previously flagged as an error but within sampledSurfaces can use
  sampleScheme cellPoint and obtain representative samples.
  Relax this restriction since this particular iso-surface algorithm
  is slated for removal in the foreseeable future.
This commit is contained in:
Mark Olesen
2021-02-10 11:16:50 +01:00
parent 0990d30b73
commit 2954f55f6a
17 changed files with 176 additions and 148 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -306,7 +306,7 @@ bool Foam::areaWrite::write()
// Propagate field counts (per surface)
outWriter.nFields() = nAreaFields;
outWriter.nFields(nAreaFields);
// Begin writing
@ -351,7 +351,7 @@ void Foam::areaWrite::expire()
{
surfaceWriter& writer = *(iter.val());
writer.expire();
writer.mergeDim() = mergeDim;
writer.mergeDim(mergeDim);
}
}