mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -872,30 +872,23 @@ autoPtr<mapDistributePolyMesh> redistributeAndWrite
|
||||
// Find last non-processor patch.
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
label nonProcI = -1;
|
||||
const label nonProcI = (patches.nNonProcessor() - 1);
|
||||
|
||||
forAll(patches, patchI)
|
||||
{
|
||||
if (isA<processorPolyPatch>(patches[patchI]))
|
||||
{
|
||||
break;
|
||||
}
|
||||
nonProcI++;
|
||||
}
|
||||
|
||||
if (nonProcI == -1)
|
||||
if (nonProcI < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find non-processor patch on processor "
|
||||
<< Pstream::myProcNo() << endl
|
||||
<< Pstream::myProcNo() << nl
|
||||
<< " Current patches:" << patches.names()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// Subset 0 cells, no parallel comms. This is used to create
|
||||
// zero-sized fields.
|
||||
subsetterPtr.reset(new fvMeshSubset(mesh));
|
||||
subsetterPtr().setLargeCellSubset(labelHashSet(0), nonProcI, false);
|
||||
// Subset 0 cells, no parallel comms.
|
||||
// This is used to create zero-sized fields.
|
||||
subsetterPtr.reset
|
||||
(
|
||||
new fvMeshSubset(mesh, bitSet(), nonProcI, false)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user