changing mesh-dimension from 3 to 2 moves names

This commit is contained in:
Joachim Schoeberl 2021-08-15 13:13:11 +02:00
parent 97447d681f
commit 9d2a436749
2 changed files with 23 additions and 1 deletions

View File

@ -4391,7 +4391,29 @@ namespace netgen
return ndom;
}
void Mesh :: SetDimension (int dim)
{
if (dimension == 3 && dim == 2)
{
// change mesh-dim from 3 to 2 (currently needed for OCC)
for (auto str : materials)
delete str;
materials.SetSize(0);
for (auto str : bcnames)
materials.Append(str);
bcnames.SetSize(0);
for (auto str : cd2names)
bcnames.Append(str);
cd2names.SetSize(0);
for (auto str : cd3names)
cd2names.Append(str);
cd3names.SetSize(0);
for (auto & seg : LineSegments())
seg.si = seg.edgenr;
}
dimension = dim;
}
void Mesh :: SurfaceMeshOrientation ()
{

View File

@ -379,7 +379,7 @@ namespace netgen
DLL_HEADER int GetNDomains() const;
///
int GetDimension() const { return dimension; }
void SetDimension (int dim) { dimension = dim; }
void SetDimension (int dim); // { dimension = dim; }
/// sets internal tables
DLL_HEADER void CalcSurfacesOfNode ();