sfepy.postprocess.plot_cmesh module

Functions to visualize the CMesh geometry and topology.

sfepy.postprocess.plot_cmesh.label_global_entities(ax, cmesh, edim, color='b', fontsize=10, **kwargs)[source]

Label mesh topology entities using global ids.

sfepy.postprocess.plot_cmesh.label_local_entities(ax, cmesh, edim, color='b', fontsize=10, **kwargs)[source]

Label mesh topology entities using cell-local ids.

sfepy.postprocess.plot_cmesh.plot_cmesh(ax, cmesh, wireframe_opts=None, entities_opts=None)[source]

Convenience function for plotting all entities of a finite element mesh.

Pass plot() arguments to wireframe_opts dict.

Pass ‘color’, ‘label_global’, ‘label_global’ for text() color and font sizes arguments and ‘size’ for scatter() to each dict for topological entities in entities_opts list.

Examples

>>> # 2D mesh.
>>> plot_cmesh(None, cmesh,
               wireframe_opts = {'color' : 'k', 'linewidth' : 2},
               entities_opts=[
      {'color' : 'k', 'label_local' : 8, 'size' : 20},
      {'color' : 'b', 'label_global' : 12, 'label_local' : 8, 'size' : 10},
      {'color' : 'r', 'label_global' : 12, 'size' : 20},
      ])
sfepy.postprocess.plot_cmesh.plot_entities(ax, cmesh, edim, color='b', size=10, **kwargs)[source]

Plot mesh topology entities using scatter plot.

sfepy.postprocess.plot_cmesh.plot_wireframe(ax, cmesh, color='k', **kwargs)[source]

Plot a finite element mesh as a wireframe using edges connectivity.