API Reference#
Top-level package for dolfin_pyvista_adapter.
- dolfin_pyvista_adapter.create_vtk_structures(Vh: FunctionSpace) Tuple[ndarray[Any, dtype[int32]], ndarray[Any, dtype[int32]], ndarray[Any, dtype[float64]]] [source]#
Given a (discontinuous) Lagrange space, create pyvista compatible structures based on the dof coordinates
- Parameters:
Vh – the function space
- Returns:
Mesh topology, cell types and mesh geometry arrays
- dolfin_pyvista_adapter.plot(uh: Function, filename: Optional[Path] = None, show_edges: bool = True, glyph_factor: float = 1, off_screen: bool = True, cmap: Union[str, List[str]] = 'viridis')[source]#
Plot a (discontinuous) Lagrange function with Pyvista
- Parameters:
uh – The function
filename – If set, writes the plot to file instead of displaying it interactively
show_edges – Show mesh edges if
True
glyph_factor – Scaling of glyphs if input function is a function from a
dolfin.VectorFunctionSpace
.off_screen – If
True
generate plots with virtual frame buffer usingxvfb
.cmap – The colormap to use. If a string uses matplotlib colormaps, if a list uses strings as colors.