Commit 71ce949
authored
PhysicsNeMo-Mesh: Adds new capability of Polyhedra triangulation in PyVista/VTU I/O (#1469)
* Refactor from_pyvista to use celltypes for face and volume cell counting
- Updated the handling of UnstructuredGrid meshes to utilize the celltypes array instead of cells_dict, improving compatibility with variable-length polyhedra.
- Adjusted error messages and test cases to reflect the new attribute usage.
- Renamed tessellation references to triangulation for clarity in the context of mesh conversion.
* format
* Add changelog.
* line break
* Update from_pyvista function to enforce UnstructuredGrid type check for 3D meshes, improving error handling and clarity in mesh validation.
* Add methods for graph extraction in Mesh class
- Implemented `to_edge_graph`, `to_dual_graph`, and `to_point_cloud` methods to facilitate the extraction of edge graphs, dual graphs, and point clouds from the Mesh class.
- Each method includes detailed docstrings with examples for better usability.
- Added comprehensive unit tests to validate the functionality of the new methods, ensuring correct edge and dual graph generation from various mesh configurations.
* Enhance from_pyvista function to improve cell data handling and native dimension detection
- Updated the logic for passing cell data to ensure compatibility with varying manifold dimensions and native mesh dimensions.
- Improved the detection of native dimensions by adding checks for line types, enhancing the robustness of the function.
- Clarified comments to better explain the conditions under which cell data can be passed through.
* formatting
* Ruff fixes
* Add force_copy parameter to from_pyvista function for memory management
- Introduced a new `force_copy` parameter to control whether point and cell arrays are copied, allowing the returned Mesh to own its memory independently of the source PyVista mesh.
- Updated documentation to clarify the implications of this parameter on memory sharing and data mutation.
- Enhanced the logic for determining manifold dimensions and improved error handling for ambiguous mesh types.
* format
* Update dependencies in pyproject.toml and enhance vtk import in io_pyvista.py
- Updated matplotlib to version 3.10.8 and pyvista to version 0.47.0 in the mesh-extras section of pyproject.toml.
- Added vtk version requirement to the _build_dual_graph_edges function in io_pyvista.py, improving module import handling with importlib for better compatibility.
* Add detailed docstrings for graph extraction tests
- Enhanced test classes for edge graph, dual graph, and point cloud extraction with comprehensive docstrings explaining their functionality and verification processes.
- Improved clarity on the expected behavior and data handling in the tests for better maintainability and understanding.
* Updates uv.lock after TOML update
* Refactor Mesh initialization to also work when deserializing point clouds from memmaps.
* formatting
* Refactor Mesh initialization to handle non-dict Mappings for point, cell, and global data. This change ensures compatibility with PyVista DataSetAttributes by converting them to plain dictionaries before assignment.1 parent dc2acf5 commit 71ce949
File tree
10 files changed
+2116
-517
lines changed- physicsnemo/mesh
- io
- test/mesh
- io/io_pyvista
- mesh
10 files changed
+2116
-517
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | 228 | | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
239 | 272 | | |
240 | | - | |
241 | | - | |
| 273 | + | |
| 274 | + | |
242 | 275 | | |
243 | 276 | | |
244 | 277 | | |
245 | | - | |
246 | 278 | | |
247 | | - | |
248 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
249 | 282 | | |
250 | | - | |
251 | | - | |
| 283 | + | |
| 284 | + | |
252 | 285 | | |
253 | 286 | | |
254 | 287 | | |
255 | | - | |
256 | 288 | | |
257 | | - | |
258 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
259 | 292 | | |
260 | | - | |
261 | | - | |
| 293 | + | |
| 294 | + | |
262 | 295 | | |
263 | 296 | | |
264 | 297 | | |
265 | | - | |
266 | 298 | | |
267 | | - | |
268 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
269 | 302 | | |
270 | 303 | | |
271 | 304 | | |
| |||
277 | 310 | | |
278 | 311 | | |
279 | 312 | | |
280 | | - | |
281 | 313 | | |
282 | 314 | | |
283 | 315 | | |
| |||
1506 | 1538 | | |
1507 | 1539 | | |
1508 | 1540 | | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
1509 | 1661 | | |
1510 | 1662 | | |
1511 | 1663 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
| 128 | + | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
135 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
0 commit comments