Skip to content

Commit

Permalink
Docs: Switch to static plots for some 2d meshes
Browse files Browse the repository at this point in the history
  • Loading branch information
adtzlr committed Sep 23, 2024
1 parent 9ca89df commit 7744b8d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
1 change: 0 additions & 1 deletion docs/tutorial/examples/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ Finally, the result of the last completed substep is plotted.

.. pyvista-plot::
:context:
:force_static:

solid.plot("Principal Values of Cauchy Stress").show()

Expand Down
2 changes: 2 additions & 0 deletions src/felupe/mesh/_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class MeshContainer:
.. pyvista-plot::
:include-source: True
:force_static:
>>> import felupe as fem
>>>
Expand Down Expand Up @@ -171,6 +172,7 @@ def stack(self, idx=None):
.. pyvista-plot::
:include-source: True
:force_static:
>>> import felupe as fem
>>>
Expand Down
28 changes: 15 additions & 13 deletions src/felupe/mesh/_dual.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,21 @@ def dual(
Examples
--------
>>> import felupe as fem
>>>
>>> mesh = fem.Rectangle(n=5).add_midpoints_edges()
>>> region = fem.RegionQuadraticQuad(mesh=mesh)
>>>
>>> mesh_dual = fem.mesh.dual(mesh, points_per_cell=1, disconnect=False)
>>> region_dual = fem.RegionConstantQuad(
... mesh_dual, quadrature=region.quadrature, grad=False
... )
>>>
>>> displacement = fem.FieldPlaneStrain(region, dim=2)
>>> pressure = fem.Field(region_dual)
>>> field = fem.FieldContainer([displacement, pressure])
.. pyvista-plot::
>>> import felupe as fem
>>>
>>> mesh = fem.Rectangle(n=5).add_midpoints_edges()
>>> region = fem.RegionQuadraticQuad(mesh=mesh)
>>>
>>> mesh_dual = fem.mesh.dual(mesh, points_per_cell=1, disconnect=False)
>>> region_dual = fem.RegionConstantQuad(
... mesh_dual, quadrature=region.quadrature, grad=False
... )
>>>
>>> displacement = fem.FieldPlaneStrain(region, dim=2)
>>> pressure = fem.Field(region_dual)
>>> field = fem.FieldContainer([displacement, pressure])
See Also
--------
Expand Down
9 changes: 7 additions & 2 deletions src/felupe/mesh/_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ class Line(Mesh):
--------
.. pyvista-plot::
:include-source: True
:force_static:
>>> import felupe as fem
>>>
>>> mesh = fem.mesh.Line(a=-2.1, b=3.5, n=3)
>>> mesh.plot().show()
>>> mesh.plot(line_width=8).show()
>>> mesh
<felupe Mesh object>
Expand Down Expand Up @@ -125,6 +126,7 @@ class Rectangle(Mesh):
--------
.. pyvista-plot::
:include-source: True
:force_static:
>>> import felupe as fem
>>>
Expand Down Expand Up @@ -236,6 +238,7 @@ class Grid(Mesh):
--------
.. pyvista-plot::
:include-source: True
:force_static:
>>> import numpy as np
>>> import felupe as fem
Expand Down Expand Up @@ -299,6 +302,7 @@ class RectangleArbitraryOrderQuad(Rectangle):
Examples
--------
.. pyvista-plot::
:force_static:
>>> import felupe as fem
>>>
Expand Down Expand Up @@ -370,7 +374,7 @@ class Circle(Mesh):
Examples
--------
.. pyvista-plot::
:include-source: True
:force_static:
>>> import felupe as fem
>>>
Expand Down Expand Up @@ -475,6 +479,7 @@ class Triangle(Mesh):
--------
.. pyvista-plot::
:include-source: True
:force_static:
>>> import felupe as fem
>>>
Expand Down

0 comments on commit 7744b8d

Please sign in to comment.