dolfinx.plotting¶
Functions
|
Create a mesh consisting of all exterior facets of a mesh Input: mesh - The mesh comm - The MPI communicator orient - Boolean flag for reorientation of facets to have consistent outwards-pointing normal (default: True) Output: bmesh - The boundary mesh bmesh_to_geometry - Map from cells of the boundary mesh to the geometry of the original mesh |
|
|
|
|
|
|
|
|
|
|
|
|
|
Plot given object. |
-
dolfinx.plotting.
plot
(object, *args, **kwargs)[source]¶ Plot given object.
- Arguments
- object
a
Mesh
, aFunction
, aExpression
<dolfinx.Expression>, aDirichletBC
<dolfinx.cpp.DirichletBC>, aFiniteElement
.
- Examples of usage
In the simplest case, to plot only e.g. a mesh, simply use
mesh = UnitSquare(4, 4) plot(mesh)
Use the
title
argument to specify title of the plotplot(mesh, tite="Finite element mesh")
It is also possible to plot an element
element = FiniteElement("BDM", tetrahedron, 3) plot(element)
Vector valued functions can be visualized with an alternative mode
plot(u, mode = "glyphs")
A more advanced example
plot(u, wireframe = True, # use wireframe rendering interactive = False, # do not hold plot on screen scalarbar = False, # hide the color mapping bar hardcopy_prefix = "myplot", # default plotfile name scale = 2.0, # scale the warping/glyphs title = "Fancy plot", # set your own title )