FELiCS.Misc.plottingUtils#

Module Contents#

Functions#

plot_modal_spectrum(eigval[, eigval_adjoint, ax, ...])

Plot direct and optional adjoint eigenvalues.

plot_resolvent_spectrum(omega, gains[, ax, xlim, ylim])

Plot resolvent gain curves.

plot_scalar_function(dolfinx_mesh, function[, title, ...])

Plot a scalar finite-element function on a two-dimensional mesh.

Attributes#

FELiCS.Misc.plottingUtils.logger#
FELiCS.Misc.plottingUtils.plot_modal_spectrum(eigval, eigval_adjoint=None, ax=None, xlim=None, ylim=None)#

Plot direct and optional adjoint eigenvalues.

Parameters:
  • eigval (numpy.ndarray) – Complex direct eigenvalues.

  • eigval_adjoint (numpy.ndarray, optional) – Complex adjoint eigenvalues.

  • ax (matplotlib.axes.Axes, optional) – Axes to draw on. A new figure is created when None.

  • xlim (tuple, optional) – Limits for the x-axis.

  • ylim (tuple, optional) – Limits for the y-axis.

Return type:

matplotlib.axes.Axes

FELiCS.Misc.plottingUtils.plot_resolvent_spectrum(omega, gains, ax=None, xlim=None, ylim=None)#

Plot resolvent gain curves.

Parameters:
  • omega (numpy.ndarray) – Frequencies at which gains are computed.

  • gains (numpy.ndarray) – Gains corresponding to each frequency. Should be a 2D array where each column represents a different mode.

  • ax (matplotlib.axes.Axes, optional) – Axes to draw on. A new figure is created when None.

  • xlim (tuple, optional) – Limits for the x-axis.

  • ylim (tuple, optional) – Limits for the y-axis.

Return type:

matplotlib.axes.Axes

FELiCS.Misc.plottingUtils.plot_scalar_function(dolfinx_mesh, function, title='scalar_field', xlim=None, ylim=None, plotType='real', clim=None, axes=None, showBoundaries=True, free_aspect_ratio=False)#

Plot a scalar finite-element function on a two-dimensional mesh.

This is a debug-level visualisation utility, not intended for publication-quality figures.

Parameters:
  • dolfinx_mesh (dolfinx.mesh.Mesh)

  • function (dolfinx.fem.Function) – Scalar function to plot.

  • title (str) – Base title used for the colorbar label.

  • xlim (tuple, optional)

  • ylim (tuple, optional)

  • plotType ({'real', 'imag', 'magnitude', 'angle'})

  • clim (tuple, optional)

  • axes (matplotlib.axes.Axes, optional)

  • showBoundaries (bool)

  • free_aspect_ratio (bool)

Return type:

matplotlib.axes.Axes