Add VTK plotting for unstructured meshes - #5689
Open
aabills wants to merge 3 commits into
Open
Conversation
This was referenced Jul 31, 2026
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## ufv-2-spatial #5689 +/- ##
================================================
Coverage ? 96.95%
================================================
Files ? 342
Lines ? 34252
Branches ? 0
================================================
Hits ? 33209
Misses ? 1043
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3 tasks
Add VTKQuickPlot, QuickPlot/dynamic_plot hooks, the vtk optional extra, and headless OSMesa CI setup for GIF export. Extracted from the unstructured finite-volume stack. Co-authored-by: Cursor <cursoragent@cursor.com>
Every panel was built from the FIRST spatial variable's mesh, so a 3-domain variable (e.g. electrolyte concentration) plotted alongside a 5-domain one was painted onto the larger grid: all values shifted by the leading domains' cell count, rendering electrolyte data on current-collector tabs. Build each panel's grid from that variable's own mesh, and make _set_cell/point_scalars raise on a length mismatch so this bug class errors instead of drawing a wrong picture. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The regular visualisation grid, mid-plane slices, quiver sampling and slice-plane positions used to live on the unstructured processed variables; the spatial-method PR now ships them as pure point interpolators. Add pybamm.plotting.unstructured_plot_grid with plot_grid, default_slice_positions, midplane_slices and quiver_data, and have QuickPlot own the grid and slice positions per plotted variable (the slice sliders update QuickPlot state). Meshes expose `vertices`, not `nodes`; fix plot_vtk and its test stand-ins. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
aabills
force-pushed
the
ufv-3-plotting
branch
from
September 3, 2026 19:31
e70d618 to
c6ca5bf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VTKQuickPlot, QuickPlot/dynamic_plot hooks, optionalvtkextra, and headless OSMesa CI (Linux + Windows).Stack
Test plan
tests/unit/test_plotting/test_plot_vtk.py(18 passed locally)Also in this stack: #5691 deprecates
pybamm.Magnitude.