diff --git a/ansys/mapdl/reader/mesh.py b/ansys/mapdl/reader/mesh.py index ea240d4d..a42cdf2a 100644 --- a/ansys/mapdl/reader/mesh.py +++ b/ansys/mapdl/reader/mesh.py @@ -184,11 +184,13 @@ def _parse_vtk(self, allowable_types=None, force_linear=False, grid = grid.extract_cells(grid.celltypes != 0) if force_linear: - grid = grid.linear_copy() + # only run if the grid has points or cells + if grid.n_points: + grid = grid.linear_copy() # map over element types # Add tracker for original node numbering - ind = np.arange(grid.number_of_points) + ind = np.arange(grid.n_points) grid.point_data['origid'] = ind grid.point_data['VTKorigID'] = ind return grid diff --git a/setup.py b/setup.py index 3aca574f..7cade675 100644 --- a/setup.py +++ b/setup.py @@ -60,8 +60,9 @@ def build_extensions(self): e.extra_compile_args.append('-stdlib=libc++') if platform.system() == 'Darwin': + # get the minor version mac_version, _, _ = platform.mac_ver() - major, minor, patch = [int(n) for n in mac_version.split('.')] + minor = [int(n) for n in mac_version.split('.')][1] # libstdc++ is deprecated in recent versions of XCode if minor >= 9: