mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Creation of OpenFOAM-dev repository 15/04/2008
This commit is contained in:
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright 1997, Regents of the University of Minnesota
|
||||
*
|
||||
* graphchk.c
|
||||
*
|
||||
* This file checks the validity of a graph
|
||||
*
|
||||
* Started 8/28/94
|
||||
* George
|
||||
*
|
||||
* $Id: graphchk.c,v 1.2 2002/08/10 06:02:53 karypis Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#include <metisbin.h>
|
||||
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Let the game begin
|
||||
**************************************************************************/
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
GraphType graph;
|
||||
char filename[256];
|
||||
idxtype wgtflag;
|
||||
|
||||
if (argc != 2) {
|
||||
mprintf("Usage: %s <GraphFile>\n", argv[0]);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
strcpy(filename, argv[1]);
|
||||
|
||||
ReadGraph(&graph, filename, &wgtflag);
|
||||
if (graph.nvtxs == 0) {
|
||||
mprintf("Empty graph!\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
mprintf("**********************************************************************\n");
|
||||
mprintf("%s", METISTITLE);
|
||||
mprintf("Graph Information ---------------------------------------------------\n");
|
||||
mprintf(" Name: %s, #Vertices: %D, #Edges: %D\n\n", filename, graph.nvtxs, graph.nedges/2);
|
||||
mprintf("Checking Graph... ---------------------------------------------------\n");
|
||||
|
||||
if (CheckGraph(&graph))
|
||||
mprintf(" The format of the graph is correct!\n");
|
||||
else
|
||||
mprintf(" The format of the graph is incorrect!\n");
|
||||
|
||||
mprintf("\n**********************************************************************\n");
|
||||
|
||||
|
||||
gk_free((void **)&graph.xadj, &graph.adjncy, &graph.vwgt, &graph.adjwgt, LTERM);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user