metis partition

This commit is contained in:
Joachim Schoeberl 2015-02-05 22:53:17 +00:00
parent 257e76c083
commit 0a9b74185f

View File

@ -2650,14 +2650,33 @@ namespace netgen
Tcl_Interp * interp,
int argc, tcl_const char *argv[])
{
#ifdef METISold
#ifdef PARALLEL
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() );
return TCL_OK;
#else
Tcl_SetResult (interp, (char*)"metis not available", TCL_STATIC);
return TCL_ERROR;
#endif
#ifdef OLDOLD
// METIS Partitioning
if (mesh->GetDimension() == 3)