### Local installation of badlands-companion from GitHub
Source: https://github.com/badlands-model/badlands/blob/master/docs/examples.rst
If pip installation fails, clone the repository and run the setup script manually. This installs the companion functions locally.
```bash
git clone https://github.com/badlands-model/badlands-companion.git
cd badlands-companion
python3 setup.py install
```
--------------------------------
### Install badlands-companion from source
Source: https://github.com/badlands-model/badlands/blob/master/docs/install.rst
Install the badlands-companion package from its cloned repository using setup.py.
```bash
cd ../../badlands-companion
sudo python3 setup.py install
```
--------------------------------
### Install badlands-companion via pip
Source: https://github.com/badlands-model/badlands/blob/master/docs/examples.rst
Install the companion Python package from PyPI. Use this to get the pre- and post-processing classes on your local environment.
```bash
pip install badlands-companion
```
--------------------------------
### Install badlands from source
Source: https://github.com/badlands-model/badlands/blob/master/docs/install.rst
Install the badlands package from the cloned repository using pip.
```bash
sudo python3 -m pip install ./badlands
```
--------------------------------
### Clone badlands and badlands-companion repositories
Source: https://github.com/badlands-model/badlands/blob/master/docs/install.rst
Clone the badlands and badlands-companion repositories from GitHub as the first step of the Git installation method.
```bash
git clone https://github.com/badlands-model/badlands.git
git clone https://github.com/badlands-model/badlands-companion.git
```
--------------------------------
### Run badlands Docker container
Source: https://github.com/badlands-model/badlands/blob/master/docs/install.rst
Starts a new container from the badlandsmodel/badlands image, mapping port 8888 and mounting the current directory to /live/share. Use -it for interactive tty and -v for volume mapping.
```bash
docker run -it -p 8888:8888 -v "$PWD":/live/share badlandsmodel/badlands
```
--------------------------------
### Install badlands via PyPI with meshplex prerequisite
Source: https://github.com/badlands-model/badlands/blob/master/docs/install.rst
Install the required meshplex version and the badlands packages from PyPI. The meshplex dependency must be installed manually first because the PyPI version requires a license.
```bash
sudo pip3 install git+https://github.com/kinnala/meshplex
sudo pip3 install badlands
sudo pip3 install badlands-companion
```
--------------------------------
### Install documentation dependencies
Source: https://github.com/badlands-model/badlands/blob/master/docs/README.md
Install the Python packages required to build the Sphinx documentation. Run this in the same virtualenv or Python environment as Badlands.
```bash
pip install -r requirements.txt
```
--------------------------------
### Pull badlands Docker image
Source: https://github.com/badlands-model/badlands/blob/master/docs/install.rst
Downloads the badlandsmodel/badlands Docker image from Docker Hub. Only needed once before running the container.
```bash
docker pull badlandsmodel/badlands
```
--------------------------------
### Clone the badlands-workshop repository
Source: https://github.com/badlands-model/badlands/blob/master/docs/examples.rst
Use this command to clone the GitHub repository containing the Jupyter notebooks that demonstrate the main workflows for constructing and running surface processes models with badlands.
```bash
git clone https://github.com/badlands-model/badlands-workshop.git
```
--------------------------------
### Finite difference boundary conditions for flexure
Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst
Defines boundary conditions for each edge (W, E, S, N) of the flexure model. Options include 0Displacement0Slope, 0Moment0Shear, 0Slope0Shear, Mirror, and Periodic. The example uses 0Displacement0Slope for all edges.
```xml
0Displacement0Slope0Displacement0Slope0Displacement0Slope0Displacement0Slope
```
--------------------------------
### XML declaration and root element
Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst
The XML input file for badlands starts with the XML declaration and a root element named 'badlands' with an XML schema instance namespace.
```xml
```
--------------------------------
### Wave definition XML structure
Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst
Defines a wave event with start and end times, number of climates, and multiple climate entries specifying percentage of time, significant wave height, and wave direction. The wave field must be ordered by increasing start time with continuous time intervals without overlaps. Wave directions are reduced to 8 possible values (East, North, West, South, NE, NW, SW, SE).
```xml
-14000.030.32.00.32.300.42.300
```
--------------------------------
### Carbonate growth definition XML structure
Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst
Defines carbonate growth with initial basement structure, growth time interval, number of reef growth events, and per-event growth rates for two species. Events must be ordered by increasing start time with continuous time intervals without overlaps. Two carbonate types (species1 and species2) and hemipelagic deposition can be defined.
```xml
data/base500south.csv50.2-1000.-750.0.0090.005-500.-250.0.0.
```
--------------------------------
### Build documentation with Sphinx
Source: https://github.com/badlands-model/badlands/blob/master/docs/README.md
Build the HTML documentation using Sphinx. The READTHEDOCS=True environment variable is required to stub out FORTRAN components with MagicMock, as RTD's builder cannot compile them.
```bash
READTHEDOCS=True make clean html
```
--------------------------------
### Build dist directory for package release
Source: https://github.com/badlands-model/badlands/blob/master/docs/README.md
Build the distribution directory for a package release using the Python build module.
```bash
python -m build
```
--------------------------------
### Couple UWGeodynamics with Badlands surface processes
Source: https://github.com/badlands-model/badlands/blob/master/docs/use.rst
Sets up a Badlands surface process model within a UWGeodynamics simulation. Requires an XML file with Badlands input parameters as described in the documentation. The resulting Model is a 2-way coupled thermo-mechanical model with surface processes, where the velocity field from the thermo-mechanical model advects the surface in Badlands, and material distribution in the thermo-mechanical model is updated. It is recommended to use a higher spatial resolution in the surface processes model than in the thermo-mechanical model.
```python
import UWGeodynamics as GEO
u = GEO.u
air = GEO.Material()
sediment = GEO.Material()
Model.surfaceProcesses = GEO.surfaceProcesses.Badlands(
airIndex=[air.index], sedimentIndex=sediment.index,
XML="resources/badlands.xml", resolution=1. * u.kilometre,
checkpoint_interval=0.01 * u.megayears)
```
--------------------------------
### Stream power law XML configuration (sp_law)
Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst
XML block configuring the stream power law in badlands. Includes deposition toggle, critical slope, deposition percentage, lake fill thickness, m/n exponents, erodibility, marine deposit distribution, and hyperpycnal flow parameters. Defaults: dep=1, fillmax=200 m, diffnb=5, diffprop=0.9; optional parameters slp_cr, perc_dep, propa, propb, dens_cr, deepbasin.
```xml
10.0010.550.0.51.01.e-650.22000.0.0051060.-2500.
```
--------------------------------
### Wave global parameters structure
Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst
Configures wave simulation parameters including model selection (SWAN or WaveSed), time interval, grid resolution, wave base depth, sediment transport and diffusion steps. Defaults are noted for wmodel, wCd, wCe, tsteps, and dsteps.
```xml
0250.1000.2010.000150.0.350.00210500500
```
--------------------------------
### Simulation time structure XML
Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst
Defines the simulation time parameters including restart settings, start/end times, time step bounds, display interval, and mesh output frequency. The restart element specifies the output folder and step number to resume from.
```xml
```
--------------------------------
### Hillslope diffusion parameters XML configuration
Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst
Defines the creep transport parameters for hillslope diffusion in badlands. Includes linear and non-linear diffusion coefficients, critical slope, and slope failure settings. The and parameters are optional with default value 0, meaning non-linear diffusion and slope failure are not considered unless specified.
```xml
0.0010.0050.810.0.263.
```
--------------------------------
### Orographic precipitation model definitions (two rain events)
Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst
Two blocks using the Smith & Barstad (2004) orographic precipitation model. The first uses a linear elevation trend with , , , and . The second includes background precipitation (), wind components (, ), and optional parameters , , , , with documented defaults.
```xml
200000.300000.5000.0.25.3000.300000.400000.5000.1.0.24.-3.2.1000.1000.0.0050.0053000.
```
--------------------------------
### Precipitation structure with uniform and map-based rain events
Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst
Defines the XML block with multiple events. The first uses a uniform precipitation value () and the second uses a precipitation map (