API Reference¶
voids is organized into focused modules, each with a clearly scoped responsibility.
Module Overview¶
| Module | Description |
|---|---|
voids.core |
Network, SampleGeometry, and Provenance data structures |
voids.physics |
Petrophysics and single-phase flow solver |
voids.geom |
Geometry helpers and characteristic-size normalization |
voids.graph |
Graph algorithms: connectivity and metrics |
voids.linalg |
Linear-algebra assembly, solvers, and diagnostics |
voids.io |
HDF5, PoreSpy, OpenPNM, image-volume, and surface-mesh I/O |
voids.generators |
Synthetic and mesh-based network generators |
voids.examples |
Deterministic synthetic networks and images for testing/demos |
voids.image |
Image processing and connectivity helpers |
voids.fvm |
Finite-volume Darcy-flow solvers and map upscaling |
voids.fem |
Optional FEniCSx finite-element Darcy-Brinkman solvers |
voids.lbm |
Optional LBM direct-image Stokes-limit solvers |
voids.mesh |
Structured mesh export for porosity/permeability maps |
voids.visualization |
Plotly and PyVista network rendering |
voids.simulators |
Ready-to-run simulation entry points |
voids.benchmarks |
Verification and validation benchmark utilities |
Common Tasks¶
If you already know what you want to do, these are the main entry points:
| Task | Primary API |
|---|---|
| Create a minimal synthetic network | voids.examples.make_linear_chain_network |
| Create a structured mesh-like network | voids.examples.make_cartesian_mesh_network |
| Scale an imported network from voxel units | voids.io.porespy.scale_porespy_geometry |
| Infer Cartesian boundary labels | voids.io.porespy.ensure_cartesian_boundary_labels |
| Import a PoreSpy/OpenPNM-style dictionary | voids.io.porespy.from_porespy |
| Export to an OpenPNM-style dictionary or object | voids.io.openpnm.to_openpnm_dict, voids.io.openpnm.to_openpnm_network |
| Export or reload an image volume | voids.io.VolumeData, voids.io.save_volume_bundle, voids.io.load_volume_data |
| Export a porosity/permeability map mesh | voids.mesh.write_structured_map_meshes |
| Extract a PREGO-style network from a segmented image | voids.image.extract_prego_network_dict |
| Extract a native maximal-ball network from a segmented image | voids.image.extract_maximal_ball_network_dict |
| Upscale a permeability map with TPFA Darcy flow | voids.fvm.singlephase.upscale_permeability_tpfa |
| Upscale a porosity/permeability map with FEniCSx FEM | voids.fem.singlephase.upscale_permeability_fem |
| Solve direct-image Stokes-limit flow with XLB | voids.lbm.singlephase.solve_binary_volume_stokes |
| Compute porosity and connectivity diagnostics | voids.physics.petrophysics |
| Solve single-phase flow | voids.physics.singlephase.solve |
| Save and reload a canonical network | voids.io.hdf5.save_hdf5, voids.io.hdf5.load_hdf5 |
| Render a network interactively | voids.visualization.plotly, voids.visualization.pyvista |
| Cross-check a workflow against OpenPNM conventions | voids.benchmarks.crosscheck |
Public Top-Level Imports¶
The main voids package re-exports the three primary data structures:
The package version is available as:
For the data model and interpretation behind these APIs, see Concepts and Conventions and Theoretical Background.