ENH: checkMesh: use built-in merging

This commit is contained in:
mattijs
2023-07-18 12:03:58 +01:00
parent edb455ca97
commit a8df552998

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2015-2017 OpenFOAM Foundation Copyright (C) 2015-2017 OpenFOAM Foundation
Copyright (C) 2015-2022 OpenCFD Ltd. Copyright (C) 2015-2023 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -233,58 +233,15 @@ void Foam::mergeAndWrite
const fileName& outputDir const fileName& outputDir
) )
{ {
if (Pstream::parRun()) writer.open
{ (
labelList pointToGlobal; setPatch.localPoints(),
labelList uniqueMeshPointLabels; setPatch.localFaces(),
autoPtr<globalIndex> globalPoints; (outputDir / name)
autoPtr<globalIndex> globalFaces; );
faceList mergedFaces;
pointField mergedPoints;
Foam::PatchTools::gatherAndMerge
(
mesh,
setPatch.localFaces(),
setPatch.meshPoints(),
setPatch.meshPointMap(),
pointToGlobal, writer.write();
uniqueMeshPointLabels, writer.clear();
globalPoints,
globalFaces,
mergedFaces,
mergedPoints
);
// Write
if (Pstream::master())
{
writer.open
(
mergedPoints,
mergedFaces,
(outputDir / name),
false // serial - already merged
);
writer.write();
writer.clear();
}
}
else
{
writer.open
(
setPatch.localPoints(),
setPatch.localFaces(),
(outputDir / name),
false // serial - already merged
);
writer.write();
writer.clear();
}
} }