pymor.discretizers.builtin.gui package¶
Subpackages¶
Submodules¶
gl module¶
This module provides a widget for displaying patch plots of
scalar data assigned to 2D-grids using OpenGL. This widget is not
intended to be used directly. Instead, use
visualize_patch
or
PatchVisualizer
.
-
class
pymor.discretizers.builtin.gui.gl.
ColorBarWidget
(parent, U=None, vmin=None, vmax=None)[source]¶ Bases:
QGLWidget
Methods
Attributes
staticMetaObject
customContextMenuRequested
,DrawChildren
,DrawWindowBackground
,IgnoreMask
,RenderFlag
,RenderFlags
,windowIconChanged
,windowIconTextChanged
,windowTitleChanged
destroyed
,objectNameChanged
PaintDeviceMetric
,painters
,PdmDepth
,PdmDevicePixelRatio
,PdmDevicePixelRatioScaled
,PdmDpiX
,PdmDpiY
,PdmHeight
,PdmHeightMM
,PdmNumColors
,PdmPhysicalDpiX
,PdmPhysicalDpiY
,PdmWidth
,PdmWidthMM
-
paintEvent
(self, arg__1: QPaintEvent)[source]¶
-
-
class
pymor.discretizers.builtin.gui.gl.
GLPatchWidget
(parent, grid, vmin=None, vmax=None, bounding_box=[0, 0], [1, 1], codim=2)[source]¶ Bases:
QGLWidget
Methods
Attributes
staticMetaObject
customContextMenuRequested
,DrawChildren
,DrawWindowBackground
,IgnoreMask
,RenderFlag
,RenderFlags
,windowIconChanged
,windowIconTextChanged
,windowTitleChanged
destroyed
,objectNameChanged
PaintDeviceMetric
,painters
,PdmDepth
,PdmDevicePixelRatio
,PdmDevicePixelRatioScaled
,PdmDpiX
,PdmDpiY
,PdmHeight
,PdmHeightMM
,PdmNumColors
,PdmPhysicalDpiX
,PdmPhysicalDpiY
,PdmWidth
,PdmWidthMM
-
pymor.discretizers.builtin.gui.gl.
compile_shader
(source, vertex=True)[source]¶ Compile a vertex shader from source.
-
pymor.discretizers.builtin.gui.gl.
link_shader_program
(shaders)[source]¶ Create a shader program with from compiled shaders.
matplotlib module¶
This module provides widgets for displaying plots of
scalar data assigned to one- and two-dimensional grids using
matplotlib
. These widgets are not intended to be used directly.
-
class
pymor.discretizers.builtin.gui.matplotlib.
Matplotlib1DAxes
(U, figure, grid, vmin=None, vmax=None, codim=1, separate_axes=False, sync_timer=None, columns=2)[source]¶ Bases:
pymor.discretizers.builtin.gui.matplotlib.MatplotlibAxesBase
Methods
-
class
pymor.discretizers.builtin.gui.matplotlib.
Matplotlib1DWidget
(U, parent, grid, count, vmin=None, vmax=None, legend=None, codim=1, separate_plots=False, dpi=100)[source]¶ Bases:
matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg
Methods
Attributes
staticMetaObject
FigureCanvasQT
buttond
,required_interactive_framework
customContextMenuRequested
,DrawChildren
,DrawWindowBackground
,IgnoreMask
,RenderFlag
,RenderFlags
,windowIconChanged
,windowIconTextChanged
,windowTitleChanged
destroyed
,objectNameChanged
PaintDeviceMetric
,painters
,PdmDepth
,PdmDevicePixelRatio
,PdmDevicePixelRatioScaled
,PdmDpiX
,PdmDpiY
,PdmHeight
,PdmHeightMM
,PdmNumColors
,PdmPhysicalDpiX
,PdmPhysicalDpiY
,PdmWidth
,PdmWidthMM
FigureCanvasBase
events
,figure
,filetypes
,fixed_dpi
,supports_blit
-
class
pymor.discretizers.builtin.gui.matplotlib.
MatplotlibAxesBase
(figure, sync_timer, grid, U=None, vmin=None, vmax=None, codim=2, separate_axes=False, columns=2)[source]¶ Bases:
object
Methods
-
class
pymor.discretizers.builtin.gui.matplotlib.
MatplotlibPatchAxes
(figure, grid, bounding_box=None, U=None, vmin=None, vmax=None, codim=2, columns=2, colorbar=True, sync_timer=None)[source]¶ Bases:
pymor.discretizers.builtin.gui.matplotlib.MatplotlibAxesBase
-
class
pymor.discretizers.builtin.gui.matplotlib.
MatplotlibPatchWidget
(parent, grid, bounding_box=None, vmin=None, vmax=None, codim=2, dpi=100)[source]¶ Bases:
matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg
Methods
Attributes
staticMetaObject
FigureCanvasQT
buttond
,required_interactive_framework
customContextMenuRequested
,DrawChildren
,DrawWindowBackground
,IgnoreMask
,RenderFlag
,RenderFlags
,windowIconChanged
,windowIconTextChanged
,windowTitleChanged
destroyed
,objectNameChanged
PaintDeviceMetric
,painters
,PdmDepth
,PdmDevicePixelRatio
,PdmDevicePixelRatioScaled
,PdmDpiX
,PdmDpiY
,PdmHeight
,PdmHeightMM
,PdmNumColors
,PdmPhysicalDpiX
,PdmPhysicalDpiY
,PdmWidth
,PdmWidthMM
FigureCanvasBase
events
,figure
,filetypes
,fixed_dpi
,supports_blit
qt module¶
This module provides a few methods and classes for visualizing data associated to grids. We use the Qt widget toolkit for the GUI.
-
class
pymor.discretizers.builtin.gui.qt.
PlotMainWindow
(U, plot, length=1, title=None)[source]¶ Bases:
QWidget
Base class for plot main windows.
Methods
Attributes
staticMetaObject
customContextMenuRequested
,DrawChildren
,DrawWindowBackground
,IgnoreMask
,RenderFlag
,RenderFlags
,windowIconChanged
,windowIconTextChanged
,windowTitleChanged
destroyed
,objectNameChanged
PaintDeviceMetric
,painters
,PdmDepth
,PdmDevicePixelRatio
,PdmDevicePixelRatioScaled
,PdmDpiX
,PdmDpiY
,PdmHeight
,PdmHeightMM
,PdmNumColors
,PdmPhysicalDpiX
,PdmPhysicalDpiY
,PdmWidth
,PdmWidthMM
-
pymor.discretizers.builtin.gui.qt.
_launch_qt_app
(main_window_factory, block)[source]¶ Wrapper to display plot in a separate process.
-
pymor.discretizers.builtin.gui.qt.
visualize_matplotlib_1d
(grid, U, codim=1, title=None, legend=None, separate_plots=False, block=False)[source]¶ Visualize scalar data associated to a one-dimensional
Grid
as a plot.The grid’s
ReferenceElement
must be the line. The data can either be attached to the subintervals or vertices of the grid.Parameters
- grid
The underlying
Grid
.- U
VectorArray
of the data to visualize. Iflen(U) > 1
, the data is visualized as a time series of plots. Alternatively, a tuple ofVectorArrays
can be provided, in which case several plots are made into the same axes. The lengths of all arrays have to agree.- codim
The codimension of the entities the data in
U
is attached to (either 0 or 1).- title
Title of the plot.
- legend
Description of the data that is plotted. Most useful if
U
is a tuple in which caselegend
has to be a tuple of strings of the same length.- separate_plots
If
True
, use subplots to visualize multipleVectorArrays
.- block
If
True
, block execution until the plot window is closed.
-
pymor.discretizers.builtin.gui.qt.
visualize_patch
(grid, U, bounding_box=[0, 0], [1, 1], codim=2, title=None, legend=None, separate_colorbars=False, rescale_colorbars=False, backend='gl', block=False, columns=2)[source]¶ Visualize scalar data associated to a two-dimensional
Grid
as a patch plot.The grid’s
ReferenceElement
must be the triangle or square. The data can either be attached to the faces or vertices of the grid.Parameters
- grid
The underlying
Grid
.- U
VectorArray
of the data to visualize. Iflen(U) > 1
, the data is visualized as a time series of plots. Alternatively, a tuple ofVectorArrays
can be provided, in which case a subplot is created for each entry of the tuple. The lengths of all arrays have to agree.- bounding_box
A bounding box in which the grid is contained.
- codim
The codimension of the entities the data in
U
is attached to (either 0 or 2).- title
Title of the plot.
- legend
Description of the data that is plotted. Most useful if
U
is a tuple in which caselegend
has to be a tuple of strings of the same length.- separate_colorbars
If
True
, use separate colorbars for each subplot.- rescale_colorbars
If
True
, rescale colorbars to data in each frame.- backend
Plot backend to use (‘gl’ or ‘matplotlib’).
- block
If
True
, block execution until the plot window is closed.- columns
The number of columns in the visualizer GUI in case multiple plots are displayed at the same time.
Defaults
backend (see
pymor.core.defaults
)
visualizers module¶
-
class
pymor.discretizers.builtin.gui.visualizers.
OnedVisualizer
(grid, codim=1, block=False, backend=None)[source]¶ Bases:
pymor.core.base.BasicObject
Visualize scalar data associated to a one-dimensional
Grid
as a plot.The grid’s
ReferenceElement
must be the line. The data can either be attached to the subintervals or vertices of the grid.Parameters
- grid
The underlying
Grid
.- codim
The codimension of the entities the data in
U
is attached to (either 0 or 1).- block
If
True
, block execution until the plot window is closed.
Attributes
-
visualize
(U, m, title=None, legend=None, separate_plots=True, separate_axes=False, block=None, filename=None, columns=2)[source]¶ Visualize the provided data.
Parameters
- U
VectorArray
of the data to visualize. Iflen(U) > 1
, the data is visualized as a time series of plots. Alternatively, a tuple ofVectorArrays
can be provided, in which case several plots are made into the same axes. The lengths of all arrays have to agree.- m
Filled in by
pymor.models.interface.Model.visualize
(ignored).- title
Title of the plot.
- legend
Description of the data that is plotted. Most useful if
U
is a tuple in which caselegend
has to be a tuple of strings of the same length.- block
If
True
, block execution until the plot window is closed. IfNone
, use the default provided during instantiation.
-
class
pymor.discretizers.builtin.gui.visualizers.
PatchVisualizer
(grid, bounding_box=[0, 0], [1, 1], codim=2, backend=None, block=False)[source]¶ Bases:
pymor.core.base.BasicObject
Visualize scalar data associated to a two-dimensional
Grid
as a patch plot.The grid’s
ReferenceElement
must be the triangle or square. The data can either be attached to the faces or vertices of the grid.Parameters
- grid
The underlying
Grid
.- bounding_box
A bounding box in which the grid is contained.
- codim
The codimension of the entities the data in
U
is attached to (either 0 or 2).- backend
Plot backend to use (‘gl’, ‘matplotlib’, ‘jupyter’).
- block
If
True
, block execution until the plot window is closed.
Attributes
-
visualize
(U, m, title=None, legend=None, separate_colorbars=False, rescale_colorbars=False, block=None, filename=None, columns=2)[source]¶ Visualize the provided data.
Parameters
- U
VectorArray
of the data to visualize. Iflen(U) > 1
, the data is visualized as a time series of plots. Alternatively, a tuple ofVectorArrays
can be provided, in which case a subplot is created for each entry of the tuple. The lengths of all arrays have to agree.- m
Filled in by
pymor.models.interface.Model.visualize
(ignored).- title
Title of the plot.
- legend
Description of the data that is plotted. Most useful if
U
is a tuple in which caselegend
has to be a tuple of strings of the same length.- separate_colorbars
If
True
, use separate colorbars for each subplot.- rescale_colorbars
If
True
, rescale colorbars to data in each frame.- block
If
True
, block execution until the plot window is closed. IfNone
, use the default provided during instantiation.- filename
If specified, write the data to a VTK-file using
write_vtk
instead of displaying it.- columns
The number of columns in the visualizer GUI in case multiple plots are displayed at the same time.