/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | foam-extend: Open Source CFD \\ / O peration | Version: 3.2 \\ / A nd | Web: http://www.foam-extend.org \\/ M anipulation | For copyright notice see file Copyright ------------------------------------------------------------------------------- License This file is part of foam-extend. foam-extend 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. foam-extend 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 foam-extend. If not, see . Description Writes out the FOAM mesh in pro-STAR (v4) bnd/cel/vrt format. Alternatively, extracts the surface of the FOAM mesh into pro-STAR (v4) .cel/.vrt/ format. This can be useful, for example, for surface morphing in an external package. The cellTableId and cellTable information are used (if available). Otherwise the cellZones are used (if available). \*---------------------------------------------------------------------------*/ #include "argList.H" #include "foamTime.H" #include "volFields.H" #include "cellModeller.H" #include "SortableList.H" #include "OFstream.H" using namespace Foam; // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // Cell shape models static const cellModel* unknownPtr_ = cellModeller::lookup("unknown"); static const cellModel* tetPtr_ = cellModeller::lookup("tet"); static const cellModel* pyrPtr_ = cellModeller::lookup("pyr"); static const cellModel* prismPtr_ = cellModeller::lookup("prism"); static const cellModel* hexPtr_ = cellModeller::lookup("hex"); // face addressing from foam faces -> pro-STAR faces for primitive shapes static const label foamToStarFaceAddressing[4][6] = { { 4, 5, 2, 3, 0, 1 }, // 11 = hex { 0, 1, 4, 5, 2, -1 }, // 12 = prism { 5, 4, 2, 0, -1, -1 }, // 13 = tetra { 0, 4, 3, 5, 2, -1 } // 14 = pyramid }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // use file globals until we make a class static labelList cellTableId_; // a very stripped-down cell table // - map the cell type id -> material type id (1 = fluid, 2 = solid) static Map