meshpro / optimesh

:spider_web: Mesh optimization, mesh smoothing.
575 stars 56 forks source link

numpy.sum(numpy.column_stack([is0, is1, is2]), axis=1) == 1 AssertionError #28

Closed nschloe closed 5 years ago

nschloe commented 5 years ago

The attached mesh generates the following weird error message with run with

optimesh c.msh out.vtk --method cvt-uniform-qnf -n 100
Traceback (most recent call last):
  File "/home/nschloe/.local/bin/optimesh", line 11, in <module>
[symmetry.vtk.zip](https://github.com/nschloe/optimesh/files/3012743/symmetry.vtk.zip)
    sys.exit(main())
  File "/home/nschloe/rcs/optimesh/optimesh/cli/main.py", line 169, in main
    step_filename_format=args.step_filename_format,
  File "/home/nschloe/rcs/optimesh/optimesh/cvt/full_hessian.py", line 31, in quasi_newton_uniform_full
    get_stats_mesh=lambda mesh: ghosted_mesh.get_unghosted_mesh(),
  File "/home/nschloe/rcs/optimesh/optimesh/helpers.py", line 91, in runner
    update_topology(mesh)
  File "/home/nschloe/rcs/optimesh/optimesh/cvt/full_hessian.py", line 30, in <lambda>
    update_topology=lambda mesh: ghosted_mesh.update_topology(),
  File "/home/nschloe/rcs/optimesh/optimesh/cvt/ghosted_mesh.py", line 152, in update_topology
    self.flip_until_delaunay()
  File "/home/nschloe/rcs/meshplex/meshplex/mesh_tri.py", line 898, in flip_until_delaunay
    self.flip_interior_edges(is_flip_interior_edge)
  File "/home/nschloe/rcs/meshplex/meshplex/mesh_tri.py", line 1029, in flip_interior_edges
    self._update_cell_values(update_cell_ids, update_interior_edge_ids)
  File "/home/nschloe/rcs/meshplex/meshplex/mesh_tri.py", line 1089, in _update_cell_values
    numpy.sum(numpy.column_stack([is0, is1, is2]), axis=1) == 1
AssertionError

Fix this, or at least provide a better error message.

symmetry.vtk.zip

nschloe commented 5 years ago

This is now handled much more gracefully.