Skip to content

Export of tensor grids in python 3.14 #1692

Description

@zhangyh0713

Recently I'm using the porepy/extended container, where python 3.14 is installed. The exported geometry doesn't look right.

Image

Locating the reason with @Yuriyzabegaev , we found out that porepy/viz/exporter.py exports TensorGrid to polyhedron8 instead of hexahedron. The current implementation works in the old environment because polyhedron8 export was accidentally getting face vertices back in cyclic order from the sparse matrix; the new environment returns an index order which breaks vtkPolyhedron.

A quick fix to this problem is to change the line
elif n == 6 and isinstance(grid, pp.CartGrid):
to
elif n == 6 and isinstance(grid, pp.TensorGrid):
in porepy/viz/exporter.py, so TensorGrid can be exported as hexahedron rather than relying on sparse internal ordering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions