graphlow.TensorMesh#
- class graphlow.TensorMesh(points: T, pvmesh: pv.UnstructuredGrid, backend: Backend[T], bcache: BackendCache[T], point_data: dict[str, T] = <factory>, cell_data: dict[str, T] = <factory>, _parent_point_map: ParentPointMap | None = None)#
Differentiable mesh container backed by a PyVista grid.
This class separates the mesh into:
Differentiable parts (geometry):
pointsandpoint_data/cell_dataas backend tensors.Non-differentiable parts (topology):
pvmeshand cached topology structures derived from it.
Notes
Topology is assumed to be fixed (connectivity does not change). Updating
pointsdoes not invalidate topology caches.pvmeshis used as the source of truth for connectivity.
Attributes
Number of cells. |
|
Number of points. |
|
Return the parent point index for each point of this derived mesh. |
|
Advanced API: Return the parent point map instance for this derived mesh. |
|
(n_points, 3) backend tensor; only differentiable part. |
|
PyVista UnstructuredGrid. |
|
Torch or phlower_tensor wrapper. |
|
Backend-dependent sparse/compiled cache. |
|
(n_points, ...) backend tensor; data associated with points. |
|
(n_cells, ...) backend tensor; data associated with cells. |
|
Topology layer (cached). |
|
Geometry layer (cached). |
Methods
|
Copy point and cell tensor data from pyvista mesh. |
|
Copy point and cell tensor data to pyvista mesh. |
|
Extract the boundary surface as a new 2D mesh. |
|
Gather parent point data onto this derived mesh. |
|
Set |
|
Save mesh data. |
|
Scatter this mesh's point data to the parent point space and add to it. |
|
Move the mesh data to a different device and/or dtype. |