/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 1991-2010 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 . Description Manipulate a cell/face/point/ set or zone interactively. \*---------------------------------------------------------------------------*/ #include "argList.H" #include "Time.H" #include "polyMesh.H" #include "globalMeshData.H" #include "IStringStream.H" #include "cellSet.H" #include "faceSet.H" #include "pointSet.H" #include "topoSetSource.H" #include "OFstream.H" #include "IFstream.H" #include "demandDrivenData.H" #include "writePatch.H" #include "writePointSet.H" #include "IOobjectList.H" #include "cellZoneSet.H" #include "faceZoneSet.H" #include "pointZoneSet.H" #include "timeSelector.H" #include #ifdef HAS_READLINE # include # include #endif using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef HAS_READLINE static const char* historyFile = ".setSet"; #endif // Write set to VTK readable files void writeVTK ( const polyMesh& mesh, const topoSet& currentSet, const fileName& vtkName ) { if (isA(currentSet)) { // Faces of set with OpenFOAM faceID as value faceList setFaces(currentSet.size()); labelList faceValues(currentSet.size()); label setFaceI = 0; forAllConstIter(topoSet, currentSet, iter) { setFaces[setFaceI] = mesh.faces()[iter.key()]; faceValues[setFaceI] = iter.key(); setFaceI++; } primitiveFacePatch fp(setFaces, mesh.points()); writePatch ( true, currentSet.name(), fp, "faceID", faceValues, mesh.time().path()/vtkName ); } else if (isA(currentSet)) { // External faces of cellset with OpenFOAM cellID as value Map