:py:mod:`bempp.api.external.viewers` ==================================== .. py:module:: bempp.api.external.viewers .. autoapi-nested-parse:: Define interfaces to external viewers. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: bempp.api.external.viewers.visualize bempp.api.external.viewers.visualize_with_jupyter_notebook bempp.api.external.viewers.visualize_with_gmsh bempp.api.external.viewers.visualize_with_paraview bempp.api.external.viewers.enable_gmsh_viewer bempp.api.external.viewers.enable_paraview_viewer bempp.api.external.viewers.enable_jupyter_viewer .. py:function:: visualize(obj, mode=None, transformation=None) Create a visualisation. Attributes ---------- obj : Grid or GridFunction object A grid or grid function to plot mode : string One of 'element' or 'node'. If 'element' is chosen the color is determined by the mid-point of the faces of the grid. For 'node' the vertex values are chosen. Only used for grid functions. transformation : string or object One of 'real', 'imag', 'abs', 'log_abs' or 'abs_squared' or a callable object. Describes the data transformation before plotting. For functions with vector values only 'abs', 'log_abs' or 'abs_squared' are allowed. If a callable object is given this is applied instead. It is important that the callable returns numpy arrays with the same number of dimensions as before. .. py:function:: visualize_with_jupyter_notebook(obj, mode=None, transformation=None) View a grid or grid function in an IPython Notebook. .. py:function:: visualize_with_gmsh(obj, mode=None, transformation=None) View a grid or grid function with Gmsh. Parameters ---------- obj : bempp.api.Grid or bempp.api.GridFunction Grid or grid function to visualize. mode : string One of 'element' or 'node' (default 'vertices') transformation : callable A function object that is applied to the data before writing it out Notes ----- This function writes the data into a temp file and visualizes it. .. py:function:: visualize_with_paraview(obj, mode=None, transformation=None) View a grid or grid function with Paraview. Parameters ---------- obj : bempp.api.Grid or bempp.api.GridFunction Grid or grid function to visualize. mode : string One of 'element' or 'node' (default 'vertices') transformation : callable A function object that is applied to the data before writing it out Notes ----- This function writes the data into a temp file and visualizes it. .. py:function:: enable_gmsh_viewer() Change plotting default to Gmsh. .. py:function:: enable_paraview_viewer() Change plotting default to Paraview. .. py:function:: enable_jupyter_viewer() Change plotting default to IPython.