/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2016-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . Application reconstructParMesh Group grpParallelUtilities Description Reconstructs a mesh using geometric information only. Writes point/face/cell procAddressing so afterwards reconstructPar can be used to reconstruct fields. Usage \b reconstructParMesh [OPTION] Options: - \par -fullMatch Does geometric matching on all boundary faces. Assumes no point ordering - \par -procMatch Assumes processor patches already in face order but not point order. This is the pre v2106 default behaviour but might be removed if the new topological method works well - \par -mergeTol \ Specifies non-default merge tolerance (fraction of mesh bounding box) for above options The default is to assume all processor boundaries are correctly ordered (both faces and points) in which case no merge tolerance is needed. \*---------------------------------------------------------------------------*/ #include "argList.H" #include "timeSelector.H" #include "IOobjectList.H" #include "labelIOList.H" #include "processorPolyPatch.H" #include "mapAddedPolyMesh.H" #include "polyMeshAdder.H" #include "faceCoupleInfo.H" #include "fvMeshAdder.H" #include "polyTopoChange.H" #include "topoSet.H" #include "regionProperties.H" #include "fvMeshTools.H" using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Tolerance (as fraction of the bounding box). Needs to be fairly lax since // usually meshes get written with limited precision (6 digits) static const scalar defaultMergeTol = 1e-7; // Determine which faces are coupled. Uses geometric merge distance. // Looks either at all boundaryFaces (fullMatch) or only at the // procBoundaries for proci. Assumes that masterMesh contains already merged // all the processors < proci. autoPtr determineCoupledFaces ( const bool fullMatch, const label masterMeshProcStart, const label masterMeshProcEnd, const polyMesh& masterMesh, const label meshToAddProcStart, const label meshToAddProcEnd, const polyMesh& meshToAdd, const scalar mergeDist ) { if (fullMatch || masterMesh.nCells() == 0) { return autoPtr::New ( masterMesh, meshToAdd, mergeDist, // Absolute merging distance true // Matching faces identical ); } else { // Pick up all patches on masterMesh ending in "toDDD" where DDD is // the processor number proci. const polyBoundaryMesh& masterPatches = masterMesh.boundaryMesh(); DynamicList