pyfebiopt.visualization.plotter =============================== .. py:module:: pyfebiopt.visualization.plotter .. autoapi-nested-parse:: Helpers for translating FEBio meshes to PyVista geometries and fields. Classes ------- .. autoapisummary:: pyfebiopt.visualization.plotter.PVBridge Module Contents --------------- .. py:class:: PVBridge Build per-domain grids and attach pre-sliced results to PyVista. .. py:attribute:: mesh :type: pyfebiopt.mesh.mesh.Mesh .. py:method:: domain_grid(domain: str) -> Any Build the unstructured grid for the requested domain. :param domain: Domain/part name from the mesh. :returns: PyVista ``UnstructuredGrid`` for the domain. :rtype: Any .. rubric:: Example ``grid = PVBridge(mesh).domain_grid("artery")`` .. py:method:: surface_mesh(surface: str) -> Any Build the surface mesh for the requested surface. :param surface: Surface name from the mesh. :returns: PyVista ``PolyData`` for the surface. :rtype: Any .. py:method:: add_node_result_array(ds: pyvista.DataSet, *, view: pyfebiopt.xplt.views.NodeResultView, data: numpy.ndarray, name: str | None = None, set_active: bool = True) -> str Attach nodal results to the dataset with appropriate structure. :param ds: Target PyVista dataset. :param view: Source view that describes the nodal result. :param data: Nodal array (N or N x C). :param name: Optional field name override. :param set_active: Whether to set scalars/vectors/tensors active. :returns: Name of the attached field. :rtype: str .. rubric:: Example ``bridge.add_node_result_array(grid, view=U_view, data=U, name="U")`` .. py:method:: add_elem_item_array(ds: pyvista.UnstructuredGrid, *, view: pyfebiopt.xplt.views.ItemResultView, domain: str, data: numpy.ndarray, name: str | None = None, set_active: bool = True) -> str Attach the provided element array to the cell data. :param ds: Target unstructured grid. :param view: Item view describing the result. :param domain: Domain label (unused; kept for symmetry with callers). :param data: Element result array. :param name: Optional field name override. :param set_active: Whether to set the field active. :returns: Name of the attached field. :rtype: str .. py:method:: add_face_item_array(ds: pyvista.PolyData | pyvista.UnstructuredGrid, *, view: pyfebiopt.xplt.views.ItemResultView, surface: str, data: numpy.ndarray, name: str | None = None, set_active: bool = True) -> str Attach the provided face array to the surface or cell data. :param ds: Target polydata or unstructured grid. :param view: Item view describing the result. :param surface: Surface name (unused; for API symmetry). :param data: Face result array. :param name: Optional field name override. :param set_active: Whether to set the field active. :returns: Name of the attached field. :rtype: str .. py:method:: add_elem_mult_reduced_array(ds: pyvista.UnstructuredGrid, *, view: pyfebiopt.xplt.views.MultResultView, domain: str, data: numpy.ndarray, reducer: str = 'mean', name: str | None = None, set_active: bool = True) -> str Reduce node-wise element arrays to one value per cell then attach. :param ds: Target unstructured grid. :param view: Mult result view. :param domain: Domain label (unused; for API symmetry). :param data: Block array shaped (R, Kmax[, C]). :param reducer: Reduction method (mean, max, min, first). :param name: Optional field name override. :param set_active: Whether to set the field active. :returns: Name of the attached field. :rtype: str .. py:method:: region_series_array(*, data: numpy.ndarray) -> numpy.ndarray Normalize region time series data to float32 arrays. :param data: Array shaped (T, C...) to be flattened on the last axes. :returns: Array shaped (T, -1) in float32. :rtype: np.ndarray Usage: ``flattened = bridge.region_series_array(data=series_block)``