How to use the meshio.vtk function in meshio

To help you get started, we’ve selected a few meshio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tianyikillua / paraview-meshio / meshioPlugin.py View on Github external
__author__ = "Tianyi Li"
__email__ = "tianyikillua@gmail.com"
__copyright__ = "Copyright (c) 2019 {} <{}>".format(__author__, __email__)
__license__ = "License :: OSI Approved :: MIT License"
__version__ = "0.3.3"
__status__ = "Development Status :: 4 - Beta"

paraview_plugin_version = __version__

if float(meshio.__version__[:3]) < 3.3:
    vtk_to_meshio_type = meshio._vtk.vtk_to_meshio_type
    meshio_to_vtk_type = meshio._vtk.meshio_to_vtk_type
    meshio_input_filetypes = meshio._helpers.input_filetypes
else:
    vtk_to_meshio_type = meshio.vtk._vtk.vtk_to_meshio_type
    meshio_to_vtk_type = meshio.vtk._vtk.meshio_to_vtk_type
    meshio_input_filetypes = list(meshio._helpers.reader_map.keys())
meshio_extensions = [ext[1:] for ext in meshio._helpers._extension_to_filetype.keys()]
meshio_input_filetypes = ["automatic"] + meshio_input_filetypes


@smproxy.reader(
    name="meshio Reader",
    extensions=meshio_extensions,
    file_description="meshio-supported files",
    support_reload=False,
)
class meshioReader(VTKPythonAlgorithmBase):
    def __init__(self):
        VTKPythonAlgorithmBase.__init__(
            self, nInputPorts=0, nOutputPorts=1, outputType="vtkUnstructuredGrid"
        )
github nschloe / meshio / tools / paraview-meshio-plugin.py View on Github external
import numpy as np
from paraview.util.vtkAlgorithm import (
    VTKPythonAlgorithmBase,
    smdomain,
    smhint,
    smproperty,
    smproxy,
)
from vtkmodules.numpy_interface import dataset_adapter as dsa
from vtkmodules.vtkCommonDataModel import vtkUnstructuredGrid

import meshio

paraview_plugin_version = meshio.__version__
vtk_to_meshio_type = meshio.vtk._vtk.vtk_to_meshio_type
meshio_to_vtk_type = meshio.vtk._vtk.meshio_to_vtk_type
meshio_input_filetypes = list(meshio._helpers.reader_map.keys())
meshio_extensions = [ext[1:] for ext in meshio.extension_to_filetype.keys()]
meshio_input_filetypes = ["automatic"] + meshio_input_filetypes


@smproxy.reader(
    name="meshio reader",
    extensions=meshio_extensions,
    file_description="meshio-supported files",
    support_reload=False,
)
class MeshioReader(VTKPythonAlgorithmBase):
    def __init__(self):
        VTKPythonAlgorithmBase.__init__(
            self, nInputPorts=0, nOutputPorts=1, outputType="vtkUnstructuredGrid"
        )