ENH: fvMeshSubset improvements (issue #951)

- what was previously termed 'setLargeCellSubset()' is now simply
  'setCellSubset()' and supports memory efficient interfaces.

  The new parameter ordering avoids ambiguities caused by default
  parameters.

  Old parameter order:

      setLargeCellSubset
      (
          const labelList& region,
          const label currentRegion,
          const label patchID = -1,
          const bool syncCouples = true
      );

  New parameter order:

      setCellSubset
      (
          const label regioni,
          const labelUList& regions,
          const label patchID = -1,
          const bool syncCouples = true
      );

   And without ambiguity:

      setCellSubset
      (
          const labelUList& selectedCells,
          const label patchID = -1,
          const bool syncCouples = true
      );

- support bitSet directly for specifying the selectedCells for
  memory efficiency and ease of use.

- Additional constructors to perform setCellSubset() immediately,
  which simplifies coding.

  For example,

      meshParts.set
      (
          zonei,
          new fvMeshSubset(mesh, selectedCells)
      );

  Or even

      return autoPtr<fvMeshSubset>::New(mesh, selectedCells);
This commit is contained in:
Mark Olesen
2018-07-25 18:58:00 +02:00
parent 7446d30fbd
commit dbe0db1d9a
23 changed files with 1737 additions and 1412 deletions

View File

@ -376,14 +376,16 @@ bool Foam::sampledIsoSurface::updateGeometry() const
<< patches[exposedPatchi].name() << endl;
}
// Remove old mesh if any
subMeshPtr_.clear();
subMeshPtr_.reset
(
new fvMeshSubset(fvm)
);
subMeshPtr_().setLargeCellSubset
(
labelHashSet(mesh().cellZones()[zoneID_.index()]),
exposedPatchi
new fvMeshSubset
(
fvm,
mesh().cellZones()[zoneID_.index()],
exposedPatchi
)
);
}

View File

@ -78,12 +78,12 @@ void Foam::sampledCuttingPlane::createGeometry()
subMeshPtr_.reset
(
new fvMeshSubset(static_cast<const fvMesh&>(mesh()))
);
subMeshPtr_().setLargeCellSubset
(
labelHashSet(mesh().cellZones()[zoneID_.index()]),
exposedPatchi
new fvMeshSubset
(
static_cast<const fvMesh&>(mesh()),
mesh().cellZones()[zoneID_.index()],
exposedPatchi
)
);
}