Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • usadellab/cplantbox_simulations
  • ceplas/cplantbox_simulations
2 results
Show changes
Commits on Source (6)
Showing
with 396 additions and 0 deletions
arc_specification: 2.0.0-draft
This diff is collapsed.
.project
.cproject
.pydevproject
.settings/
Debug/
.vs
CMakeFiles/
a.out
CPlantBox_Codeblocks_project/
*.ipch *.db .vs/cpb/v15/.suo examples/PSP_infiltrationRedistribution1D/*
examples/Exudation/* /.vs /__pycache__/xylem_flux.cpython-35.pyc
/__pycache__/rb_tools.cpython-36.pyc
/__pycache__/rb_tools.cpython-35.pyc /__pycache__
/CPlantBoxVS.vcxproj.user /CPlantBoxVS.vcxproj.filters
/CPlantBoxVS.vcxproj /CPlantBoxVS.sln /py_plantbox.so
/Report20180320-1455.diagsession /Debug /x64 *.vtp py_plantbox.so
examples/Coupling_PSP/__pycache__/
# CMake clutter
build-* Testing CMakeCache.txt CMakeFiles/ *.cmake *.a
# auto-saved files
*~
examples/CMakeFiles/
python/cpbvenv
./src/CMakeFiles/*
*/Makefile
CMakeCache.txt
cmake_install.cmake
./src/libCPlantBox.a
./examples/test_cplantbox
\ No newline at end of file
# build the CPlantBox library using CMake
# Simply type cmake . && make
# although out-of-source-builds are encouraged
cmake_minimum_required (VERSION 2.8.12)
project (CPlantBox)
# set compiler options
set(RELEASE_WARNING_OPTS "-Wall -Wunused -Wmissing-include-dirs -Wcast-align -Wno-sign-compare")
set(DEBUG_WARNING_OPTS "-Wall -Wunused -Wmissing-include-dirs -Wcast-align")
set(RELEASE_OPTS "-std=c++11 -fno-strict-aliasing -fstrict-overflow -fno-finite-math-only -O3 -march=native -funroll-loops -g0")
set(CMAKE_CXX_FLAGS_RELEASE "${RELEASE_WARNING_OPTS} ${RELEASE_OPTS}")
set(CMAKE_CXX_FLAGS_DEBUG "-std=c++11 -O0 -ggdb -Wall")
# set default build type to release
set(CMAKE_BUILD_TYPE Release)
# add source directory to the include path
include_directories(${PROJECT_SOURCE_DIR}/src)
# add subdirectories
add_subdirectory(src)
add_subdirectory(examples)
add_subdirectory(tutorial/jupyter)
# Naming Guidline
Underlines used for parameter name
Camel case (stylized as camelCase; also known as camel caps or more formally as medial capitals) is used for Class name (start with capital letter) and function name (start with lower case letter).
<?xml version="1.0" encoding="UTF-8"?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6"/>
<Project>
<Option title="CPlantBox"/>
<Option makefile_is_custom="1"/>
<Option compiler="gcc"/>
<Option virtualFolders="CMake Files\;CMake Files\src\;CMake Files\examples\;CMake Files\python\;"/>
<Build>
<Target title="all">
<Option working_dir="/home/crootbox/CPlantBox"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/Makefile&quot; VERBOSE=1 all"/>
<CompileFile command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="rebuild_cache">
<Option working_dir="/home/crootbox/CPlantBox"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/Makefile&quot; VERBOSE=1 rebuild_cache"/>
<CompileFile command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="edit_cache">
<Option working_dir="/home/crootbox/CPlantBox"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/Makefile&quot; VERBOSE=1 edit_cache"/>
<CompileFile command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="CPlantBox">
<Option output="/home/crootbox/CPlantBox/src/libCPlantBox.a" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/home/crootbox/CPlantBox/src"/>
<Option object_output="./"/>
<Option type="2"/>
<Option compiler="gcc"/>
<Compiler>
<Add directory="/home/crootbox/CPlantBox/src"/>
<Add directory="/usr/include/python3.6m"/>
</Compiler>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 CPlantBox"/>
<CompileFile command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="CPlantBox/fast">
<Option output="/home/crootbox/CPlantBox/src/libCPlantBox.a" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/home/crootbox/CPlantBox/src"/>
<Option object_output="./"/>
<Option type="2"/>
<Option compiler="gcc"/>
<Compiler>
<Add directory="/home/crootbox/CPlantBox/src"/>
<Add directory="/usr/include/python3.6m"/>
</Compiler>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 CPlantBox/fast"/>
<CompileFile command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="py_plantbox">
<Option output="/home/crootbox/CPlantBox/python/py_plantbox.so" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/home/crootbox/CPlantBox/src"/>
<Option object_output="./"/>
<Option type="3"/>
<Option compiler="gcc"/>
<Compiler>
<Add directory="/home/crootbox/CPlantBox/src"/>
<Add directory="/usr/include/python3.6m"/>
</Compiler>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 py_plantbox"/>
<CompileFile command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="py_plantbox/fast">
<Option output="/home/crootbox/CPlantBox/python/py_plantbox.so" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/home/crootbox/CPlantBox/src"/>
<Option object_output="./"/>
<Option type="3"/>
<Option compiler="gcc"/>
<Compiler>
<Add directory="/home/crootbox/CPlantBox/src"/>
<Add directory="/usr/include/python3.6m"/>
</Compiler>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 py_plantbox/fast"/>
<CompileFile command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/src/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="test_cplantbox">
<Option output="/home/crootbox/CPlantBox/examples/test_cplantbox" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/home/crootbox/CPlantBox/examples"/>
<Option object_output="./"/>
<Option type="1"/>
<Option compiler="gcc"/>
<Compiler>
<Add directory="/home/crootbox/CPlantBox/src"/>
</Compiler>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/examples/Makefile&quot; VERBOSE=1 test_cplantbox"/>
<CompileFile command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/examples/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/examples/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/examples/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="test_cplantbox/fast">
<Option output="/home/crootbox/CPlantBox/examples/test_cplantbox" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/home/crootbox/CPlantBox/examples"/>
<Option object_output="./"/>
<Option type="1"/>
<Option compiler="gcc"/>
<Compiler>
<Add directory="/home/crootbox/CPlantBox/src"/>
</Compiler>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/examples/Makefile&quot; VERBOSE=1 test_cplantbox/fast"/>
<CompileFile command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/examples/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/examples/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/crootbox/CPlantBox/examples/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
</Build>
<Unit filename="/home/crootbox/CPlantBox/examples/main.cpp">
<Option target="test_cplantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/Leaf.cpp">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/Leaf.h">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/LeafTropism.cpp">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/LeafTropism.h">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/ModelParameter.cpp">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/ModelParameter.h">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/Organ.cpp">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/Organ.h">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/Plant.cpp">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/Plant.h">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/PythonPlant.cpp">
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/Root.cpp">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/Root.h">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/RootTropism.cpp">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/RootTropism.h">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/Seed.cpp">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/Seed.h">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/Stem.cpp">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/Stem.h">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/StemTropism.cpp">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/StemTropism.h">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/analysis.cpp">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/analysis.h">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/sdf.cpp">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/sdf.h">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/tinyxml2.cpp">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/tinyxml2.h">
<Option target="CPlantBox"/>
<Option target="py_plantbox"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/CMakeLists.txt">
<Option virtualFolder="CMake Files\"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/src/CMakeLists.txt">
<Option virtualFolder="CMake Files\src\"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/examples/CMakeLists.txt">
<Option virtualFolder="CMake Files\examples\"/>
</Unit>
<Unit filename="/home/crootbox/CPlantBox/python/CMakeLists.txt">
<Option virtualFolder="CMake Files\python\"/>
</Unit>
</Project>
</CodeBlocks_project_file>
This diff is collapsed.
This diff is collapsed.
# CPlantBox
[![DOI](https://zenodo.org/badge/95107851.svg)](https://zenodo.org/badge/latestdoi/95107851) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Plant-Root-Soil-Interactions-Modelling/CPlantBox/blob/isp/tutorial/jupyter/CPlantBox_PiafMunch_Tutorial_(include_installation).ipynb) [![Teaching Material LBRAI2219](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Plant-Root-Soil-Interactions-Modelling/CPlantBox/blob/isp/tutorial/jupyter/CPlantBox_Lesson.ipynb)\
Two main functions
1. Create plant structure
2. Coupling with PiafMunch to have carbon and water flow inside the structure.
# Create plant structure in 5 minutes
The most convenient way is to use google colab, which is a Linux with jupyter notebook interface.
You can click the link to follow the guide there, just to click some buttons and you will be able to create plants
[here is the link to use it](https://colab.research.google.com/github/Plant-Root-Soil-Interactions-Modelling/CPlantBox/blob/master/tutorial/jupyter/CPlantBox_PiafMunch_Tutorial_(include_installation).ipynb)
# Folder sructure
/src CPlantBox C++ codes
/examples Some examples how to use the CplantBox
/modelparameter Some root parameter, and a plant parameter files
/scripts Pyhthon scripts for visualization with Paraview, and Matlab scripts for parameter export
/results Nice result images
# Documentation
Create the documentation by running doxygen in the folder
$ doxygen doxy_config
The documentation should now be located in the folder /doc
# Example
# Examples
Simulation videos availabe in Youtube Channel https://www.youtube.com/channel/UCPK-pFfpK94jiamgwHxX32Q
[![Plant Simulations -- 8K resolution](https://media.giphy.com/media/LmBztw7mNwluJPJ3cU/giphy.gif)](https://www.youtube.com/watch?v=jNbvjW-WFvk "CPlantBox Simulations -- 8K resolution")
This diff is collapsed.
#!/bin/sh
NAMESPACE=CPlantBox
for x in $(find . -name "*.h"); do
sed -i "$(grep -n "^#" $x | tail -2 | head -1 | sed 's/:.*//')a\\\nnamespace $NAMESPACE {\n" $x
sed -i "$(($(grep -n "^#" $x | tail -1 | sed 's/:.*//')-1))a} // namespace $NAMESPACE\n" $x
done
for x in $(find . -name "*.cpp"); do
sed -i "$(grep -n "#include" $x | tail -1 | sed 's/:.*//')a\\\nnamespace $NAMESPACE {\n" $x
echo >> $x
echo "} // namespace $NAMESPACE" >> $x
done
#
# Make the C++ example
#
add_executable(test_cplantbox main.cpp)
target_link_libraries(test_cplantbox CPlantBox)
# link the model parameter folder (on Windows we have to copy since symlinks are not supported)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
execute_process(COMMAND ${CMAKE_COMMAND} "-E" "copy" "${PROJECT_SOURCE_DIR}/modelparameter" "${CMAKE_CURRENT_BINARY_DIR}/modelparameter")
else()
execute_process(COMMAND ${CMAKE_COMMAND} "-E" "create_symlink" "${PROJECT_SOURCE_DIR}/modelparameter" "${CMAKE_CURRENT_BINARY_DIR}/modelparameter")
endif()
upperDepth, lowerDepth, Campbell_he, Campbell_b, VG_he, VG_alpha, VG_n, VG_alpha_mod, VG_n_mod, thetaR, thetaS, Ksat
0.0, 1.0, -2.08, 4.74, -2.6, 0.14, 1.2, 0.14, 1.2, 0.05, 0.43, 0.003
upperDepth, lowerDepth, Campbell_he, Campbell_b, VG_he, VG_alpha, VG_n, VGmod_alpha, VGmod_n, thetaR, thetaS, Ksat
0.0, 0.2, -2.08, 4.74, -2.6, 0.14, 1.2, 0.2, 1.2, 0.01, 0.44, 0.000167
0.2, 0.7, -5.15, 2.59, -2.7, 0.19, 1.18, 0.19, 1.1, 0.01, 0.45, 0.000101
0.7, 1.0, -0.73, 1.69, -0.7, 0.68, 1.7, 0.68, 1.7, 0.01, 0.37, 0.002814
upperDepth, lowerDepth, Campbell_he, Campbell_b, VG_he, VG_alpha, VG_n, VGmod_alpha, VGmod_n, thetaR, thetaS, Ksat
0.0, 1.0, -2.08, 4.74, -2.6, 0.14, 1.2, 0.2, 1.2, 0.01, 0.44, 0.001
upperDepth, lowerDepth, Campbell_he, Campbell_b, VG_he, VG_alpha, VG_n, VG_alpha_mod, VG_n_mod, thetaR, thetaS, Ksat
0.0, 1.0, -4.2, 4.58, -3.8, 0.15, 1.35, 0.3, 1.33, 0.01, 0.46, 0.001