Repository navigation
VTK field algorithms write every node of VTK's higher-order cells - #343
Open
berkgeveci wants to merge 1 commit into
Open
berkgeveci wants to merge 1 commit into
berkgeveci wants to merge 1 commit into
Conversation
The algorithms that add fields wrote Tack's values straight into VTK's point data. On VTK's higher-order cells that put an order-2 field's values in Tack's node order, not VTK's (Elevation scrambled, its Gradients wrong), and values on Tack's points, the corners, where VTK's points include the edge middles (a 1193-point grid got an array of 1193 tuples of 1227 components). The import now records which node of its space each VTK point is, and the writers put a point field into that space (project) and give each VTK point its node's value. Found running VTK's quadraticQuadDeriv.py on Tack.
This was referenced Nov 5, 2026
This branch has not been deployed
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.
Found by running VTK's own Python tests with Tack's algorithms in place of VTK's filters (
quadraticQuadDeriv.py).The bug: the VTK algorithms that add fields --
Elevation,Gradients,Projectand the rest, andRunningStatistics,TimeDerivative-- write their fields onto a shallow copy of the input. They wrote Tack's values straight into VTK's point data, which holds only on linear cells. On VTK's higher-order cells (quadratic, biquadratic, Lagrange):Elevationcame out scrambled, andGradientsof it gave (-35.7, 102.6, 0) where (10, 0, 0) is right;The fix: the higher-order import records which node of its
H1space each VTK point is (_lagrange.VTK_NODES, on the topology). Before a point field goes onto the VTK points, the writers put it into that space (project: exact for anH1field of that order or below and for values on the corners) and give each VTK point its node's value. A copy of the dataset on another device finds the record through the dataset kept for the VTK one. An integer field on the points is refused there: it has no value at an edge's middle.Tested on hand-made quad8 cells with a curved edge and a tet10: the elevation of each node's own position at all VTK points and its gradient constant; another device; the integer field refused;
RunningStatisticson quad8 cells. On VTK'sDisc_QuadraticQuads,Disc_BiQuadraticQuadsandquadraticTetra01the elevation is exact at every node and the gradient within 5e-6 (VTK's test asks 1e-4). VTK tests 345 passed on the 9.7.1 wheel, 361 on a local VTK master; MPI tests; quick tier 3059 passed.🤖 Generated with Claude Code