NEIGHBORS_TO_METIS_GRAPH
Reformat Tet Mesh Neighbor File
NEIGHBORS_TO_METIS_GRAPH is a FORTRAN90 program,
using double precision arithmetic,
which reads a file describing
the graph-theoretic adjacency structure of the tetrahedral
elements in a mesh ("tet mesh") and writes out a similar file
that is suitable for input to the mesh partitioning
program METIS.
Since we know we are dealing with a tet mesh, each "node" of
the adjacency graph has four 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
tetrahedral element that is a neighbor on that face of the
tetrahedron.
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!
Usage:
-
neighbors_to_metis_graph neighbor_file metis_graph_file
-
reads the data in neighbor_file, rearranges it to
suit METIS, and writes out the modified data to
metis_graph_file
Related Programs:
GRAPHCHK
is an executable C program which can read a METIS GRAPH
file and verify that it has the proper format.
KMETIS
is an executable C program, using METIS, which
can partition the nodes of a graph.
METIS
is a C library of routines for partitioning the nodes
of a graph or the elements of a mesh or reordering the variables
in a sparse matrix.
METIS_GRAPH
is a data directory contains an explanation
and some examples of the graph file format used by METIS.
OEMETIS
is an executable C program which
reads the adjacency graph of a sparse matrix,
stored in METIS GRAPH format,
and produces a reordering of the nodes to minimize fill.
ONMETIS
is an executable C program which
reads the adjacency graph of a sparse matrix,
stored in METIS GRAPH format,
and produces a reordering of the nodes to minimize fill.
PMETIS
is an executable C program, using METIS, which
can partition the nodes of a graph.
TET_MESH_NEIGHBORS
is an executable FORTRAN90 program which
reads information describing a tet mesh,
and writes out the corresponding tet mesh neighbor file.
Reference:
-
metis.pdf,
George Karypis, Vipin Kumar,
METIS, a Software Package for Partitioning Unstructured Graphs
and Computing Fill-Reduced Orderings of Sparse Matrices;
Source Code:
Examples and Tests:
List of Routines:
-
MAIN is the main program for NEIGHBORS_TO_METIS_GRAPH.
-
CH_CAP capitalizes a single character.
-
CH_EQI is a case insensitive comparison of two characters for equality.
-
CH_TO_DIGIT returns the integer value of a base 10 digit.
-
DTABLE_DATA_READ reads data from a double precision table file.
-
DTABLE_HEADER_READ reads the header from a double precision table file.
-
FILE_COLUMN_COUNT counts the number of columns in the first line of a file.
-
FILE_NAME_EXT_GET determines the "extension" of a file name.
-
FILE_NAME_EXT_SWAP replaces the current "extension" of a file name.
-
FILE_ROW_COUNT counts the number of row records in a file.
-
GET_UNIT returns a free FORTRAN unit number.
-
I4COL_COMPARE compares columns I and J of a integer array.
-
I4COL_SORT_A ascending sorts an integer array of columns.
-
I4COL_SWAP swaps columns J1 and J2 of a integer array of column data.
-
I4I4I4_SORT_A ascending sorts a triple of integers.
-
I4MAT_TRANSPOSE_PRINT prints an I4MAT, transposed.
-
I4MAT_TRANSPOSE_PRINT_SOME prints some of the transpose of an I4MAT.
-
ITABLE_DATA_READ reads data from an integer table file.
-
ITABLE_DATA_WRITE writes data to an integer table file.
-
ITABLE_HEADER_READ reads the header from an integer table file.
-
ITABLE_HEADER_WRITE writes the header to an integer table file.
-
METIS_GRAPH_WRITE writes the METIS graph file.
-
R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed.
-
R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.
-
S_BLANK_DELETE removes blanks from a string, left justifying the remainder.
-
S_INDEX_LAST_C finds the LAST occurrence of a given character.
-
S_TO_I4 reads an integer value from a string.
-
S_TO_I4VEC reads an I4VEC from a string.
-
S_TO_R8 reads an R8 from a string.
-
S_TO_R8VEC reads an R8VEC from a string.
-
S_WORD_COUNT counts the number of "words" in a string.
-
SORT_HEAP_EXTERNAL externally sorts a list of items into ascending order.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
-
TIMESTRING writes the current YMDHMS date into a string.
You can go up one level to
the FORTRAN90 source codes.
Last revised on 12 November 2006.