Contents Menu Expand Light mode Dark mode Auto light/dark mode
VTK documentation
Logo
VTK documentation

Contents

  • About
  • Getting Started
  • Learning
  • Supported Data Formats
  • Supported Hardware
  • Modules
    • VTK::DomainsMicroscopy
    • VTK::FiltersCellGrid
    • VTK::FiltersOpenTURNS
    • VTK::GUISupportQt
    • VTK::IOADIOS2
    • VTK::IOCellGrid
    • VTK::IOCesium3DTiles
    • VTK::IOFLUENTCFF
    • VTK::IOOCCT
    • VTK::IOXDMF2
    • VTK::RenderingCellGrid
    • VTK::RenderingOpenVR
    • VTK::RenderingOpenXR
    • VTK::RenderingOpenXRRemoting
    • VTK::RenderingVR
    • VTK::RenderingWebGPU
    • VTK::WrappingPythonCore
  • Building
    • Build Settings
  • API
    • C++
    • Python
      • vtkmodules
        • vtkmodules.gtk
          • vtkmodules.gtk.GtkGLExtVTKRenderWindow
          • vtkmodules.gtk.GtkVTKRenderWindowInteractor
          • vtkmodules.gtk.GtkVTKRenderWindow
          • vtkmodules.gtk.GtkGLExtVTKRenderWindowInteractor
        • vtkmodules.tk
          • vtkmodules.tk.vtkTkRenderWindowInteractor
          • vtkmodules.tk.vtkLoadPythonTkWidgets
          • vtkmodules.tk.vtkTkPhotoImage
          • vtkmodules.tk.vtkTkRenderWidget
          • vtkmodules.tk.vtkTkImageViewerWidget
        • vtkmodules.numpy_interface
          • vtkmodules.numpy_interface.algorithms
          • vtkmodules.numpy_interface.internal_algorithms
          • vtkmodules.numpy_interface.dataset_adapter
        • vtkmodules.qt
          • vtkmodules.qt.QVTKRenderWindowInteractor
        • vtkmodules.wx
          • vtkmodules.wx.wxVTKRenderWindow
          • vtkmodules.wx.wxVTKRenderWindowInteractor
        • vtkmodules.util
          • vtkmodules.util.vtkImageExportToArray
          • vtkmodules.util.colors
          • vtkmodules.util.vtkConstants
          • vtkmodules.util.vtkImageImportFromArray
          • vtkmodules.util.pickle_support
          • vtkmodules.util.keys
          • vtkmodules.util.vtkMethodParser
          • vtkmodules.util.misc
          • vtkmodules.util.vtkVariant
          • vtkmodules.util.numpy_support
          • vtkmodules.util.vtkAlgorithm
          • vtkmodules.util.execution_model
          • vtkmodules.util.data_model
        • vtkmodules.test
          • vtkmodules.test.rtImageTest
          • vtkmodules.test.BlackBox
          • vtkmodules.test.Testing
          • vtkmodules.test.ErrorObserver
        • vtkmodules.generate_pyi
    • CMake
      • Module System
      • vtkModule
      • vtkModuleTesting
      • vtkModuleWrapPython
      • vtkModuleWrapJava
      • vtkModuleJSON
      • vtkModuleGraphviz
  • Advanced Topics
    • Additional Python Wheels
    • SPDX & SBOM
    • Building Python Wheels
    • Building using emscripten for WebAssembly
    • Cross-compiling for Mobile devices
    • Building documentation
    • Marshalling Hints
    • Object manager
    • Auto serialization
    • Python Wrappers
    • Runtime settings
    • Wrapping Tools
    • Migration Guides
      • Module Migration from VTK 8.2 to 9+
  • Design Documents
    • VTK File Formats
    • Parallel Processing with VTK’s SMP Framework
    • vtkArrayDispatch and Related Tools
    • Data Assembly
    • VTK Legacy Reader/Writer Information Format
    • VTK XML Reader/Writer Information Format
    • Field Data as Time Meta-Data in VTK XML File Formats
    • MomentInvariants Architecture
  • Developer’s Guide
    • Develop
    • Regression Testing
    • Adding Tests
    • Dashboard Scripts
    • Updating Third Party Projects
    • Imported Third Party Projects
    • Deprecation Process
    • Release Process
    • Coding Conventions
    • About this documentation
  • Resources
  • Release Details
    • 9.4
    • 9.3
    • 9.2
    • 9.1
    • 9.0
    • 8.2
    • 8.1
    • 8.0
    • 7.1
    • 7.0
    • 6.3
    • 6.2
    • 6.1
    • 6.0
    • 5.10
    • 5.8
    • 5.6
    • 5.4
    • 5.2
    • 5.0
Back to top

Improvements related to vtk Polyhedral cell storage#

Storing faces as vtkCellArray#

When storing face information for polyhedral cells, vtkUnstructuredGrid uses a vtkIdTypeArray in a special format that looks awfully similar to how vtkCellArray used maintain its internal storage. The new internal storage simply changes it to using vtkCellArray instead. That will allow us to use a non-interleaved storage for faces. Together with using a vtkCellArray for FaceLocations the one-2-many relationship can be easily preserved without resorting to custom layout used by the Faces array.

So here’s the current storage structure:

  • Connectivity (vtkCellArray): simply stores point ids for all points for each polyhedral element

  • Faces (vtkCellArray): each element defines a polygonal face. The indices per element directly refer to point ids.

  • FaceLocations (vtkCellArray): each element identifies a polyhedral cell. The indices per element reference face defined in the ElementFace array.

Contrast this with how this information was previously stored:

  • Connectivity (vtkCellArray): simply stores point ids for all points for each polyhedral element (same as in the new proposal)

  • (Legacy)Faces (vtkIdTypeArray): an interlaved array of the form (numCellFaces, numFace0Pts, id1, id2, id3, numFace1Pts,id1, id2, id3, ...)

  • (Legacy)FaceLocations (vtkIdTypeArray): offset array into (Legacy)Faces array indicating where the faces for a corresponding cell are stored

Backward compatibility#

To ensure a nice transition to the new storage, some old API are kept. More precisely the method void SetCells(vtkUnsignedCharArray* cellTypes, vtkCellArray* cells, vtkIdTypeArray* faceLocations, vtkIdTypeArray* faces); from vtkUnstructuredGrid is deprecated but can still be used. In this case a copy of faceLocations and faces data will be done. Another case are the GetFaces and GetFaceLocations methods. They are still available but an internal cache with the old internal layout is used. It means that they should be considered as read only methods and not be relied on to change internal data of vtkUnstructuredGrid. The caching process may impact a bit performance.

The FaceConn and FaceLocs internal arrays of vtkUnstructuredGridCellIterator are no longer available as vtkIdTypeArray. This may break your subclasses if you rely on them directly and not on the exposed API of vtkUnstructuredGridCellIterator. A solution to keep using them in subclasses is to define them directly in subclasses and handle their logic.

Compatibility with Conduit#

The new layout is much closer to how Conduit store its polyhedral cell information. Thus, some gain should be expected on the long run.

Copyright © 2023, VTK Developers
Made with Sphinx and @pradyunsg's Furo
On this page
  • Improvements related to vtk Polyhedral cell storage
    • Storing faces as vtkCellArray
    • Backward compatibility
    • Compatibility with Conduit