bempp.api.external.viewers

Define interfaces to external viewers.

Module Contents

Functions

visualize(obj[, mode, transformation])

Create a visualisation.

visualize_with_jupyter_notebook(obj[, mode, ...])

View a grid or grid function in an IPython Notebook.

visualize_with_gmsh(obj[, mode, transformation])

View a grid or grid function with Gmsh.

visualize_with_paraview(obj[, mode, transformation])

View a grid or grid function with Paraview.

enable_gmsh_viewer()

Change plotting default to Gmsh.

enable_paraview_viewer()

Change plotting default to Paraview.

enable_jupyter_viewer()

Change plotting default to IPython.

bempp.api.external.viewers.visualize(obj, mode=None, transformation=None)

Create a visualisation.

Attributes

objGrid or GridFunction object

A grid or grid function to plot

modestring

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.

transformationstring 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.

bempp.api.external.viewers.visualize_with_jupyter_notebook(obj, mode=None, transformation=None)

View a grid or grid function in an IPython Notebook.

bempp.api.external.viewers.visualize_with_gmsh(obj, mode=None, transformation=None)

View a grid or grid function with Gmsh.

Parameters

objbempp.api.Grid or bempp.api.GridFunction

Grid or grid function to visualize.

modestring

One of ‘element’ or ‘node’ (default ‘vertices’)

transformationcallable

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.

bempp.api.external.viewers.visualize_with_paraview(obj, mode=None, transformation=None)

View a grid or grid function with Paraview.

Parameters

objbempp.api.Grid or bempp.api.GridFunction

Grid or grid function to visualize.

modestring

One of ‘element’ or ‘node’ (default ‘vertices’)

transformationcallable

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.

bempp.api.external.viewers.enable_gmsh_viewer()

Change plotting default to Gmsh.

bempp.api.external.viewers.enable_paraview_viewer()

Change plotting default to Paraview.

bempp.api.external.viewers.enable_jupyter_viewer()

Change plotting default to IPython.