Generalise VectorField to N components - #5686
Open
aabills wants to merge 3 commits into
Open
Conversation
Support 3D vector fields via N-component VectorField, Component/Norm operators, and matching discretisation/solution handling. Extracted from the unstructured finite-volume work for review in isolation. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 31, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5686 +/- ##
==========================================
+ Coverage 98.12% 98.14% +0.01%
==========================================
Files 339 339
Lines 31996 32063 +67
==========================================
+ Hits 31396 31468 +72
+ Misses 600 595 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3 tasks
Add unit tests for the uncovered patch lines: Component/Norm discretisation (success and error paths), _unary_new_copy and the component/norm convenience functions, _disc_state_vector propagation through binary/unary operators, and the per-component casadi handling for VectorField variables in Solution. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
VectorFieldfrom fixed 2D(lr, tb)to N components (needed for 3D unstructured FV).Component/Normoperators and matching discretisation + solution handling.Stack
Full pre-split branch preserved as
backup/unstructured-finite-volume-fulland original #5397 (unstructured-finite-volume).Test plan
test_finite_volume_2d/test_tensor_field.py(includes new VectorField N-comp cases)Also in this stack: #5691 deprecates
pybamm.Magnitude.