forked from johannesgerer/jburkardt-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
neighbors_to_metis_graph.html
316 lines (278 loc) · 9.07 KB
/
neighbors_to_metis_graph.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
<html>
<head>
<title>
NEIGHBORS_TO_METIS_GRAPH - Reformat Tet Mesh Neighbor File
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
NEIGHBORS_TO_METIS_GRAPH <br> Reformat Tet Mesh Neighbor File
</h1>
<hr>
<p>
<b>NEIGHBORS_TO_METIS_GRAPH</b>
is a C++ program which
reads a file describing
the graph-theoretic adjacency structure of the
elements in a mesh of triangles or tetrahedrons and writes out a similar file
that is suitable for input to the mesh partitioning
program <a href = "../../c_src/metis/metis.html">METIS</a>.
</p>
<p>
Since we know we are dealing with a triangle or tet mesh, each "node" of
the adjacency graph has 3 or 4 potential edges. If a potential
edge is not used (in other words, if a face is a boundary face),
then by convention we write out a "-1" for the neighbor value.
Otherwise, the adjacency information lists the index of the
element that is a neighbor on that face of the
element
</p>
<p>
Converting to a METIS GRAPH format is trivial. We include
an initial line that lists the number of "nodes" (elements)
and "edges" (interfaces between pairs of elements), followed by,
for each node (element), a list of the adjacent nodes (a list
of the adjacent elements, omitting the "-1" values). A cross-eyed
schoolboy sitting on a tack would be able to carry out this task!
</p>
<h3 align = "center">
Usage:
</h3>
<p>
<dl>
<dt>
<b>neighbors_to_metis_graph</b> <i>neighbor_file</i>
</dt>
<dd>
reads the data in <i>neighbor_file</i>, rearranges it to
suit <b>METIS</b>, and writes out the modified data to
<i>metis_graph_file</i>
</dd>
</dl>
</p>
<h3 align = "center">
Licensing:
</h3>
<p>
The computer code and data files described and made available on this web page
are distributed under
<a href = "../../txt/gnu_lgpl.txt">the GNU LGPL license.</a>
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>NEIGHBORS_TO_METIS_GRAPH</b> is available in
<a href = "../../cpp_src/neighbors_to_metis_graph/neighbors_to_metis_graph.html">a C++ version</a> and
<a href = "../../f_src/neighbors_to_metis_graph/neighbors_to_metis_graph.html">a FORTRAN90 version</a> and
<a href = "../../m_src/neighbors_to_metis_graph/neighbors_to_metis_graph.html">a MATLAB version</a>.
</p>
<h3 align = "center">
Related Programs:
</h3>
<p>
<a href = "../../c_src/graphchk/graphchk.html">
GRAPHCHK</a>,
a C program, using the METIS library, which can check
that a METIS graph file has the proper format;
</p>
<p>
<a href = "../../c_src/kmetis/kmetis.html">
KMETIS</a>,
a C program which
uses the <a href = "metis/metis.html">METIS</a> library to partition
the nodes of a graph in a balanced way, useful for parallel
processing;
</p>
<p>
<a href = "../../c_src/metis/metis.html">
METIS</a>,
a C library which
partitions the nodes of a graph or the elements of a mesh, for division among
a number of parallel processes, or to reorder the variables in a sparse
matrix to minimize fillin;
</p>
<p>
<a href = "../../data/metis_graph/metis_graph.html">
METIS_GRAPH</a>,
a data directory of examples of METIS GRAPH files,
the format for graphs to be read by
<a href = "../../data/../../c_src/metis/metis.html">METIS</a>,
which can partition a graph;
</p>
<p>
<a href = "../../c_src/oemetis/oemetis.html">
OEMETIS</a>,
a C program which
uses the <a href = "metis/metis.html">METIS</a> library to reorder
the variables in a sparse matrix.
</p>
<p>
<a href = "../../c_src/onmetis/onmetis.html">
ONMETIS</a>,
a C program, using the
<a href = "metis/metis.html">METIS</a> library, which can reorder
the variables in a sparse matrix.
</p>
<p>
<a href = "../../c_src/pmetis/pmetis.html">
PMETIS</a>,
a C program which
uses the <a href = "../../c_src/metis/metis.html">METIS</a> library to partition
the nodes of a graph in a balanced way, useful for parallel processing;
</p>
<p>
<a href = "../../cpp_src/tet_mesh_tet_neighbors/tet_mesh_tet_neighbors.html">
TET_MESH_TET_NEIGHBORS</a>,
a C++ program which
reads information about a tet mesh and writes out a list of the
tetrahedrons that are adjacent to a given tetrahedron;
</p>
<p>
<a href = "../../cpp_src/triangulation_triangle_neighbors/triangulation_triangle_neighbors.html">
TRIANGULATION_TRIANGLE_NEIGHBORS</a>,
a C++ program which
reads data defining a triangulation, determines the neighboring
triangles of each triangle, and writes that information to a file.
</p>
<h3 align = "center">
Reference:
</h3>
<p>
<ol>
<li>
George Karypis, Vipin Kumar,<br>
METIS, a Software Package for Partitioning Unstructured Graphs
and Computing Fill-Reduced Orderings of Sparse Matrices;
</li>
</ol>
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "neighbors_to_metis_graph.cpp">neighbors_to_metis_graph.cpp</a>,
the source code.
</li>
<li>
<a href = "neighbors_to_metis_graph.sh">neighbors_to_metis_graph.sh</a>,
commands to compile the source code.
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<ul>
<li>
<a href = "cube_tetra.neighbors">cube_tetra.neighbors</a>,
a sample tet mesh neighbor file that can be used as input
to the program.
</li>
<li>
<a href = "cube_tetra.metis_graph">cube_tetra.metis_graph</a>,
the modified tet mesh neighbor file created by the program,
suitable for input to <b>METIS</b>.
</li>
</ul>
</p>
<h3 align = "center">
List of Routines:
</h3>
<p>
<ul>
<li>
<b>MAIN</b> is the main program for NEIGHBORS_TO_METIS_GRAPH.
</li>
<li>
<b>CH_CAP</b> capitalizes a single character.
</li>
<li>
<b>CH_EQI</b> is true if two characters are equal, disregarding case.
</li>
<li>
<b>CH_TO_DIGIT</b> returns the integer value of a base 10 digit.
</li>
<li>
<b>FILE_COLUMN_COUNT</b> counts the number of columns in the first line of a file.
</li>
<li>
<b>FILE_NAME_EXT_GET</b> determines the "extension" of a file name.
</li>
<li>
<b>FILE_NAME_EXT_SWAP</b> replaces the current "extension" of a file name.
</li>
<li>
<b>FILE_ROW_COUNT</b> counts the number of row records in a file.
</li>
<li>
<b>I4_MAX</b> returns the maximum of two I4's.
</li>
<li>
<b>I4_MIN</b> returns the minimum of two I4's.
</li>
<li>
<b>I4COL_COMPARE</b> compares columns I and J of an I4COL.
</li>
<li>
<b>I4COL_SORT_A</b> ascending sorts the columns of an I4COL.
</li>
<li>
<b>I4COL_SWAP</b> swaps two columns of an I4COL.
</li>
<li>
<b>I4I4I4_SORT_A</b> ascending sorts a triple of I4's.
</li>
<li>
<b>I4MAT_TRANSPOSE_PRINT</b> prints an I4MAT, transposed.
</li>
<li>
<b>I4MAT_TRANSPOSE_PRINT_SOME</b> prints some of an I4MAT, transposed.
</li>
<li>
<b>ITABLE_DATA_READ</b> reads data from an ITABLE file.
</li>
<li>
<b>ITABLE_HEADER_READ</b> reads the header from an ITABLE file.
</li>
<li>
<b>METIS_GRAPH_WRITE</b> writes the METIS graph file.
</li>
<li>
<b>S_INDEX_LAST_C</b> points to the last occurrence of a given character.
</li>
<li>
<b>S_LEN_TRIM</b> returns the length of a string to the last nonblank.
</li>
<li>
<b>S_TO_I4</b> reads an I4 from a string.
</li>
<li>
<b>S_TO_I4VEC</b> reads an I4VEC from a string.
</li>
<li>
<b>S_WORD_COUNT</b> counts the number of "words" in a string.
</li>
<li>
<b>SORT_HEAP_EXTERNAL</b> externally sorts a list of items into ascending order.
</li>
<li>
<b>TIMESTAMP</b> prints the current YMDHMS date as a time stamp.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../cpp_src.html">
the C++ source codes</a>.
</p>
<hr>
<i>
Last revised on 22 October 2008.
</i>
<!-- John Burkardt -->
</body>
<!-- Initial HTML skeleton created by HTMLINDEX. -->
</html>