write identification names into mesh

This commit is contained in:
Christopher Lackner 2024-08-30 11:01:03 +02:00
parent 7f5df05bb7
commit bda192ba90
2 changed files with 31 additions and 0 deletions

View File

@ -901,6 +901,13 @@ namespace netgen
outfile << " " << type;
}
outfile << "\n";
outfile << "identificationnames\n";
outfile << ident -> GetMaxNr() << "\n";
for (i = 1; i <= ident -> GetMaxNr(); i++)
{
string name = ident -> GetName(i);
outfile << ident->GetName(i) << "\n";
}
}
int cntmat = 0;
@ -1451,6 +1458,17 @@ namespace netgen
ident -> SetType(i,Identifications::ID_TYPE(type));
}
}
if (strcmp (str, "identificationnames") == 0)
{
infile >> n;
PrintMessage (3, n, " identificationnames");
for (i = 1; i <= n; i++)
{
string name;
infile >> name;
ident -> SetName(i,name);
}
}
if (strcmp (str, "materials") == 0)
{

View File

@ -1642,6 +1642,19 @@ namespace netgen
names.Append(name);
return names.Pos(name)+1;
}
string GetName(int nr) const
{
if (nr <= names.Size())
return names[nr - 1];
else
return "";
}
void SetName(int nr, string name)
{
while(names.Size() < nr)
names.Append("");
names[nr-1] = name;
}
/// remove secondorder
void SetMaxPointNr (int maxpnum);