diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTools.C b/applications/utilities/mesh/manipulation/checkMesh/checkTools.C index a77ca272cd..00c1f4b0f2 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-2021 OpenCFD Ltd. + Copyright (C) 2015-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -423,8 +423,8 @@ void Foam::mergeAndWrite { const polyMesh& mesh = refCast(set.db()); - pointField mergedPts; - labelList mergedIDs; + labelField mergedIDs(set.sortedToc()); + pointField mergedPts(mesh.points(), mergedIDs); if (Pstream::parRun()) { @@ -432,55 +432,12 @@ void Foam::mergeAndWrite // (mesh.globalData().mergePoints etc) since this might // hide any synchronisation problem - globalIndex globalNumbering(mesh.nPoints()); + // Renumber local ids -> global ids + globalIndex(mesh.nPoints()).inplaceToGlobal(mergedIDs); - mergedPts.setSize(returnReduce(set.size(), sumOp