General polytopal meshes
Work with polygonal and polyhedral meshes in two and three dimensions rather than restricting discretizations to standard cells.
A polytopal DSL with a Rust interpreter
Express, prototype, and solve two- and three-dimensional polytopal methods in a syntax close to their mathematical formulation.
poly_rust is DOF-centered and designed
around the operator-based structure of modern polytopal methods.
Basic users describe a method in a .dsl file;
reusable Rust facilities handle interpretation, assembly,
solution, and post-processing.
Work with polygonal and polyhedral meshes in two and three dimensions rather than restricting discretizations to standard cells.
Define spaces, interpolants, reconstructions, forms, boundary conditions, problems, error functionals, and exports in one method description.
The vocabulary supports several families of polytopal methods and both atomic and Cartesian-product spaces.
Memory safety, parallel assembly, polynomial integration paths, dense local algebra, and sparse global solves.
Operator exactness tests, convergence scripts, error evaluation, and VTU export shorten the implement–check–refine loop.
Generic command-line solvers cover steady and unsteady, linear and nonlinear problems, with native and external sparse-solver backends.
Local reconstruction operators and assembled forms are written in a notation intentionally close to their mathematical definitions.
method hho_poisson {
// Data corresponding to u(x,y) = sin(pi x) sin(pi y)
function source(vector X) -> scalar =
2.0 * pow(3.141592653589793, 2.0)
* sin(3.141592653589793 * X[0]) * sin(3.141592653589793 * X[1])
function boundary_data(vector X) -> scalar = 0.0
space Uh {
element Poly(k, scalar)
edge Poly(k, scalar)
}
operator potential_reconstruction : Uh(u) -> Poly(k+1, scalar) on element T {
forall q in Poly(k+1, scalar):
int(T) grad(potential_reconstruction(u)) dot grad(q) =
- int(T) dof(u, T) * div(grad(q))
+ int(dT) dof(u, E) * (grad(q) dot normal)
constraint int(T) potential_reconstruction(u) = int(T) dof(u, T)
}
operator element_difference : Uh(u) -> Poly(k, scalar) on element T {
forall q in Poly(k, scalar):
int(T) element_difference(u) * q =
int(T) (potential_reconstruction(u) - dof(u, T)) * q
}
operator edge_difference : Uh(u) -> Poly(k, scalar) on edge E of element T {
forall q in Poly(k, scalar):
int(E) edge_difference(u) * q =
int(E) (potential_reconstruction(u) - dof(u, E) - element_difference(u)) * q
}
linear form load : Uh(test v) {
sum_elements(int(T) source * dof(v, T))
}
bilinear form poisson : Uh(trial u) times Uh(test v) {
sum_elements(
int(T) grad(potential_reconstruction(u)) dot grad(potential_reconstruction(v))
+ pow(diameter(T), -1.0) * int(dT) edge_difference(u) * edge_difference(v)
)
}
boundary conditions dirichlet_boundary_conditions on Uh {
on edge E:
dof(E) = l2_project(boundary_data, Poly(k, scalar))
}
linear problem hho_poisson_problem on Uh {
lhs { poisson }
rhs { load }
boundary conditions dirichlet_boundary_conditions
export { potential_reconstruction }
}
}
These are the numerical examples from the companion paper. The links below point to the exact DSL configuration files used for the corresponding computations in the manuscript.
For example, with poly_rust installed
through Homebrew on an Apple Silicon Mac, download
hho_poisson_mixed_boundary_conditions.dsl
to your Downloads folder and run:
dsl_solver_linear_problem \
--mesh /opt/homebrew/share/poly-rust/meshes/2d/unit-square-tria/unit-square-tria_1.vtk \
--dsl ~/Downloads/hho_poisson_mixed_boundary_conditions.dsl
This runs the HHO Poisson test with mixed boundary conditions used in the companion paper on the first unit-square mesh distributed with the Homebrew package.
The following files are the configurations distributed with the companion-paper sources and used for its numerical examples.
Binary packages are the simplest route for end users. A public source snapshot is provided for reproducibility; access to the development Git repository is restricted to developers.
Add the public tap and install the current bottle:
brew tap dpietro/tap https://plmlab.math.cnrs.fr/dpietro/homebrew-tap.git
brew install dpietro/tap/poly-rust
If Homebrew asks you to trust third-party taps, run
brew trust dpietro/tap and repeat the installation.
With the default Homebrew layout, DSL configuration files and
meshes are stored under
$(brew --prefix poly-rust)/share/poly-rust, in the
config/ and meshes/ subdirectories.
Verify the installation with:
brew test dpietro/tap/poly-rust
The packages contain the steady and unsteady linear/nonlinear DSL solvers, 2D and 3D example configurations and meshes, and the Emacs mode for the DSL. UMFPACK and PETSc support are included.
Download the package matching your distribution and architecture from the public package repository, then expand your distribution below for installation instructions.
↗ Linux package repositoryRun the command for your release from the download directory:
Debian 12, amd64:
sudo apt install ./poly-rust_0.16.7-1~debian12_amd64.deb
Debian 13.0, amd64:
sudo apt install ./poly-rust_0.16.7-1~debian13_amd64.deb
For an ARM system, use the corresponding
_arm64.deb package instead.
Run the command for your release from the download directory:
Ubuntu 24.04 LTS, amd64:
sudo apt install ./poly-rust_0.16.7-1~ubuntu24.04_amd64.deb
Ubuntu 26.04 LTS, amd64:
sudo apt install ./poly-rust_0.16.7-1~ubuntu26.04_amd64.deb
For an ARM system, use the corresponding
_arm64.deb package instead.
On a registered RHEL system, first enable CodeReady Builder and EPEL for the scientific-library dependencies:
sudo subscription-manager repos --enable \
"codeready-builder-for-rhel-$(rpm -E '%{rhel}')-$(uname -m)-rpms"
sudo dnf install \
"https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(rpm -E '%{rhel}').noarch.rpm"
Then install the package for your release from the directory containing the downloaded RPM. DNF resolves its dependencies.
RHEL 9, x86_64:
sudo dnf install ./poly-rust-0.16.7-1.el9.x86_64.rpm
RHEL 10, x86_64:
sudo dnf install ./poly-rust-0.16.7-1.el10.x86_64.rpm
For MPI runs, add the OpenMPI launcher to your shell’s PATH:
export PATH="$(rpm --eval '%{_libdir}')/openmpi/bin:$PATH"
With the default package layout, DSL configuration files are in
/usr/share/poly-rust/config and meshes are in
/usr/share/poly-rust/meshes.
The source snapshot for version 0.16.7 is the same public, dependency-vendored archive used by the Homebrew release. We recommand to include at least UMFPACK when compiling from source files.
↓ Download poly_rust 0.16.7 source snapshot
The development Git repository is intended for developers only
and requires appropriate access. Developers with access can clone
it and build with Cargo. The full external-solver configuration
enables both the umfpack and petsc
features.
git clone https://plmlab.math.cnrs.fr/dpietro/poly_rust.git
cd poly_rust
cargo build --release --features "umfpack petsc"
Developer Git: https://plmlab.math.cnrs.fr/dpietro/poly_rust (restricted access).
A lightweight desktop editor for .dsl method files,
with parser-backed validation and direct access to the installed
poly_rust solvers and convergence tools.
Version 0.10.1 includes parameter continuation for steady nonlinear
problems, alongside the standard single-solve workflow.
Syntax highlighting, automatic indentation, multiple files,
native open/save dialogs, an outline, symbol navigation, and
safe rename support, with highlighting and completion for
with scaling and geometric scaling functions.
The PolyRust parser reports inline diagnostics while you edit and supplies the declaration outline used for navigation.
Launch steady or unsteady linear and nonlinear solvers with existing meshes or Gmsh geometries. Select PETSc processes, run convergence studies, and inspect results and charts in each document’s own output panel.
New in 0.10.0: choose Single solve or Parameter continuation for steady nonlinear problems. Select a scalar parameter and an ordered list of values; each converged solution initializes the next solve.
Keep converged states in a separate folder for each run.
Resume from a saved .state file and list the
remaining values. The initial-guess setting applies to the
first value when starting a new sequence.
Follow continuation progress and inspect each step’s Newton iterations, residual, elapsed time, and status. Open saved output folders from the results table; completed steps remain available if a later solve fails or the run is stopped.
Parameter continuation requires Python 3 and the continuation helper supplied by poly_rust. The helper shipped in 0.16.5 supports continuation with VTU export disabled. Separate field exports for every step require an updated helper; the editor indicates when an update is needed.
Add the public tap and install the editor. Homebrew installs the compatible poly_rust formula as a dependency.
brew tap dpietro/tap https://plmlab.math.cnrs.fr/dpietro/homebrew-tap.git
brew install dpietro/tap/poly-rust-editor
poly-rust-editor
The editor requires poly_rust
0.14.0 or newer. If the tap is already configured, only the
brew install command is needed.
To update an existing editor installation:
brew update
brew upgrade dpietro/tap/poly-rust-editor
Download the library and editor packages for the same distribution release and architecture, place them in the same directory, and install them together. APT on Debian/Ubuntu or DNF on RHEL resolves the editor’s dependency on PolyRust 0.14.0 or newer.
Expand your distribution for the matching installation commands.
Debian 12, amd64:
sudo apt install \
./poly-rust_0.16.7-1~debian12_amd64.deb \
./poly-rust-dsl-editor_0.10.1-1~debian12_amd64.deb
Debian 13.0, amd64:
sudo apt install \
./poly-rust_0.16.7-1~debian13_amd64.deb \
./poly-rust-dsl-editor_0.10.1-1~debian13_amd64.deb
Ubuntu 24.04 LTS, amd64:
sudo apt install \
./poly-rust_0.16.7-1~ubuntu24.04_amd64.deb \
./poly-rust-dsl-editor_0.10.1-1~ubuntu24.04_amd64.deb
Ubuntu 26.04 LTS, amd64:
sudo apt install \
./poly-rust_0.16.7-1~ubuntu26.04_amd64.deb \
./poly-rust-dsl-editor_0.10.1-1~ubuntu26.04_amd64.deb
On a registered RHEL 10 system, first enable CodeReady Builder and EPEL for the PolyRust and editor dependencies:
sudo subscription-manager repos --enable \
"codeready-builder-for-rhel-10-$(uname -m)-rpms"
sudo dnf install \
"https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm"
On AlmaLinux 10, enable CRB and EPEL instead:
sudo dnf install dnf-plugins-core epel-release
sudo dnf config-manager --set-enabled crb
RHEL 10, x86_64:
sudo dnf install \
./poly-rust-0.16.5-1.el10.x86_64.rpm \
./poly-rust-dsl-editor-0.10.0-1.el10.x86_64.rpm
For parallel PETSc runs, specify the Open MPI launcher when starting the editor:
POLY_RUST_MPIEXEC="$(rpm --eval '%{_libdir}')/openmpi/bin/mpiexec" \
poly-rust-editor
The editor RPM targets RHEL 10. The RHEL 9 packages in the repository provide the PolyRust library only.
For an ARM system, use the corresponding
_arm64.deb or .aarch64.rpm files
instead. Launch the installed
application from the desktop menu or run
poly-rust-editor.
The 0.16 release series adds static condensation, direct use of Gmsh geometries, and geometry-dependent DOF scaling.
Eliminate selected element degrees of freedom locally, solve a smaller global system, and recover the complete solution for post-processing, exports, and residual checks.
Pass a Gmsh
.geo file directly to any solver with
--gmsh-geometry to generate and load a mesh in two
or three dimensions. Physical groups become region and boundary
labels for the DSL. Geometry generation requires the optional
gmsh executable.
Scale individual DOF blocks with a positive geometric function
using with scaling in a space declaration. Scaling
changes the algebraic coordinates while preserving reconstructed
physical fields, with consistent handling of interpolation,
boundary data, and static condensation.
The manuscript introduces the DSL, the generic solvers, convergence tools, and examples spanning several classes of polytopal methods.
Daniele A. Di Pietro · 2026
Additional material that is not part of the standard poly_rust installation is maintained in a public Git repository.
Clone the public repository over HTTPS:
git clone https://plmlab.math.cnrs.fr/dpietro/poly_rust-resources.git
cd poly_rust-resources
If you already use PLMLab over SSH, the equivalent clone command is
git clone git@plmlab.math.cnrs.fr:dpietro/poly_rust-resources.git.