Skip to content

Repository files navigation

underworld3

Latest releaseLicense: LGPL-3.0PythonDocumentation

Welcome to Underworld3, a mathematically self-describing, finite-element code for geodynamic modelling. This quick-start guide has basic installation instructions and a brief introduction to some of the concepts in the Underworld3 code.

All Underworld3 source code is released under the LGPL-3 open source licence. This covers all files in underworld3 constituting the Underworld3 Python module. Notebooks, stand-alone documentation and Python scripts which show how the code is used and run are licensed under the Creative Commons Attribution 4.0 International License.

Status

main branch

test_uw3

development branch

test_uw3

Documentation

The full documentation including tutorials, API reference, and developer guides is available at:

Binder demonstration version

Try Underworld3 in your browser — no installation required:

  • Launch v0.99 on Binderv0.99 — JOSS publication release (stable)
  • Launch v3.0.0 on Binderv3.0.0 — previous release
  • Launch v3.1.0 on Binderv3.1.0 — current release
  • Launch development on Binderdevelopment — bleeding edge

Use scripts/binder_wizard.py to generate launch URLs for your own repositories using the Underworld3 environment.

Installation Guide

The quickest option is not to install anything but try the binder demos above!

Quick Install (recommended)

git clone https://github.com/underworldcode/underworld3
cd underworld3
./uw setup

The ./uw wrapper handles everything:

  • Installs pixi if needed
  • Guides you through environment selection
  • Installs dependencies and builds underworld3

Environment Options

Underworld3 uses pixi to manage dependencies. The setup wizard will ask you two questions to determine which environment to install:

1. Do you need adaptive mesh refinement (AMR)?

Most users should answer No. This installs PETSc from conda-forge, which takes about 5 minutes.

Answer Yes only if you need anisotropic mesh adaptation tools (pragmatic, mmg, parmmg). This builds a custom PETSc from source with these tools enabled, which takes approximately one hour.

2. What features do you need?

  • Runtime (recommended): Includes PyVista for 3D visualization and JupyterLab for running tutorial notebooks. This is what most users want.

  • Minimal: Only the core dependencies needed to build and run underworld3. Use this for production runs on HPC systems or when you have your own visualization workflow.

  • Developer: Adds code quality tools (black, mypy), documentation tools, and Claude Code support. Use this if you plan to contribute to underworld3 development.

Summary of environments:

EnvironmentPETSc SourceFeaturesUse Case
runtimeconda-forgeviz, jupyterRunning tutorials and examples
defaultconda-forgeminimalHPC production runs
devconda-forgeviz, jupyter, dev toolsContributing to underworld3
amr-runtimecustom buildviz, jupyter, AMRAdaptive mesh research
amrcustom buildminimal, AMRAMR on HPC
amr-devcustom buildall featuresAMR development

Getting Started

After installation, open the tutorial index in JupyterLab:

./uw jupyter lab docs/beginner/tutorials/Notebook_Index.ipynb

This opens a guided introduction to underworld3 with links to all beginner tutorials.

Common Commands

./uw # Show status and available environments
./uw setup # (Re)configure environment
./uw build # Rebuild after source changes
./uw test# Run quick tests
./uw jupyter lab # Start JupyterLab
./uw doctor # Diagnose configuration issues
./uw status # Check for updates on GitHub
./uw update # Pull latest changes and rebuild
./uw --help # Full documentation

Troubleshooting

If you encounter build errors or import failures, run diagnostics:

./uw doctor

This checks your environment configuration and provides specific fixes for common issues like:

  • Missing dependencies (PETSc, petsc4py)
  • Library version mismatches
  • Environment configuration problems

The ./uw build command automatically handles dependency chains—if you're missing petsc4py in an AMR environment, it will build it for you before compiling underworld3.

Alternative: Manual Installation

For more control, see the Installation Instructions

References and Archives

The canonical releases of the code can be found at zenodo.org.

DOI

There is a publication in the Journal of Open Source Software (doi:10.21105/joss.07831) that can be cited when using the software.

status

About

Underworld v3

Resources

Contributing

Stars

26 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages