Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix empty grid edge case #85

Merged
merged 3 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ansys/mapdl/reader/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = mac_version.split('.')[1]
akaszynski marked this conversation as resolved.
Show resolved Hide resolved

# libstdc++ is deprecated in recent versions of XCode
if minor >= 9:
Expand Down