Skip to content
Snippets Groups Projects
Commit 580fca6d authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

warn if unknown element type

parent dc9052c9
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@ int GModel::readUNV(const std::string &name)
int record = 0;
sscanf(buffer, "%d", &record);
if(record == 2411){ // nodes
Msg::Info("Reading nodes");
while(fgets(buffer, sizeof(buffer), fp)){
if(!strncmp(buffer, " -1", 6)) break;
int num, dum;
......@@ -51,6 +52,8 @@ int GModel::readUNV(const std::string &name)
}
}
else if(record == 2412){ // elements
Msg::Info("Reading elements");
std::map<int, int> warn;
while(fgets(buffer, sizeof(buffer), fp)){
if(strlen(buffer) < 3) continue; // possible line ending after last fscanf
if(!strncmp(buffer, " -1", 6)) break;
......@@ -154,6 +157,10 @@ int GModel::readUNV(const std::string &name)
vertices[10], vertices[14], vertices[12], num));
dim = 3;
break;
default:
if(warn[type]++ == 1)
Msg::Warning("Skipping unknown type of element %d", type);
break;
}
if(dim >= 0 && physical && (!physicals[dim].count(elementary) ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment