/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ 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 "triSurfaceMesh.H" #include "Random.H" #include "addToRunTimeSelectionTable.H" #include "EdgeMap.H" #include "triSurfaceFields.H" #include "Time.H" #include "PackedBoolList.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(triSurfaceMesh, 0); addToRunTimeSelectionTable(searchableSurface, triSurfaceMesh, dict); } // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // //// Special version of Time::findInstance that does not check headerOk //// to search for instances of raw files //Foam::word Foam::triSurfaceMesh::findRawInstance //( // const Time& runTime, // const fileName& dir, // const word& name //) //{ // // Check current time first // if (isFile(runTime.path()/runTime.timeName()/dir/name)) // { // return runTime.timeName(); // } // instantList ts = runTime.times(); // label instanceI; // // for (instanceI = ts.size()-1; instanceI >= 0; --instanceI) // { // if (ts[instanceI].value() <= runTime.timeOutputValue()) // { // break; // } // } // // // continue searching from here // for (; instanceI >= 0; --instanceI) // { // if (isFile(runTime.path()/ts[instanceI].name()/dir/name)) // { // return ts[instanceI].name(); // } // } // // // // not in any of the time directories, try constant // // // Note. This needs to be a hard-coded constant, rather than the // // constant function of the time, because the latter points to // // the case constant directory in parallel cases // // if (isFile(runTime.path()/runTime.constant()/dir/name)) // { // return runTime.constant(); // } // // FatalErrorIn // ( // "searchableSurfaces::findRawInstance" // "(const Time&, const fileName&, const word&)" // ) << "Cannot find file \"" << name << "\" in directory " // << runTime.constant()/dir // << exit(FatalError); // // return runTime.constant(); //} //- Check file existence const Foam::fileName& Foam::triSurfaceMesh::checkFile ( const fileName& fName, const fileName& objectName ) { if (fName.empty()) { FatalErrorIn ( "triSurfaceMesh::checkFile(const fileName&, const fileName&)" ) << "Cannot find triSurfaceMesh starting from " << objectName << exit(FatalError); } return fName; } bool Foam::triSurfaceMesh::addFaceToEdge ( const edge& e, EdgeMap