There is a newer version of the record available.

Published January 8, 2019 | Version 0.3.8
Software Open

simpeg/discretize: Add vtki support to make using VTK data objects more Pythonic

  • 1. @seequent
  • 2. @simpeg, @geoscixyz, @ubcgif
  • 3. Colorado School of Mines - Geophysics - CGEM
  • 4. University of British Columbia
  • 5. @ColoradoSchoolOfMines
  • 6. University of British Columbia, Geophysical Inversion Facility
  • 7. Seequent
  • 8. QuantifiedCode

Description

  • from pr #130
  • commits from: @banesullivan
  • review from: @lheagy
Add vtki support to make using VTK data objects more Pythonic

Bane recently added a ton of new features to vtki (the VTK interface Python package) that help make using just about any VTK data objects more intuitive/Pythonic. If vtki is available in your Python environment then these changes make using VTK data objects way easier. Here's a screenshot of what this currently looks like in a Jupyter notebook (creates static renderings but can also be interactive in a separate pop-up window).

Also check out this notebook to see more ways to use PVGeo, discretize, and vtki. Below is a screenshot of a simple use case:

<img width="757" alt="screen shot 2018-12-28 at 2 27 21 pm" src="https://user-images.githubusercontent.com/22067021/50525947-ba6eff80-0aac-11e9-8b1d-dfbc770fe3c9.png">

Some sample code to do it yourself!

import discretize
import numpy as np

# Create a simple TensorMesh
h1 = np.linspace(.1, .5, 3)
h2 = np.linspace(.1, .5, 5)
h3 = np.linspace(.1, .5, 3)
mesh = discretize.TensorMesh([h1, h2, h3])

# Convert to VTK object and use vtki to render it
mesh.toVTK().plot(notebook=False)

Files

simpeg/discretize-0.3.8.zip

Files (1.9 MB)

Name Size Download all
md5:a65863cf284e3232d53589415eb5c4a9
1.9 MB Preview Download

Additional details

Related works