Package underworld3
Underworld3 Python package
Underworld3 is a finite element, particle-in-cell geodynamics code that produces
mathematically self-describing models through an interface with sympy Underworld3 builds upon the PETSc
parallel finite element and solver package, using their petsc4py library.
A common pattern for building underworld3 models is to develop python scripts in notebook-friendly form
(e.g. with jupytext) which are thoroughly documented through markdown descriptions. underworld objects
are similarly documented so that their underlying algorithmic and mathemcical structure can be examined in
a notebook.
python scripts built this way will also be compatible with mpirun for parallel execution.
Documentation
The underworld documentation is in two parts: the user manual / theory manual is a hand-written document that is built from this repository automatically
from the sources in the Jupyterbook directory. This api documentation is autogenerated from the code and its annotations. There are two version of
each documentation package that are published online. The main (stable) branch
- https://underworldcode.github.io/underworld3/main/index.html
- https://underworldcode.github.io/underworld3/main_api/underworld3/index.html
The development branch has similar documentation:
- https://underworldcode.github.io/underworld3/development/index.html
- https://underworldcode.github.io/underworld3/development_api/underworld3/index.html
Building / installation
Refer to the Dockerfile for uw3 build instructions.
To install from the repository
./compile.sh
An in-place installation may be helpful for developers (as distinct from above)
(compile.sh is a convenience wrapper to pip install)
pip install -e . --no-build-isolation
To clean the git repository or all files … be careful.
./clean.sh
Testing and documentation
Run the pytest testing suite with
./test.sh
This API documentation is build with
./docs.sh
Open uw3_api_docs/index.html to browse.
To uninstall
pip uninstall underworld3
Sub-modules
underworld3.adaptivityunderworld3.ckdtreeunderworld3.constitutive_modelsunderworld3.constitutive_models_newunderworld3.coordinatesunderworld3.discretisationunderworld3.functionunderworld3.kdtreeunderworld3.mathsunderworld3.meshingunderworld3.mpi-
This module contains routines related to parallel operation via the Message Passing Interface (MPI) …
underworld3.scaling-
The scaling module provides units and scaling capabilities.
underworld3.swarmunderworld3.systemsunderworld3.timing-
This module implements some high level timing operations for Underworld, allowing users to determine how walltime is divided between different …
underworld3.utilitiesunderworld3.visualisation
Functions
def view()-
Expand source code
def view(): from IPython.display import Latex, Markdown, display from textwrap import dedent import inspect ## Docstring (static) docstring = dedent(__doc__) # docstring = docstring.replace("$", "$").replace("$", "$") display(Markdown(docstring)) return