xc
MetisNumberer.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 /* ****************************************************************** **
29 ** OpenSees - Open System for Earthquake Engineering Simulation **
30 ** Pacific Earthquake Engineering Research Center **
31 ** **
32 ** **
33 ** (C) Copyright 1999, The Regents of the University of California **
34 ** All Rights Reserved. **
35 ** **
36 ** Commercial use of this program without express permission of the **
37 ** University of California, Berkeley, is strictly prohibited. See **
38 ** file 'COPYRIGHT' in main directory for information on usage and **
39 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
40 ** **
41 ** Developed by: **
42 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
43 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
44 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
45 ** **
46 ** ****************************************************************** */
47 
48 // $Revision: 1.1.1.1 $
49 // $Date: 2000/09/15 08:23:21 $
50 // $Source: /usr/local/cvs/OpenSees/SRC/graph/numberer/MetisNumberer.h,v $
51 
52 
53 // File: ~/graph/partitioner/Metis.h
54 //
55 // Written: fmk
56 // Created: Sun Sept 15 11:47:47: 1996
57 // Revision: A
58 //
59 // Description: This file contains the class definition for Metis.
60 // Metis is a type of GraphPartitioner which uses 'METIS - Unstructured
61 // Graph Partitioning And Sparse Matrix Ordering System', developed by
62 // G. Karypis and V. Kumar at the University of Minnesota. The metis
63 // files are found in metis-2.0 which were downloaded.
64 // This class provides the C++ interface for metis which will allow
65 // it to fit seamlessly into our system.
66 //
67 // What: "@(#) Metis.h, revA"
68 
69 #ifndef Metis_h
70 #define Metis_h
71 
72 #include <GraphPartitioner.h>
73 
74 namespace XC {
76 //
81 class Metis: public GraphPartitioner
82  {
83  private:
84  bool checkOptions(void);
85 
86  int myPtype ; // package type:
87  // pmetis = 1
88  // kmetis = 2
89 
90  int myMtype; // type of matching scheme:
91  // random = 1
92  // heavy edge = 2
93  // light edge = 3
94  // heavy clique = 4
95  // modified heavy edge = 5
96  // sorted random = 11
97  // sorted heavy edge =21
98  // sorted modified heavy edge = 51
99 
100  int myCoarsenTo; // the number of vertices the graph is coarsened down to
101  // if pmetis default is 100
102  // if kmetis default is 2000
103 
104  int myRtype; // type of refinement policy:
105  // greedy = 1
106  // kernighan-lin = 2
107  // combo greedy and K-L = 3
108  // boundary greedy = 11
109  // boundary K-L = 12
110  // combo of boundary greedy and boundary K-L = 13,
111  // no-refinement = 20
112 
113  int myIPtype; // type of bisection algo:
114  // graph growing partition = 1,
115  // greedy graph growing partition = 2,
116  // spectral bisection = 3,
117  // graph growing followed by K-L = 4
118 
119  bool defaultOptions;
120  protected:
121  friend class DOF_Numberer;
122  Metis(void);
123  Metis(int Ptype, int Mtype, int coarsenTo, int Rtype, int IPtype);
124  GraphNumberer *getCopy(void) const;
125  public:
126  bool setOptions(int Ptype,
127  int Mtype,
128  int coarsenTo,
129  int Rtype,
130  int IPtype);
131 
132  bool setDefaultOptions(void);
133 
134  int partition(Graph &theGraph, int numPart);
135  };
136 } // end of XC namespace
137 
138 #endif
139 
Base class for DOF numbererers.
Definition: DOF_Numberer.h:94
GraphNumberer * getCopy(void) const
Virtual constructor.
Definition: MetisNumberer.cpp:321
bool setOptions(int Ptype, int Mtype, int coarsenTo, int Rtype, int IPtype)
Sets the options for the partitioning to those passed as arguments.
Definition: MetisNumberer.cpp:122
int partition(Graph &theGraph, int numPart)
Method to partition the graph.
Definition: MetisNumberer.cpp:221
Base class for graph partitioners.
Definition: GraphPartitioner.h:85
The Graph class provides the abstraction of a graph.
Definition: Graph.h:94
bool setDefaultOptions(void)
Sets the default options.
Definition: MetisNumberer.cpp:209
type of GraphPartitioner which uses &#39;METIS - Unstructured Graph Partitioning And Sparse Matrix Orderi...
Definition: MetisNumberer.h:81
Numberer for problem&#39;s degrees of freedom.
Definition: GraphNumberer.h:86
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35