Skip to main content

Crate mesh_sieve

Crate mesh_sieve 

Source
Expand description

§mesh-sieve

mesh-sieve is a modular, high-performance Rust library for mesh and data management, designed for scientific computing and PDE codes. It provides abstractions for mesh topology, field data, parallel partitioning, and communication, supporting both serial and MPI-based distributed workflows.

§Features

  • Mesh topology and Sieve data structures for flexible mesh connectivity
  • Atlas and Section types for mapping mesh points to data arrays
  • Pluggable communication backends (serial, Rayon, MPI) for ghost exchange and mesh distribution
  • Built-in support for graph partitioning (Metis, custom algorithms)
  • MPI integration for distributed mesh and data exchange
  • Extensive serial, parallel, and property-based testing

§Determinism

All randomized decisions use SmallRng seeds drawn from configuration so runs are reproducible. Unit tests fix seeds explicitly to ensure deterministic behavior.

§Usage

Add mesh-sieve as a dependency in your Cargo.toml and enable features as needed:

[dependencies]
mesh-sieve = "1.2.1"
# Optional features:
# features = ["mpi-support","rayon","metis-support"]

For a complete API reference and usage guide, see API_Guide.md.

§Migration highlights

See docs/MIGRATING.md for more details on recent API changes:

  • Fallible map access via try_restrict_* helpers and the [FallibleMap] trait.
  • [Bundle::assemble] now averages element-wise; use [Bundle::assemble_with] with a SliceReducer for custom behavior.
  • data::refine::delta::SliceDelta replaces the deprecated Delta alias.

§Shared payloads

When payloads are large or shared across many arrows, instantiate a sieve with Payload = Arc<T>. Traversal and algorithms will clone the Arc handle (cheap) without copying T. Use type aliases topology::sieve::InMemorySieveArc, topology::sieve::InMemoryOrientedSieveArc, and topology::sieve::InMemoryStackArc for convenience. Avoid wrappers that convert between T and Arc<T> on the fly; they add allocations and defeat sharing. Public prelude for mesh-sieve: mesh/data-management library for PDE codes

All Sieve implementations provide points(), base_points(), and cap_points() iterators for global point set access.

Re-exports§

pub use debug_invariants::DebugInvariants;

Modules§

adapt
Quality-driven adaptivity with data transfer helpers.
algs
Algorithm module: re-exports public algorithms for mesh and partitioning operations.
data
Data module: section and atlas
debug_invariants
discretization
Runtime discretization helpers for basis/quadrature evaluation and assembly.
forest
Quad/oct-tree AMR forest representation with Sieve mappings.
geometry
Geometry utilities for mesh-sieve.
io
Mesh I/O helpers for sieve topology and sections.
mesh_error
MeshSieveError: Unified error type for mesh-sieve public APIs
mesh_generation
Structured mesh generators with boundary labeling and periodic equivalence.
mesh_graph
Mesh graph exports for adjacency (cell/vertex) in CSR or edge-list form.
overlap
Overlap module: provides types and utilities for managing overlap and delta information in distributed mesh partitioning.
physics
Physics helpers built on mesh-sieve data structures.
prelude
A convenient prelude to import the most-used traits & types:
section
Minimal PetscSection-like interface to describe DOF layout on points.
topology
Top-level module for mesh topology abstractions.

Macros§

data_debug_assert_okDeprecated
debug_invariants
Helper macro to run a fallible check and panic on error when invariant checking is enabled.
ovl_debug_validate
Validate overlap invariants in debug builds or when strict-invariants (alias check-invariants) is enabled. In strict mode this also ensures the in/out adjacency mirrors remain in sync.