From 492cff546dcf99244da5f4b1764d8ee1b5421b3a Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Wed, 4 Feb 2015 13:35:44 +0000 Subject: [PATCH] metis partition --- ng/ngpkg.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ng/ngpkg.cpp b/ng/ngpkg.cpp index 953fb4ab..c2bf1661 100644 --- a/ng/ngpkg.cpp +++ b/ng/ngpkg.cpp @@ -2650,6 +2650,21 @@ namespace netgen Tcl_Interp * interp, int argc, tcl_const char *argv[]) { + if (!mesh) + { + Tcl_SetResult (interp, err_needsmesh, TCL_STATIC); + return TCL_ERROR; + } + + int nparts = atoi (argv[1]); + ntasks = nparts+1; + cout << "calling metis ... " << flush; + mesh->ParallelMetis(); + cout << "done" << endl; + ntasks = 1; + for (ElementIndex ei = 0; ei < mesh->GetNE(); ei++) + (*mesh)[ei].SetIndex ( (*mesh)[ei].GetPartition() ); + #ifdef METISold if (!mesh)