Commit 11432e4
authored
fix(vtk): transpose vector before numpy_to_vtk (#2733)
add_vector() assigns a vector to each grid cell. The method takes an array of shape (3, nnodes) and passes it to numpy_support.numpy_to_vtk(), which due to the order of indices flattens it in column-major order, but VTK expects row-major order.
So where cell i should get
(x[i], y[i], z[i])
it instead gets
(x[3i], x[3i+1], x[3i+2])
Fixed by transposing the array passed to numpy_to_vtk() so it is (nnodes, 3) and is flattened/interpreted correctly1 parent 705b271 commit 11432e4
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
900 | | - | |
| 900 | + | |
901 | 901 | | |
902 | 902 | | |
903 | 903 | | |
| |||
0 commit comments