/*---------------------------------------------------------------------------*\ ========= | \\ / 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 2 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA \*---------------------------------------------------------------------------*/ #include "distributedTriSurfaceMesh.H" #include "mapDistribute.H" #include "Random.H" #include "addToRunTimeSelectionTable.H" #include "triangleFuncs.H" #include "matchPoints.H" #include "globalIndex.H" #include "Time.H" #include "IFstream.H" #include "decompositionMethod.H" #include "vectorList.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(distributedTriSurfaceMesh, 0); addToRunTimeSelectionTable(searchableSurface, distributedTriSurfaceMesh, dict); } template<> const char* Foam::NamedEnum::names[] = { "follow", "independent", "frozen" }; const Foam::NamedEnum Foam::distributedTriSurfaceMesh::distributionTypeNames_; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // Read my additional data from the dictionary bool Foam::distributedTriSurfaceMesh::read() { // Get bb of all domains. procBb_.setSize(Pstream::nProcs()); procBb_[Pstream::myProcNo()] = List(dict_.lookup("bounds")); Pstream::gatherList(procBb_); Pstream::scatterList(procBb_); // Distribution type distType_ = distributionTypeNames_.read(dict_.lookup("distributionType")); if (dict_.found("mergeDistance")) { dict_.lookup("mergeDistance") >> mergeDist_; } return true; } // Is segment fully local? bool Foam::distributedTriSurfaceMesh::isLocal ( const List& myBbs, const point& start, const point& end ) { forAll(myBbs, bbI) { if (myBbs[bbI].contains(start) && myBbs[bbI].contains(end)) { return true; } } return false; } //void Foam::distributedTriSurfaceMesh::splitSegment //( // const label segmentI, // const point& start, // const point& end, // const treeBoundBox& bb, // // DynamicList& allSegments, // DynamicList