more to nginterface2

This commit is contained in:
Joachim Schoeberl 2024-12-13 16:48:37 +01:00
parent 0bb738b29e
commit 868ee9643f
2 changed files with 34 additions and 0 deletions

View File

@ -374,6 +374,10 @@ namespace netgen
int GetClusterRepEdge (int edi) const;
int GetClusterRepFace (int fai) const;
int GetClusterRepElement (int eli) const;
// just copied from nginterface, now 0-based
int GetElement_Faces (int elnr, int * faces, int * orient = 0) const;
int GetSurfaceElement_Face (int selnr, int * orient = 0) const;
};

View File

@ -1297,6 +1297,36 @@ int Ngx_Mesh::GetClusterRepElement (int pi) const
}
int Ngx_Mesh::GetElement_Faces (int elnr, int * faces, int * orient) const
{
const MeshTopology & topology = mesh->GetTopology();
if (mesh->GetDimension() == 3)
{
int num = topology.GetElementFaces (elnr+1, faces, orient);
for (int i = 0; i < num; i++)
faces[i]--;
return num;
}
else
{
faces[0] = elnr;
if (orient) orient[0] = 0;
return 1;
}
}
int Ngx_Mesh::GetSurfaceElement_Face (int selnr, int * orient) const
{
if (mesh->GetDimension() == 3)
{
const MeshTopology & topology = mesh->GetTopology();
if (orient)
*orient = topology.GetSurfaceElementFaceOrientation (selnr+1);
return topology.GetSurfaceElementFace (selnr+1)-1;
}
return -1;
}
//HERBERT: falsche Anzahl von Argumenten