CPlantBox is a functional-structural plant model that is built in a modular way that can be used at several levels of complexity. CPlantBox describes the geometry of plants by their individual organs, such as roots, stems, and leaves, which evolve over time. It can model functional aspects such as water and carbon dynamics within the plant, and provides gerneral tools to build plant soil-interaction models. To solve partial differential equations CPlantBox can use the finite volume solver DuMux and offers simplified Python interfaces in the repository dumux-rosi.
This installation method requires Ubuntu >= 20.04 and Python >= 3.7. For CPlantBox without dumux-rosi, download the Python file "installCPlantBox.py", and run it:
sudo apt-get update
sudo apt-get upgrade
[ ! -d 'cpbenv' ] && python3 -m venv cpbenv && source cpbenv/bin/activate || source cpbenv/bin/activate
wget https://raw.githubusercontent.com/Plant-Root-Soil-Interactions-Modelling/CPlantBox/master/installCPlantBox.py
python3 installCPlantBox.py
For CPlantBox with dumux-rosi, download and run the Python file "installDumuxRosi_Ubuntu.py" (the file is based on the DuMu$^x$ installation file).
sudo apt-get update
sudo apt-get upgrade
[ ! -d 'cpbenv' ] && python3 -m venv cpbenv && source cpbenv/bin/activate || source cpbenv/bin/activate
wget https://raw.githubusercontent.com/Plant-Root-Soil-Interactions-Modelling/CPlantBox/master/installDumuxRosi_Ubuntu.py
python3 installDumuxRosi_Ubuntu.py
The script will install DuMux and CPlantBox, and CPlantBox is setup within the virtual environment 'cpbenv'. Activate the 'cpbenv' environment when using CPlantBox:
source cpbenv/bin/activate
The scripts might work on other Linux OS but has not been tested.
This installation method uses conda
to setup the building environment for CPlantBox. It'll pull the packages from the conda-forge
channel to avoid licensing restrictions from default channels. For more info on conda restrictions, check this article
- Clone the repository:
git clone --depth 1 -b master https://github.com/Plant-Root-Soil-Interactions-Modelling/CPlantBox.git
- Create the conda environment and build CPlantBox:
cd CPlantBox
conda env create -f environment.yml
conda activate cpb
git submodule update --init --recursive
cmake .
make
- Test the installation by running a tutorial example, e.g.:
cd tutorial/examples/
python example1a_small.py
Clone the repository by running
git clone --depth 1 -b master https://github.com/Plant-Root-Soil-Interactions-Modelling/CPlantBox.git
and use CMake to configure and compile the CPlantBox libraries
cmake . && make
To test the installation run a tutorial example, e.g
cd tutorial/examples/python
python3 example1a.py
Dependecies are listed in the requirements.txt file.
CPlantBox is currently not available on windows. Some pointers to setup a Linux environment on windows are given on the wiki.
Please refer to the wiki
/modelparameter
Plant parameter files
/src
CPlantBox C++ codes
/test
Python tests for all CPlantBox classes
/tutorial
learn to use CPlantBox
/experimental
Specific applications (in sub-folders). contrary to scripts in /tutorial
, might not be kept up to date
Create the documentation by running doxygen in the docs/ folder
doxygen doxy_config
The documentation will be created in this folder. Compile doc/latex/refman.tex to generate the full doxygen documentation in doc/latex/refman.pdf. Additionally, collaboration diagrams give an overview of the code in folder /docs.
The official CPlantBox webapp helps to demonstrate the impact of various CPlantBox parameters and to analyse and explore the resulting 3D plant geometry.
Another web application was designed to conduct simulations and visualize the dynamics of plant growth. The source code is avialable at github-xiaoranzhou.
Simulation videos availabe in Youtube channel.