source: inundation/pymetis/metis-4.0/Lib/mrefine2.c @ 2051

Last change on this file since 2051 was 2051, checked in by jack, 19 years ago

Python interface to metis. Currently provides only the
METIS_PartMeshNodal function, since that is what is currently needed for partitioning.
Module name is metis.

File size: 1.5 KB
Line 
1/*
2 * Copyright 1997, Regents of the University of Minnesota
3 *
4 * mrefine2.c
5 *
6 * This file contains the driving routines for multilevel refinement
7 *
8 * Started 7/24/97
9 * George
10 *
11 * $Id: mrefine2.c,v 1.1 1998/11/27 17:59:26 karypis Exp $
12 */
13
14#include <metis.h>
15
16
17/*************************************************************************
18* This function is the entry point of refinement
19**************************************************************************/
20void MocRefine2Way2(CtrlType *ctrl, GraphType *orggraph, GraphType *graph, float *tpwgts, 
21       float *ubvec)
22{
23
24  IFSET(ctrl->dbglvl, DBG_TIME, starttimer(ctrl->UncoarsenTmr));
25
26  /* Compute the parameters of the coarsest graph */
27  MocCompute2WayPartitionParams(ctrl, graph);
28
29  for (;;) {
30    ASSERT(CheckBnd(graph));
31
32    IFSET(ctrl->dbglvl, DBG_TIME, starttimer(ctrl->RefTmr));
33    switch (ctrl->RType) {
34      case RTYPE_FM:
35        MocBalance2Way2(ctrl, graph, tpwgts, ubvec);
36        MocFM_2WayEdgeRefine2(ctrl, graph, tpwgts, ubvec, 8); 
37        break;
38      default:
39        errexit("Unknown refinement type: %d\n", ctrl->RType);
40    }
41    IFSET(ctrl->dbglvl, DBG_TIME, stoptimer(ctrl->RefTmr));
42
43    if (graph == orggraph)
44      break;
45
46    graph = graph->finer;
47    IFSET(ctrl->dbglvl, DBG_TIME, starttimer(ctrl->ProjectTmr));
48    MocProject2WayPartition(ctrl, graph);
49    IFSET(ctrl->dbglvl, DBG_TIME, stoptimer(ctrl->ProjectTmr));
50  }
51
52  IFSET(ctrl->dbglvl, DBG_TIME, stoptimer(ctrl->UncoarsenTmr));
53}
54
55
Note: See TracBrowser for help on using the repository browser.