Skip to content
Snippets Groups Projects
Commit 030aa909 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

renamed mshdensify to mshsort and modified the spec file to install it
in the rpm
parent 2cc6c1d4
No related branches found
No related tags found
No related merge requests found
# $Id: Makefile,v 1.372 2004-10-04 05:08:14 geuzaine Exp $ # $Id: Makefile,v 1.373 2004-10-08 04:36:20 geuzaine Exp $
# #
# Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle # Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
# #
...@@ -64,8 +64,10 @@ variables: configure ...@@ -64,8 +64,10 @@ variables: configure
parser: parser:
cd Parser && ${MAKE} parser cd Parser && ${MAKE} parser
converters: .PHONY: utils
utils:
cd utils/converters/autocad && ${MAKE} cd utils/converters/autocad && ${MAKE}
cd utils/misc && ${MAKE}
.PHONY: doc .PHONY: doc
doc: doc:
......
\input texinfo.tex @c -*-texinfo-*- \input texinfo.tex @c -*-texinfo-*-
@c $Id: gmsh.texi,v 1.134 2004-10-04 04:40:59 geuzaine Exp $ @c $Id: gmsh.texi,v 1.135 2004-10-08 04:36:21 geuzaine Exp $
@c @c
@c Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle @c Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
@c @c
...@@ -2690,6 +2690,14 @@ All non-parsed file formats have sections enclosed between @code{$KEY} and ...@@ -2690,6 +2690,14 @@ All non-parsed file formats have sections enclosed between @code{$KEY} and
@cindex File format, mesh @cindex File format, mesh
@cindex @file{.msh} file @cindex @file{.msh} file
Please note that the list of nodes and elements in Gmsh's mesh files do not
have to be dense or ordered (i.e., the node and element numbers do not have
to be given in a consecutive or even an ordered way). A sample C++ program
to transform the formats so that all lists are dense and ordered is
available in the source distribution (@file{utils/misc/mshsort.cpp}). This
program is also a good example on how to read and write files in the
@file{.msh} format.
@menu @menu
* Version 1.0:: * Version 1.0::
* Version 2.0:: * Version 2.0::
......
...@@ -32,7 +32,7 @@ and/or post-processor. ...@@ -32,7 +32,7 @@ and/or post-processor.
%build %build
make distrib-unix make distrib-unix
make converters make utils
make doc-info make doc-info
strip bin/gmsh strip bin/gmsh
rm -rf CVS */CVS */*/CVS rm -rf CVS */CVS */*/CVS
...@@ -45,6 +45,7 @@ mkdir -p $RPM_BUILD_ROOT/usr/share/info ...@@ -45,6 +45,7 @@ mkdir -p $RPM_BUILD_ROOT/usr/share/info
install -m 755 bin/gmsh $RPM_BUILD_ROOT/usr/bin/gmsh install -m 755 bin/gmsh $RPM_BUILD_ROOT/usr/bin/gmsh
install -m 755 bin/dxf2geo $RPM_BUILD_ROOT/usr/bin/dxf2geo install -m 755 bin/dxf2geo $RPM_BUILD_ROOT/usr/bin/dxf2geo
install -m 755 bin/mshsort $RPM_BUILD_ROOT/usr/bin/mshsort
install -m 644 doc/gmsh.1 $RPM_BUILD_ROOT/usr/share/man/man1/gmsh.1 install -m 644 doc/gmsh.1 $RPM_BUILD_ROOT/usr/share/man/man1/gmsh.1
install -m 644 doc/texinfo/gmsh.info* $RPM_BUILD_ROOT/usr/share/info/ install -m 644 doc/texinfo/gmsh.info* $RPM_BUILD_ROOT/usr/share/info/
...@@ -59,5 +60,6 @@ rm -rf $RPM_BUILD_ROOT ...@@ -59,5 +60,6 @@ rm -rf $RPM_BUILD_ROOT
%doc doc/LICENSE doc/VERSIONS doc/FAQ doc/CREDITS demos tutorial %doc doc/LICENSE doc/VERSIONS doc/FAQ doc/CREDITS demos tutorial
/usr/bin/gmsh /usr/bin/gmsh
/usr/bin/dxf2geo /usr/bin/dxf2geo
/usr/bin/mshsort
/usr/share/man/man1/gmsh* /usr/share/man/man1/gmsh*
/usr/share/info/gmsh* /usr/share/info/gmsh*
// $Id: mshdensify.cpp,v 1.1 2004-10-08 02:41:56 geuzaine Exp $ // $Id: mshsort.cpp,v 1.1 2004-10-08 04:36:21 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -135,10 +135,8 @@ double readMesh(char *fileName, map<int, node*> &nodes, vector<element*> &elemen ...@@ -135,10 +135,8 @@ double readMesh(char *fileName, map<int, node*> &nodes, vector<element*> &elemen
fprintf(stderr, "Error: node %d already exists\n", num); fprintf(stderr, "Error: node %d already exists\n", num);
exit(1); exit(1);
} }
else{ else
node *n = new node(x, y, z); nodes[num] = new node(x, y, z);
nodes[num] = n;
}
} }
} }
else if(!strncmp(&str[1], "ELM", 3) || else if(!strncmp(&str[1], "ELM", 3) ||
...@@ -184,9 +182,8 @@ double readMesh(char *fileName, map<int, node*> &nodes, vector<element*> &elemen ...@@ -184,9 +182,8 @@ double readMesh(char *fileName, map<int, node*> &nodes, vector<element*> &elemen
for(int j = 0; j < numNodes; j++){ for(int j = 0; j < numNodes; j++){
int numNode; int numNode;
fscanf(fp, "%d", &numNode); fscanf(fp, "%d", &numNode);
if(nodes.count(numNode)){ if(nodes.count(numNode))
e->addNode(nodes[numNode]); e->addNode(nodes[numNode]);
}
else{ else{
fprintf(stderr, "Error: Unknown vertex %d in element %d\n", numNode, num); fprintf(stderr, "Error: Unknown vertex %d in element %d\n", numNode, num);
exit(1); exit(1);
...@@ -256,7 +253,8 @@ void printMesh(double version, map<int, node*> nodes, vector<element*> elements) ...@@ -256,7 +253,8 @@ void printMesh(double version, map<int, node*> nodes, vector<element*> elements)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
if(argc != 2){ if(argc != 2){
fprintf(stderr, "Usage: %s file\n", argv[0]); fprintf(stderr, "mshsort, a utility to reorder the node and element lists in Gmsh MSH files\n");
fprintf(stderr, "Usage: %s file.msh\n", argv[0]);
exit(1); exit(1);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment