diff --git a/libsrc/include/nginterface_v2.hpp b/libsrc/include/nginterface_v2.hpp index 8989e3ae..716e01a8 100644 --- a/libsrc/include/nginterface_v2.hpp +++ b/libsrc/include/nginterface_v2.hpp @@ -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; }; diff --git a/libsrc/interface/nginterface_v2.cpp b/libsrc/interface/nginterface_v2.cpp index a6fb2c0a..9233c5a7 100644 --- a/libsrc/interface/nginterface_v2.cpp +++ b/libsrc/interface/nginterface_v2.cpp @@ -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