/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2015-2017 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 . \*---------------------------------------------------------------------------*/ #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 "geomDecomp.H" #include "vectorList.H" #include "PackedBoolList.H" #include "PatchTools.H" #include "OBJstream.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(distributedTriSurfaceMesh, 0); addToRunTimeSelectionTable ( searchableSurface, distributedTriSurfaceMesh, dict ); template<> const char* Foam::NamedEnum < Foam::distributedTriSurfaceMesh::distributionType, 3 >::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")); // Merge distance mergeDist_ = readScalar(dict_.lookup("mergeDistance")); 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