mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: createPatch: do not remove zero-sized patches
This commit is contained in:
@ -94,7 +94,7 @@ void changePatchID
|
|||||||
|
|
||||||
|
|
||||||
// Filter out the empty patches.
|
// Filter out the empty patches.
|
||||||
void filterPatches(polyMesh& mesh)
|
void filterPatches(polyMesh& mesh, const HashSet<word>& addedPatchNames)
|
||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
@ -111,7 +111,11 @@ void filterPatches(polyMesh& mesh)
|
|||||||
// Note: reduce possible since non-proc patches guaranteed in same order
|
// Note: reduce possible since non-proc patches guaranteed in same order
|
||||||
if (!isA<processorPolyPatch>(pp))
|
if (!isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
if (returnReduce(pp.size(), sumOp<label>()) > 0)
|
if
|
||||||
|
(
|
||||||
|
addedPatchNames.found(pp.name())
|
||||||
|
|| returnReduce(pp.size(), sumOp<label>()) > 0
|
||||||
|
)
|
||||||
{
|
{
|
||||||
allPatches.append
|
allPatches.append
|
||||||
(
|
(
|
||||||
@ -126,8 +130,8 @@ void filterPatches(polyMesh& mesh)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info<< "Removing empty patch " << pp.name() << " at position "
|
Info<< "Removing zero-sized patch " << pp.name()
|
||||||
<< patchI << endl;
|
<< " at position " << patchI << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -552,6 +556,12 @@ int main(int argc, char *argv[])
|
|||||||
// Read patch construct info from dictionary
|
// Read patch construct info from dictionary
|
||||||
PtrList<dictionary> patchSources(dict.lookup("patches"));
|
PtrList<dictionary> patchSources(dict.lookup("patches"));
|
||||||
|
|
||||||
|
HashSet<word> addedPatchNames;
|
||||||
|
forAll(patchSources, addedI)
|
||||||
|
{
|
||||||
|
const dictionary& dict = patchSources[addedI];
|
||||||
|
addedPatchNames.insert(dict.lookup("name"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 1. Add all new patches
|
// 1. Add all new patches
|
||||||
@ -868,7 +878,7 @@ int main(int argc, char *argv[])
|
|||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Info<< "Removing patches with no faces in them." << nl<< endl;
|
Info<< "Removing patches with no faces in them." << nl<< endl;
|
||||||
filterPatches(mesh);
|
filterPatches(mesh, addedPatchNames);
|
||||||
|
|
||||||
|
|
||||||
dumpCyclicMatch("final_", mesh);
|
dumpCyclicMatch("final_", mesh);
|
||||||
|
|||||||
Reference in New Issue
Block a user