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

meshio in README demo doesn't work #75

Closed
vc12345679 opened this issue Jun 20, 2017 · 2 comments
Closed

meshio in README demo doesn't work #75

vc12345679 opened this issue Jun 20, 2017 · 2 comments

Comments

@vc12345679
Copy link
Contributor

Environment
Windows 10 :: Python 3.6.1 :: Anaconda 4.4.0 (64-bit)
pygmsh (3.1.0)
meshio (1.8.9)

Problem Desc

  • pg.generate_mesh(geom) works well
  • meshio.write('test.vtu', points, cells, cell_data=cell_data) returns with exit code 1

Debug Info

Traceback (most recent call last):
  File "D:/Documents/PycharmProjects/demo_pygmsh/demo_pygmsh.py", line 36, in <module>
    meshio.write('test.vtu', points, cells, cell_data=cell_data)
  File "D:\Documents\PycharmProjects\demo_pygmsh\meshio\helpers.py", line 187, in write
    field_data=field_data
  File "D:\Documents\PycharmProjects\demo_pygmsh\meshio\vtk_io.py", line 236, in write
    vtk_mesh = _generate_vtk_mesh(points, cells)
  File "D:\Documents\PycharmProjects\demo_pygmsh\meshio\vtk_io.py", line 335, in _generate_vtk_mesh
    vtk_array = numpy_support.numpy_to_vtk(points, deep=True)
  File "D:\Anaconda3\Lib\site-packages\vtk\util\numpy_support.py", line 131, in numpy_to_vtk
    assert z.flags.contiguous, 'Only contiguous arrays are supported.'
AssertionError: Only contiguous arrays are supported.

Process finished with exit code 1
@nschloe
Copy link
Owner

nschloe commented Jun 20, 2017

Ah yes. You'll have to make the array contiguous first, e.g., ascontiguousarray. Perhaps we should already do that as part of pygmsh.

@vc12345679
Copy link
Contributor Author

Ah yes. You'll have to make the array contiguous first, e.g., ascontiguousarray. Perhaps we should already do that as part of pygmsh.

THX! that helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants