Metis.h

Go to the documentation of this file.
00001 /* ****************************************************************** **
00002 **    OpenSees - Open System for Earthquake Engineering Simulation    **
00003 **          Pacific Earthquake Engineering Research Center            **
00004 **                                                                    **
00005 **                                                                    **
00006 ** (C) Copyright 1999, The Regents of the University of California    **
00007 ** All Rights Reserved.                                               **
00008 **                                                                    **
00009 ** Commercial use of this program without express permission of the   **
00010 ** University of California, Berkeley, is strictly prohibited.  See   **
00011 ** file 'COPYRIGHT'  in main directory for information on usage and   **
00012 ** redistribution,  and for a DISCLAIMER OF ALL WARRANTIES.           **
00013 **                                                                    **
00014 ** Developed by:                                                      **
00015 **   Frank McKenna (fmckenna@ce.berkeley.edu)                         **
00016 **   Gregory L. Fenves (fenves@ce.berkeley.edu)                       **
00017 **   Filip C. Filippou (filippou@ce.berkeley.edu)                     **
00018 **                                                                    **
00019 ** ****************************************************************** */
00020                                                                         
00021 // $Revision: 1.2 $
00022 // $Date: 2006/01/12 23:37:19 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/graph/partitioner/Metis.h,v $
00024                                                                         
00025                                                                         
00026 // Written: fmk 
00027 //
00028 // Description: This file contains the class definition for Metis.
00029 // Metis is a type of GraphPartitioner which uses 'METIS - Unstructured
00030 // Graph Partitioning And Sparse Matrix Ordering System', developed by
00031 // G. Karypis and V. Kumar at the University of Minnesota. The metis
00032 // files are found in metis-2.0 which were downloaded.
00033 //     This class provides the C++ interface for metis which will allow
00034 // it to fit seamlessly into our system.
00035 //
00036 // What: "@(#) Metis.h, revA"
00037 
00038 #ifndef Metis_h
00039 #define Metis_h
00040 
00041 #include <GraphPartitioner.h>
00042 #include <GraphNumberer.h>
00043 
00044 #ifndef _bool_h
00045 #include <bool.h>
00046 #endif
00047 
00048 class Metis : public GraphPartitioner, public GraphNumberer
00049 {
00050   public:
00051     Metis(int numParts =1);
00052     Metis(int Ptype, 
00053           int Mtype, 
00054           int coarsenTo,
00055           int Rtype, 
00056           int IPtype,
00057           int numParts =1);
00058     ~Metis();
00059 
00060     bool setOptions(int Ptype, 
00061                     int Mtype,
00062                     int coarsenTo,
00063                     int Rtype, 
00064                     int IPtype);
00065 
00066     bool setDefaultOptions(void);
00067     
00068     int partition(Graph &theGraph, int numPart);
00069 
00070     // the follwing methods are if the object is to be used as a numberer
00071     const ID &number(Graph &theGraph, int lastVertex = -1);
00072     const ID &number(Graph &theGraph, const ID &lastVertices);
00073 
00074     int sendSelf(int commitTag, 
00075                  Channel &theChannel);
00076     int recvSelf(int commitTag, Channel &theChannel, 
00077                  FEM_ObjectBroker &theBroker);
00078 
00079     
00080   protected:
00081 
00082   private:
00083     bool checkOptions(void);
00084     
00085     int myPtype ;       // package type: 
00086                         //      pmetis = 1
00087                         //      kmetis = 2
00088 
00089     int myMtype;        // type of matching scheme: 
00090                         //      random = 1
00091                         //      heavy edge = 2
00092                         //      light edge = 3
00093                         //      heavy clique = 4
00094                         //      modified heavy edge = 5
00095                         //      sorted random = 11
00096                         //      sorted heavy edge =21
00097                         //      sorted modified heavy edge = 51
00098    
00099    int myCoarsenTo;     // the number of vertices the graph is coarsened down to
00100                         //      if pmetis default is 100
00101                         //      if kmetis default is 2000
00102         
00103     int myRtype;        // type of refinement policy:  
00104                         //      greedy = 1
00105                         //      kernighan-lin = 2
00106                         //      combo greedy and K-L = 3
00107                         //      boundary greedy = 11
00108                         //      boundary K-L = 12
00109                         //      combo of boundary greedy and boundary K-L = 13,
00110                         //      no-refinement = 20
00111 
00112     int myIPtype;       // type of bisection algo:  
00113                         //      graph growing partition = 1,
00114                         //      greedy graph growing partition = 2,
00115                         //      spectral bisection = 3,
00116                         //      graph growing followed by K-L = 4
00117         
00118     bool defaultOptions;                            
00119     
00120     int   numPartitions; // needed if to be used as a numberer
00121     ID    *theRefResult;
00122 };
00123 
00124 #endif
00125 

Generated on Mon Oct 23 15:05:12 2006 for OpenSees by doxygen 1.5.0