From a8df552998412b8734bbdd87763336978774dc60 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 18 Jul 2023 12:03:58 +0100 Subject: [PATCH] ENH: checkMesh: use built-in merging --- .../mesh/manipulation/checkMesh/checkTools.C | 61 +++---------------- 1 file changed, 9 insertions(+), 52 deletions(-) diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTools.C b/applications/utilities/mesh/manipulation/checkMesh/checkTools.C index e3c855894e..e13ef31133 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTools.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTools.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015-2017 OpenFOAM Foundation - Copyright (C) 2015-2022 OpenCFD Ltd. + Copyright (C) 2015-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -233,58 +233,15 @@ void Foam::mergeAndWrite const fileName& outputDir ) { - if (Pstream::parRun()) - { - labelList pointToGlobal; - labelList uniqueMeshPointLabels; - autoPtr globalPoints; - autoPtr globalFaces; - faceList mergedFaces; - pointField mergedPoints; - Foam::PatchTools::gatherAndMerge - ( - mesh, - setPatch.localFaces(), - setPatch.meshPoints(), - setPatch.meshPointMap(), + writer.open + ( + setPatch.localPoints(), + setPatch.localFaces(), + (outputDir / name) + ); - pointToGlobal, - uniqueMeshPointLabels, - 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(); - } + writer.write(); + writer.clear(); }