mpi distant-procs

This commit is contained in:
Joachim Schoeberl 2014-12-02 21:50:38 +00:00
parent 8e8e390f2e
commit 906334f224
4 changed files with 33 additions and 1 deletions

View File

@ -229,6 +229,9 @@ namespace netgen
bool build_searchtrees = false,
int * const indices = NULL, int numind = 0) const;
std::tuple<int,int*> GetDistantProcs (int nodetype, int locnum) const;
shared_ptr<Mesh> SelectMesh () const;
};

View File

@ -660,6 +660,31 @@ namespace netgen
}
std::tuple<int,int*> Ngx_Mesh :: GetDistantProcs (int nodetype, int locnum) const
{
switch (nodetype)
{
case 0:
{
FlatArray<int> dn = mesh->GetParallelTopology().GetDistantPNums(locnum);
return std::tuple<int,int*>(dn.Size(), &dn[0]);
}
case 1:
{
FlatArray<int> dn = mesh->GetParallelTopology().GetDistantEdgeNums(locnum);
return std::tuple<int,int*>(dn.Size(), &dn[0]);
}
case 2:
{
FlatArray<int> dn = mesh->GetParallelTopology().GetDistantFaceNums(locnum);
return std::tuple<int,int*>(dn.Size(), &dn[0]);
}
default:
return std::tuple<int,int*>(0,nullptr);
}
}
}

View File

@ -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)

View File

@ -93,6 +93,10 @@ namespace netgen
distedgenums = loc2distedge[locedgenum-1];
}
FlatArray<int> GetDistantPNums (int locnum) const { return loc2distvert[locnum]; }
FlatArray<int> GetDistantFaceNums (int locnum) const { return loc2distface[locnum]; }
FlatArray<int> GetDistantEdgeNums (int locnum) const { return loc2distedge[locnum]; }
bool IsExchangeVert (int dest, int vnum) const
{
return loc2distvert[vnum-1].Contains (dest);