Developer Documentation

This comprehensive documentation provides everything you need to understand, contribute to, and extend the Underworld3 computational geodynamics framework.

What is Underworld3?

Underworld3 is a Python library for computational geodynamics and geophysical modeling, built on a foundation of:

  • PETSc parallel computing for scalable finite element methods

  • SymPy symbolic mathematics for mathematical self-description

  • Particle-in-cell methods for Lagrangian tracking

  • Natural mathematical syntax for intuitive model development

Getting Started

Tip

Quick Navigation for Developers

Documentation Structure

This documentation is organized into focused sections:

  • Getting Started — Development setup and contributing guidelines

  • Guides — Practical how-to guides for scripts, notebooks, gmsh, code review

  • Architecture — Mathematical objects and NDArray system internals

  • Design Documents — Architecture decisions and design rationale

  • Subsystems — Detailed documentation of each code module

  • Advanced Topics — Solver development, MPI parallelism, PETSc integration

Development Workflow

Underworld3 follows established patterns for maintaining code quality:

Feature Branch → Development → Testing → Documentation → Code Review → Integration

Key Principles

  1. Solver Stability: Preserve performance of validated numerical methods

  2. Backward Compatibility: Smooth migration paths for API changes

  3. Mathematical Clarity: Code should look like mathematical equations

  4. Parallel Safety: All operations designed for distributed computing

  5. Progressive Enhancement: New features coexist with legacy patterns

Quick Reference

Common Development Tasks

Task

Documentation

Quick Link

Set up development environment

Development Setup

Environment configuration

Understand data access patterns

NDArray System

var.array[...] = values

Write mathematical expressions

Mathematical Objects

momentum = density * velocity

Follow coding standards

Style Guide

Patterns and conventions

Add new functionality

Contributing

Development workflow

Debug parallel issues

MPI Parallelism

Parallel debugging

Build and Test Commands

# Build Underworld3 with pixi
pixi run underworld-build

# Run test suite
pixi run underworld-test

# Build documentation
pixi run docs-build

Community and Support

  • Repository: github.com/underworldcode/underworld3

  • Issues: Report bugs and request features on GitHub

  • Discussions: Join the community for questions and collaboration

  • Documentation: Help improve these docs through pull requests


Note

About This Documentation This developer documentation covers Underworld3 version 0.99+. It includes both conceptual guides and practical implementation details for contributing to the Underworld3 ecosystem.