ENH: gmshToFoam: Updated for line entries

This commit is contained in:
Andrew Heather
2016-10-19 13:20:02 +01:00
parent 3c496ae4c7
commit 509517e996

View File

@ -63,12 +63,17 @@ using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Element type numbers // Element type numbers
static label MSHLINE = 1;
static label MSHTRI = 2; static label MSHTRI = 2;
static label MSHQUAD = 3; static label MSHQUAD = 3;
static label MSHTET = 4; static label MSHTET = 4;
static label MSHPYR = 7;
static label MSHPRISM = 6;
static label MSHHEX = 5; static label MSHHEX = 5;
static label MSHPRISM = 6;
static label MSHPYR = 7;
// Skips till end of section. Returns false if end of file. // Skips till end of section. Returns false if end of file.
@ -424,6 +429,11 @@ void readCells
List<DynamicList<label>>& zoneCells List<DynamicList<label>>& zoneCells
) )
{ {
//$Elements
//number-of-elements
//elm-number elm-type number-of-tags < tag > \u2026 node-number-list
Info<< "Starting to read cells at line " << inFile.lineNumber() << endl; Info<< "Starting to read cells at line " << inFile.lineNumber() << endl;
const cellModel& hex = *(cellModeller::lookup("hex")); const cellModel& hex = *(cellModeller::lookup("hex"));
@ -473,7 +483,6 @@ void readCells
IStringStream lineStr(line); IStringStream lineStr(line);
label elmNumber, elmType, regPhys; label elmNumber, elmType, regPhys;
if (versionFormat >= 2) if (versionFormat >= 2)
{ {
lineStr >> elmNumber >> elmType; lineStr >> elmNumber >> elmType;
@ -499,8 +508,12 @@ void readCells
} }
// regPhys on surface elements is region number. // regPhys on surface elements is region number.
if (elmType == MSHLINE)
if (elmType == MSHTRI) {
label meshPti;
lineStr >> meshPti >> meshPti;
}
else if (elmType == MSHTRI)
{ {
lineStr >> triPoints[0] >> triPoints[1] >> triPoints[2]; lineStr >> triPoints[0] >> triPoints[1] >> triPoints[2];