File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1313 - uses : actions/checkout@v3
1414
1515 - name : Install dependencies
16- run : python3 -m pip install pyvista
16+ run : python3 -m pip install --break-system-packages pyvista
1717
1818 - name : Run unit tests
1919 run : python3 -m pytest test/
Original file line number Diff line number Diff line change 1515@functools .singledispatch
1616def _to_pyvista_grid (mesh : dolfinx .mesh .Mesh , tdim : int ,
1717 entities = None ):
18+ mesh .topology .create_connectivity (0 , tdim )
19+ mesh .topology .create_connectivity (tdim , mesh .topology .dim )
1820 return pyvista .UnstructuredGrid (* dolfinx .plot .vtk_mesh (
1921 mesh , tdim , entities ))
2022
@@ -110,7 +112,7 @@ def create_plottable_ufl_expression(
110112
111113
112114def plot_function (u : dolfinx .fem .function .Function ,
113- plotter : pyvista .Plotter = None ):
115+ plotter : pyvista .Plotter = None , ** pv_args ):
114116 if plotter is None :
115117 plotter = pyvista .Plotter ()
116118
@@ -122,7 +124,8 @@ def plot_function(u: dolfinx.fem.function.Function,
122124 # No data on process
123125 return plotter
124126
125- plotter .add_mesh (grid , scalars = u .name , show_scalar_bar = True )
127+ pv_args .setdefault ("show_scalar_bar" , True )
128+ plotter .add_mesh (grid , scalars = u .name , ** pv_args )
126129
127130 if mesh .geometry .dim == 2 :
128131 plotter .enable_parallel_projection ()
You can’t perform that action at this time.
0 commit comments