Skip to content

feat: trilinear interpolation on PropertyGrid - #369

Merged
lachlangrose merged 1 commit into
refactor/property-grid-geometryfrom
feature/property-grid-trilinear
Nov 1, 2026
Merged

lachlangrose merged 1 commit into
refactor/property-grid-geometryfrom
feature/property-grid-trilinear

Conversation

@lachlangrose

Copy link
Copy Markdown
Member

Draft, stacked. Built on #368 (and so #363, #364, #366, #367). Its diff against master includes those commits until they merge; the change here is the last commit, feat: trilinear interpolation on PropertyGrid, via StructuredGrid3DGeometry.

Trilinear interpolation of node values on PropertyGrid, so a property can be transferred onto another support: grid.evaluate_value("f", other_support.nodes).

Change

The pure-geometry pieces of the interpolation support move into StructuredGrid3DGeometry, so the support and PropertyGrid share them (moved verbatim): trilinear, position_to_local_coordinates, position_to_dof_coefs, position_to_cell_corners / _vertices, node_indexes_to_position, element_size / element_scale, evaluate_value.

evaluate_value now also accepts (n_nodes, k) data (the 1-D path is unchanged). PropertyGrid.evaluate_value(name, points) interpolates the node property name; NaN outside the grid. Points are in the grid's own frame (no rotation).

Tests

  • The structured-support reference test from refactor: BaseStructuredSupport extends StructuredGrid3DGeometry #367 is unchanged and passes, so the support's behaviour did not move.
  • 21 new tests in test_property_grid.py: a linear field is reproduced exactly at random points; node values are returned at the nodes; midpoint equals the mean of the corner values; NaN outside; multi-component data; agreement with the support's own evaluate_value; transfer onto a 3x finer support. Swapping two trilinear corner weights fails 12 of the 51 tests in that file.
  • packages/loop_common/tests: 234 passed; packages/loop_interpolation/tests: 606 passed; tests: 737 passed. ruff clean on changed files.

Not included: gradients on PropertyGrid; interpolation of cell properties (they are piecewise constant: use cell_value_at).

🤖 Generated with Claude Code

@lachlangrose
lachlangrose force-pushed the feature/property-grid-trilinear branch from 7e8cfc7 to 54d2df3 Compare November 1, 2026 05:51
@lachlangrose
lachlangrose changed the base branch from master to refactor/property-grid-geometry November 1, 2026 05:51
@lachlangrose
lachlangrose added this pull request to stack #385 November 1, 2026 05:52
@lachlangrose
lachlangrose force-pushed the feature/property-grid-trilinear branch from 54d2df3 to 1f1ed73 Compare November 1, 2026 06:08
@lachlangrose
lachlangrose marked this pull request as ready for review November 1, 2026 06:13
…ometry

Move the pure-geometry pieces of the interpolation support into StructuredGrid3DGeometry so
the support and PropertyGrid share them: trilinear weights, position_to_local_coordinates,
position_to_dof_coefs, position_to_cell_corners / _vertices, node_indexes_to_position,
element_size / element_scale and evaluate_value (now also accepting (n_nodes, k) data).

PropertyGrid.evaluate_value(name, points) interpolates a node property at arbitrary points
(NaN outside), which is what is needed to transfer a property onto another support.

The structured-support reference test is unchanged and passes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@lachlangrose
lachlangrose force-pushed the feature/property-grid-trilinear branch from 1f1ed73 to 47158eb Compare November 1, 2026 06:54
@lachlangrose
lachlangrose merged commit 8eb8b66 into master Nov 1, 2026
37 checks passed
@lachlangrose
lachlangrose deleted the feature/property-grid-trilinear branch November 1, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant