Skip to content

Commit

Permalink
Merge pull request #604 from richb2k/grid-gmsh-binary
Browse files Browse the repository at this point in the history
ElmerGrid and ElmerGUI, add check for Gmsh binary input file format a…
  • Loading branch information
raback authored Oct 31, 2024
2 parents 82c9bad + ed5dc25 commit 8de3b75
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
13 changes: 10 additions & 3 deletions ElmerGUI/Application/plugins/egconvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5280,17 +5280,24 @@ int LoadGmshInput(struct FemType *data,struct BoundaryType *bound,
}

if(strstr(line,"$")) {
int verno,minorno;
int verno,minorno,gmshformat;
char *cp;

Getrow(line,in,FALSE);
cp = line;
verno = next_int(&cp);
cp++;
minorno = next_int(&cp);

if(info) printf("Gmsh version is %d.%d\n",verno,minorno);


cp++;
gmshformat = next_int(&cp);
if(gmshformat == 1){
printf("Error: Gmsh input file is in binary format! Exiting.\n");
bigerror("Gmsh input file is in binary format!");
}

fclose(in);

if( verno == 4 ) {
Expand Down
13 changes: 10 additions & 3 deletions elmergrid/src/egconvert.c
Original file line number Diff line number Diff line change
Expand Up @@ -5280,17 +5280,24 @@ int LoadGmshInput(struct FemType *data,struct BoundaryType *bound,
}

if(strstr(line,"$")) {
int verno,minorno;
int verno,minorno,gmshformat;
char *cp;

Getrow(line,in,FALSE);
cp = line;
verno = next_int(&cp);
cp++;
minorno = next_int(&cp);

if(info) printf("Gmsh version is %d.%d\n",verno,minorno);


cp++;
gmshformat = next_int(&cp);
if(gmshformat == 1){
printf("Error: Gmsh input file is in binary format! Exiting.\n");
bigerror("Gmsh input file is in binary format!");
}

fclose(in);

if( verno == 4 ) {
Expand Down

0 comments on commit 8de3b75

Please sign in to comment.