diff --git a/libsrc/include/nginterface_v2.hpp b/libsrc/include/nginterface_v2.hpp index 0317022f..32c4e16f 100644 --- a/libsrc/include/nginterface_v2.hpp +++ b/libsrc/include/nginterface_v2.hpp @@ -229,6 +229,9 @@ namespace netgen bool build_searchtrees = false, int * const indices = NULL, int numind = 0) const; + + std::tuple GetDistantProcs (int nodetype, int locnum) const; + shared_ptr SelectMesh () const; }; diff --git a/libsrc/interface/nginterface_v2.cpp b/libsrc/interface/nginterface_v2.cpp index 20538d01..6e6724f4 100644 --- a/libsrc/interface/nginterface_v2.cpp +++ b/libsrc/interface/nginterface_v2.cpp @@ -660,6 +660,31 @@ namespace netgen } + + std::tuple Ngx_Mesh :: GetDistantProcs (int nodetype, int locnum) const + { + + switch (nodetype) + { + case 0: + { + FlatArray dn = mesh->GetParallelTopology().GetDistantPNums(locnum); + return std::tuple(dn.Size(), &dn[0]); + } + case 1: + { + FlatArray dn = mesh->GetParallelTopology().GetDistantEdgeNums(locnum); + return std::tuple(dn.Size(), &dn[0]); + } + case 2: + { + FlatArray dn = mesh->GetParallelTopology().GetDistantFaceNums(locnum); + return std::tuple(dn.Size(), &dn[0]); + } + default: + return std::tuple(0,nullptr); + } + } } diff --git a/libsrc/meshing/Makefile.am b/libsrc/meshing/Makefile.am index 88549516..8e0705fc 100644 --- a/libsrc/meshing/Makefile.am +++ b/libsrc/meshing/Makefile.am @@ -34,5 +34,5 @@ libmesh_la_SOURCES = adfront2.cpp adfront3.cpp bisect.cpp boundarylayer.cpp \ libmesh_la_LIBADD = $(top_builddir)/libsrc/linalg/libla.la \ $(top_builddir)/libsrc/gprim/libgprim.la \ $(top_builddir)/libsrc/general/libgen.la \ - -lz + -lz $(MPI_LIBS) diff --git a/libsrc/meshing/paralleltop.hpp b/libsrc/meshing/paralleltop.hpp index a12d60cf..cb4b41ab 100644 --- a/libsrc/meshing/paralleltop.hpp +++ b/libsrc/meshing/paralleltop.hpp @@ -93,6 +93,10 @@ namespace netgen distedgenums = loc2distedge[locedgenum-1]; } + FlatArray GetDistantPNums (int locnum) const { return loc2distvert[locnum]; } + FlatArray GetDistantFaceNums (int locnum) const { return loc2distface[locnum]; } + FlatArray GetDistantEdgeNums (int locnum) const { return loc2distedge[locnum]; } + bool IsExchangeVert (int dest, int vnum) const { return loc2distvert[vnum-1].Contains (dest);