/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- 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 . \*---------------------------------------------------------------------------*/ #include "globalMeshData.H" #include "Time.H" #include "Pstream.H" #include "PstreamCombineReduceOps.H" #include "processorPolyPatch.H" #include "demandDrivenData.H" #include "globalPoints.H" //#include "geomGlobalPoints.H" #include "polyMesh.H" #include "mapDistribute.H" #include "labelIOList.H" #include "PackedList.H" #include "mergePoints.H" #include "matchPoints.H" #include "OFstream.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // defineTypeNameAndDebug(Foam::globalMeshData, 0); // Geometric matching tolerance. Factor of mesh bounding box. const Foam::scalar Foam::globalMeshData::matchTol_ = 1E-8; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // Collect processor patch addressing. void Foam::globalMeshData::initProcAddr() { processorPatchIndices_.setSize(mesh_.boundaryMesh().size()); processorPatchIndices_ = -1; processorPatchNeighbours_.setSize(mesh_.boundaryMesh().size()); processorPatchNeighbours_ = -1; // Construct processor patch indexing. processorPatchNeighbours_ only // set if running in parallel! processorPatches_.setSize(mesh_.boundaryMesh().size()); label nNeighbours = 0; forAll(mesh_.boundaryMesh(), patchi) { if (isA(mesh_.boundaryMesh()[patchi])) { processorPatches_[nNeighbours] = patchi; processorPatchIndices_[patchi] = nNeighbours++; } } processorPatches_.setSize(nNeighbours); if (Pstream::parRun()) { // Send indices of my processor patches to my neighbours forAll(processorPatches_, i) { label patchi = processorPatches_[i]; OPstream toNeighbour ( Pstream::blocking, refCast ( mesh_.boundaryMesh()[patchi] ).neighbProcNo() ); toNeighbour << processorPatchIndices_[patchi]; } forAll(processorPatches_, i) { label patchi = processorPatches_[i]; IPstream fromNeighbour ( Pstream::blocking, refCast ( mesh_.boundaryMesh()[patchi] ).neighbProcNo() ); fromNeighbour >> processorPatchNeighbours_[patchi]; } } } // Given information about locally used edges allocate global shared edges. void Foam::globalMeshData::countSharedEdges ( const EdgeMap& procSharedEdges, EdgeMap