diff --git a/libsrc/interface/nginterface_v2.cpp b/libsrc/interface/nginterface_v2.cpp index 10e8c498..3f7b001e 100644 --- a/libsrc/interface/nginterface_v2.cpp +++ b/libsrc/interface/nginterface_v2.cpp @@ -1326,11 +1326,14 @@ FlatArray Ngx_Mesh :: GetDistantProcs (int nodetype, int locnum) const switch (nodetype) { case 0: - return mesh->GetParallelTopology().GetDistantPNums(locnum); + // return mesh->GetParallelTopology().GetDistantPNums(locnum); + return mesh->GetParallelTopology().GetDistantProcs(locnum+PointIndex::BASE); case 1: - return mesh->GetParallelTopology().GetDistantEdgeNums(locnum); + // return mesh->GetParallelTopology().GetDistantEdgeNums(locnum); + return mesh->GetParallelTopology().GetDistantEdgeProcs(locnum); case 2: - return mesh->GetParallelTopology().GetDistantFaceNums(locnum); + // return mesh->GetParallelTopology().GetDistantFaceNums(locnum); + return mesh->GetParallelTopology().GetDistantFaceProcs(locnum); default: return FlatArray(0, nullptr); } diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index 0fb605d0..83a4dfd9 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -1190,6 +1190,7 @@ namespace netgen ostream & operator<< (ostream & s, const FaceDescriptor & fd); + class EdgeDescriptor { diff --git a/libsrc/meshing/paralleltop.hpp b/libsrc/meshing/paralleltop.hpp index f6826328..b3e7c919 100644 --- a/libsrc/meshing/paralleltop.hpp +++ b/libsrc/meshing/paralleltop.hpp @@ -76,18 +76,19 @@ namespace netgen [[deprecated("Use L2G(pi) instead!")]] void SetLoc2Glob_Vert (int locnum, int globnum) { glob_vert[locnum-1] = globnum; } - [[deprecated("Try to avoid global enumration!")]] + // [[deprecated("Try to avoid global enumration!")]] void SetLoc2Glob_Edge (int locnum, int globnum) { glob_edge[locnum-1] = globnum; } - [[deprecated("Try to avoid global enumration!")]] + // [[deprecated("Try to avoid global enumration!")]] void SetLoc2Glob_Face (int locnum, int globnum) { glob_face[locnum-1] = globnum; } - [[deprecated("Try to avoid global enumration!")]] + // [[deprecated("Try to avoid global enumration!")]] void SetLoc2Glob_VolEl (int locnum, int globnum) { glob_el[locnum-1] = globnum; } - [[deprecated("Try to avoid global enumration!")]] + // [[deprecated("Try to avoid global enumration!")]] void SetLoc2Glob_SurfEl (int locnum, int globnum) { glob_surfel[locnum-1] = globnum; } - [[deprecated("Try to avoid global enumration!")]] + // [[deprecated("Try to avoid global enumration!")]] void SetLoc2Glob_Segm (int locnum, int globnum) { glob_segm[locnum-1] = globnum; } - int GetGlobalPNum (int locnum) const { return glob_vert[locnum-1]; } + // [[deprecated("Try to avoid global enumration!")]] + int GetGlobalPNum (PointIndex locnum) const { return glob_vert[locnum-PointIndex::BASE]; } [[deprecated("Try to avoid global enumration!")]] int GetGlobalEdgeNum (int locnum) const { return glob_edge[locnum-1]; } [[deprecated("Try to avoid global enumration!")]] diff --git a/libsrc/occ/python_occ.cpp b/libsrc/occ/python_occ.cpp index f13deb2e..e0b67031 100644 --- a/libsrc/occ/python_occ.cpp +++ b/libsrc/occ/python_occ.cpp @@ -247,7 +247,7 @@ DLL_HEADER void ExportNgOCC(py::module &m) return res; }, py::call_guard()) .def("GenerateMesh", [](shared_ptr geo, - MeshingParameters* pars, py::kwargs kwargs) + MeshingParameters* pars, NgMPI_Comm comm, py::kwargs kwargs) { MeshingParameters mp; OCCParameters occparam; @@ -264,14 +264,25 @@ DLL_HEADER void ExportNgOCC(py::module &m) } geo->SetOCCParameters(occparam); auto mesh = make_shared(); + mesh->SetCommunicator(comm); mesh->SetGeometry(geo); - SetGlobalMesh(mesh); - auto result = geo->GenerateMesh(mesh, mp); - if(result != 0) - throw Exception("Meshing failed!"); - ng_geometry = geo; + + if (comm.Rank()==0) + { + SetGlobalMesh(mesh); + auto result = geo->GenerateMesh(mesh, mp); + if(result != 0) + throw Exception("Meshing failed!"); + ng_geometry = geo; + if (comm.Size() > 1) + mesh->Distribute(); + } + else + { + mesh->SendRecvMesh(); + } return mesh; - }, py::arg("mp") = nullptr, + }, py::arg("mp") = nullptr, py::arg("comm")=NgMPI_Comm{}, py::call_guard(), (meshingparameter_description + occparameter_description).c_str()) .def_property_readonly("shape", [](const OCCGeometry & self) { return self.GetShape(); })