diff --git a/utils/converters/matlab/load_gmsh2.m b/utils/converters/matlab/load_gmsh2.m index 5dba29f48dcb69624568ad7dd53801c92a2bf461..b7a98cf08d0e51f91b4763e51c151a68ff2c5919 100644 --- a/utils/converters/matlab/load_gmsh2.m +++ b/utils/converters/matlab/load_gmsh2.m @@ -124,11 +124,7 @@ elseif (strcmp(tline, '$MeshFormat')) disp (sprintf('Syntax error (no $EndMeshFormat) in: %s', filename)); fileformat = 0; end - tline = fgetl(fid); % this should be $Nodes - if (feof(fid)) - disp (sprintf('Syntax error (no $Nodes) in: %s', filename)); - fileformat = 0; - end + tline = fgetl(fid); % this should be $Nodes or $PhysicalNames end if (~fileformat) @@ -136,6 +132,16 @@ if (~fileformat) return end +%% Read (and ignore) physical names + +if strcmp(tline, '$PhysicalNames') + np = fscanf(fid, '%d', 1); + tline = fgetl(fid); + for I = 1:np+2 + tline = fgetl(fid); + end +end + %% Read nodes if strcmp(tline, '$NOD') || strcmp(tline, '$Nodes')