open_viewmin.filter_tree_plot.filters.topology ============================================== .. py:module:: open_viewmin.filter_tree_plot.filters.topology .. autoapi-nested-parse:: Define topological calculations for ViewMinPlot meshes Functions --------- .. autoapisummary:: open_viewmin.filter_tree_plot.filters.topology.add_Euler_characteristic_filter open_viewmin.filter_tree_plot.filters.topology.add_connected_sets open_viewmin.filter_tree_plot.filters.topology.add_find_loops_filter open_viewmin.filter_tree_plot.filters.topology.calculate_Euler_characteristic open_viewmin.filter_tree_plot.filters.topology.get_connected_sets open_viewmin.filter_tree_plot.filters.topology.get_connected_subsets open_viewmin.filter_tree_plot.filters.topology.merge_all Module Contents --------------- .. py:function:: add_Euler_characteristic_filter(plotter, mesh_name, new_mesh_name=None, keep_chi=None, **mesh_kwargs) Add a filter formula that colors a mesh by Euler characteristic of each connected subset. :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot.filter_tree_plot.FilterTreePlot` :param mesh_name: Name of parent mesh. :type mesh_name: str :param new_mesh_name: Name of new (child) mesh. Pass `None` to default to `"_chi"` appended to `parent_mesh_name`. :type new_mesh_name: str or `None`, optional :param keep_chi: Resulting mesh includes only those connected subsets whose Euler characteristic matches this value(s). Pass `None` to keep all chi values. :type keep_chi: int, list of ints, or `None` :param \*\*mesh_kwargs: :type \*\*mesh_kwargs: dict, optional :returns: New child mesh created by filter formula, or `None` if no filter formula was created. :rtype: pyvista.dataset or `None` .. py:function:: add_connected_sets(plotter, parent_mesh_name, pbc=False) Add a filter formula that colors a mesh according to its connected subsets. :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot.filter_tree_plot.FilterTreePlot` :param parent_mesh_name: Name of parent mesh. :type parent_mesh_name: str :param pbc: Whether to use periodic boundary conditions. :type pbc: bool, optional :returns: New child mesh :rtype: pyvista.dataset .. py:function:: add_find_loops_filter(plotter, mesh_name, new_mesh_name=None, **mesh_kwargs) Add a filter formula that keeps only loops :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot.filter_tree_plot.FilterTreePlot` :param mesh_name: Name of parent mesh :type mesh_name: str :param new_mesh_name: Name of new (child) mesh. Pass `None` to default to `"_loops"` appended to `parent_mesh_name`. :type new_mesh_name: str or `None`, optional :param mesh_kwargs: Keyword arguments to `pyvista.Plotter.add_mesh`. :type mesh_kwargs: dict, optional :rtype: :class:`~open_viewmin.filter_tree_plot.filter_formulas.FilterFormula` .. py:function:: calculate_Euler_characteristic(plotter, mesh, keep_chi=None) Calculate Euler characteristic Calculate Euler characteristic for each connected subset in a mesh, using the formula :math:`V - E + F`. Add a new scalar dataset named "chi" to the mesh. :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot.filter_tree_plot.FilterTreePlot` :param mesh: Parent mesh. :type mesh: pyvista.dataset :param keep_chi: Resulting mesh includes only those connected subsets whose Euler characteristic matches this value(s). Pass `None` to keep all chi values. :type keep_chi: int, list of ints, or `None` :returns: New child mesh. :rtype: pyvista.dataset .. py:function:: get_connected_sets(plotter, mesh, pbc=False) Find connected subsets of a mesh. Apply PyVista's `connectivity` filter and store the resulting subset identification index as a new dataset called "connected". :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot.filter_tree_plot.FilterTreePlot` :param mesh: Parent mesh. :type mesh: pyvista.dataset :param pbc: Whether to apply periodic boundary conditions. :type pbc: bool, optional .. py:function:: get_connected_subsets(plotter, mesh, pbc=False) Create a list of connected subset meshes. Uses `threshold` filter on the result of the `connectivity` filter to extract an individual connected subset of a mesh. :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot.filter_tree_plot.FilterTreePlot` :param mesh: Parent mesh. :type mesh: pyvista.dataset :param pbc: Whether to use periodic boundary conditions. :type pbc: bool, optional :rtype: list[`pyvista.dataset`]. .. py:function:: merge_all(list_of_meshes) Merge several meshes. :param list_of_meshes: :type list_of_meshes: Iterable of [pyvista.dataset] :returns: Merged mesh. :rtype: pyvista.dataset