dune.xt.common.vtk package#

Submodules#

plot module#


class dune.xt.common.vtk.plot.VTKPlot(**kwargs)[source]#

Bases: k3d.plot.Plot


dune.xt.common.vtk.plot._transform_to_k3d(timestep, poly_data, color_attribute_name)[source]#

this function mirrors the prepartion in k3d.vtk_poly_data :param timestep: attribute from vtk collection file :param poly_data: vtk reader Output for one single vtk file :param color_attribute_name: Determines mesh colorization, 3-Tuple of Vtk Dataset name, min value, max value :return: 5-Tuple to match necessary updates to mesh when advancing the timestep


dune.xt.common.vtk.plot.plot(vtkfile_path, color_attribute_name, color_map=<matplotlib.colors.ListedColormap object>)[source]#

Generate a k3d Plot and associated controls for VTK data from file

Parameters
  • vtkfile_path – the path to load vtk data from. Can be a single .vtu or a collection

  • color_attribute_name – which data array from vtk to use for plot coloring

  • color_map – a Matplotlib Colormap object or a K3D array((step, r, g, b))

Returns

the generated Plot object

reader module#


dune.xt.common.vtk.reader._get_vtk_type(path)[source]#

We use the incremental event emitting parser here since we can expect to encounter appended binary data in the xml which lxml cannot parse. :param path: vtk file to peek into :return: None if no VTKFile element found, ellse the type attribute of the VTKFile element


dune.xt.common.vtk.reader.read_vtkfile(filename)[source]#