/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | foam-extend: Open Source CFD \\ / O peration | \\ / A nd | For copyright notice see file Copyright \\/ M anipulation | ------------------------------------------------------------------------------- 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 Reads .msh file as written by Gmsh. Needs surface elements on mesh to be present and aligned with outside faces of the mesh. I.e. if the mesh is hexes, the outside faces need to be quads Note: There is something seriously wrong with the ordering written in the .msh file. Normal operation is to check the ordering and invert prisms and hexes if found to be wrong way round. Use the -keepOrientation to keep the raw information. Note: The code now uses the element (cell,face) physical region id number to create cell zones and faces zones (similar to fluentMeshWithInternalFaces). A use of the cell zone information, is for field initialization with the "setFields" utility. see the classes: topoSetSource, zoneToCell. \*---------------------------------------------------------------------------*/ #include "argList.H" #include "polyMesh.H" #include "Time.H" #include "polyMesh.H" #include "IFstream.H" #include "cellModeller.H" #include "repatchPolyTopoChanger.H" #include "cellSet.H" #include "faceSet.H" using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Element type numbers static label MSHTRI = 2; static label MSHQUAD = 3; static label MSHTET = 4; static label MSHPYR = 7; static label MSHPRISM = 6; static label MSHHEX = 5; // Skips till end of section. Returns false if end of file. bool skipSection(IFstream& inFile) { string line; do { inFile.getLine(line); if (!inFile.good()) { return false; } } while (line.size() < 4 || line.substr(0, 4) != "$End"); return true; } void renumber ( const Map