Commit bf5a5603 authored by Dion Haefner's avatar Dion Haefner

merge with old repo

parent ff8f324c
# CMake generated Testfile for
# Source directory: /home/dion/codes/dorie/dorie/cmake/modules
# Build directory: /home/dion/codes/dorie/dorie/cmake/modules
#
# This file includes the relevant testing commands required for
# testing this directory and lists subdirectories to be tested as well.
# File for module specific CMake tests.
# find all required packages
FIND_PACKAGE(HDF5 REQUIRED COMPONENTS C)
FIND_PACKAGE(FFTW REQUIRED)
FIND_PACKAGE(SuperLU REQUIRED)
FIND_PACKAGE(MPI REQUIRED)
FIND_PACKAGE(UG REQUIRED)
FIND_PACKAGE(METIS)
FIND_PACKAGE(ParMETIS)
FIND_PACKAGE (HDF5 REQUIRED)
FIND_PACKAGE (FFTW REQUIRED)
FIND_PACKAGE (SuperLU REQUIRED)
FIND_PACKAGE (MPI REQUIRED)
FIND_PACKAGE (METIS REQUIRED)
FIND_PACKAGE (ParMETIS REQUIRED)
FIND_PACKAGE (UG REQUIRED)
include_directories(${FFTW_INCLUDES})
include_directories(${HDF5_INCLUDE_DIRS})
......
This diff is collapsed.
# This cmake module provides macros that install python packages into the virtualenv
# that is shared by all dune modules that depend on dune-python.
#
# .. cmake_function:: dune_install_python_package
#
# .. cmake_param:: PATH
# :required:
# :single:
#
# Relative path to the given python package source code.
#
# .. cmake_param:: MAJOR_VERSION
# :single:
#
# Set to "2" or "3" if your python package only works with
# python2 or python3. This will restrict the installation process to that
# python version.
#
# .. cmake_param:: NO_PIP
# :option:
#
# Instead of :code:`pip -e`, `python setup.py develop` will be used as
# the installation command.
#
# .. cmake_param:: NO_EDIT
# :option:
#
# Will drop :code:`pip`s :code:`-e` option (or switch :code:`develop` to :code:`install`).
# Only use this option if your package is incompatible with :code:`-e`.
#
# Installs the python package located at path into the virtualenv used by dune-python
# The package at the given location is expected to be a pip installable package.
# Also marks the given python package for global installation during :code:`make install`.
# By default, the python package will then be installed into the system-wide site-packages
# location. If you do not want to install it there, or you do not have permission to,
# you may optionally set :ref:`DUNE_PYTHON_INSTALL_USER` to a username. The
# packages will then be installed in the home directory of that user.
# This is done through pips :code:`--user` option. Installation in arbitrary locations is not
# supported to minimize :code:`PYTHONPATH` issues.
#
# .. cmake_variable:: DUNE_PYTHON_INSTALL_USER
#
# dune-python only supports two ways of globally installing python packages during
# :code:`make install`:
#
# * Into standard system paths (default)
# * Into the standard python path of a users home directory (through :code:`pip --user`)
#
# Set this variable to a username to use the latter.
#
include(CheckPythonPackage)
function(dorie_install_python_package)
# Parse Arguments
set(OPTION NO_PIP NO_EDIT QUIET)
set(SINGLE PATH MAJOR_VERSION)
set(MULTI)
include(CMakeParseArguments)
cmake_parse_arguments(PYINST "${OPTION}" "${SINGLE}" "${MULTI}" ${ARGN})
if(PYINST_UNPARSED_ARGUMENTS)
message(WARNING "Unparsed arguments in dune_install_python_package: This often indicates typos!")
endif()
# apply defaults
if(NOT PYINST_MAJOR_VERSION)
set(PYINST_MAJOR_VERSION 2 3)
endif()
# check for available pip packages
check_python_package(PACKAGE pip
INTERPRETER ${PYTHON2_EXECUTABLE}
RESULT PIP2_FOUND)
check_python_package(PACKAGE pip
INTERPRETER ${PYTHON3_EXECUTABLE}
RESULT PIP3_FOUND)
# Construct the installation command strings from the given options
if(PYINST_NO_PIP)
if(PYINST_NO_EDIT)
set(INST_COMMAND install)
else()
set(INST_COMMAND develop)
endif()
set(VENV_INSTALL_COMMAND python setup.py ${INST_COMMAND})
else()
set(EDIT_OPTION)
if(NOT PYINST_NO_EDIT)
set(EDIT_OPTION -e)
endif()
if(PYINST_QUIET)
set(EDIT_OPTION "-q ${EDIT_OPTION}")
endif()
set(VENV_INSTALL_COMMAND python -m pip install ${EDIT_OPTION} .)
endif()
# Construct the interpreter options for global installation
if(PYINST_NO_PIP)
set(SYSTEM_INSTALL_OPTIONS setup.py install)
if(DUNE_PYTHON_INSTALL_USER)
message("Error message: Incompatible options - NO_PIP and DUNE_PYTHON_INSTALL_USER")
endif()
else()
set(USER_STRING "")
if(DUNE_PYTHON_INSTALL_USER)
set(USER_STRING --user ${DUNE_PYTHON_INSTALL_USER})
endif()
set(SYSTEM_INSTALL_OPTIONS -m pip install ${USER_STRING} .)
endif()
# iterate over the given interpreters
foreach(version ${PYINST_MAJOR_VERSION})
# install the package into the virtual env
execute_process(COMMAND ${CMAKE_BINARY_DIR}/dune-env-${version} ${VENV_INSTALL_COMMAND}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${PYINST_PATH})
# define a rule on how to install the package during make install
if(PIP${version}_FOUND)
install(CODE "execute_process(COMMAND ${PYTHON${version}_EXECUTABLE} ${SYSTEM_INSTALL_OPTIONS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${PYINST_PATH})
")
else()
install(CODE "message(FATAL_ERROR \"You need the python${version} package pip installed on the host system to install a module that contains python code\")")
endif()
endforeach()
endfunction()
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.5
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/dion/codes/dorie/dorie
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/dion/codes/dorie/dorie
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target test
test:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..."
/usr/bin/ctest --force-new-ctest-process $(ARGS)
.PHONY : test
# Special rule for the target test
test/fast: test
.PHONY : test/fast
# Special rule for the target package
package: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..."
cd /home/dion/codes/dorie/dorie && /usr/bin/cpack --config ./CPackConfig.cmake
.PHONY : package
# Special rule for the target package
package/fast: package
.PHONY : package/fast
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
/usr/bin/cmake-gui -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# Special rule for the target package_source
package_source:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..."
cd /home/dion/codes/dorie/dorie && /usr/bin/cpack --config ./CPackSourceConfig.cmake /home/dion/codes/dorie/dorie/CPackSourceConfig.cmake
.PHONY : package_source
# Special rule for the target package_source
package_source/fast: package_source
.PHONY : package_source/fast
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# Special rule for the target install/strip
install/strip: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip
# Special rule for the target install/strip
install/strip/fast: install/strip
.PHONY : install/strip/fast
# Special rule for the target install/local
install/local: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local
# Special rule for the target install/local
install/local/fast: install/local
.PHONY : install/local/fast
# Special rule for the target list_install_components
list_install_components:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
.PHONY : list_install_components
# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast
# Special rule for the target install
install: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install
# Special rule for the target install
install/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install/fast
# The main all target
all: cmake_check_build_system
cd /home/dion/codes/dorie/dorie && $(CMAKE_COMMAND) -E cmake_progress_start /home/dion/codes/dorie/dorie/CMakeFiles /home/dion/codes/dorie/dorie/cmake/modules/CMakeFiles/progress.marks
cd /home/dion/codes/dorie/dorie && $(MAKE) -f CMakeFiles/Makefile2 cmake/modules/all
$(CMAKE_COMMAND) -E cmake_progress_start /home/dion/codes/dorie/dorie/CMakeFiles 0
.PHONY : all
# The main clean target
clean:
cd /home/dion/codes/dorie/dorie && $(MAKE) -f CMakeFiles/Makefile2 cmake/modules/clean
.PHONY : clean
# The main clean target
clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
cd /home/dion/codes/dorie/dorie && $(MAKE) -f CMakeFiles/Makefile2 cmake/modules/preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
cd /home/dion/codes/dorie/dorie && $(MAKE) -f CMakeFiles/Makefile2 cmake/modules/preinstall
.PHONY : preinstall/fast
# clear depends
depend:
cd /home/dion/codes/dorie/dorie && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend
# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... test"
@echo "... package"
@echo "... edit_cache"
@echo "... package_source"
@echo "... rebuild_cache"
@echo "... install/strip"
@echo "... install/local"
@echo "... list_install_components"
@echo "... install"
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
cd /home/dion/codes/dorie/dorie && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system
# Install script for directory: /home/dion/codes/dorie/dorie/cmake/modules
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/share/dune/cmake/modules" TYPE FILE FILES "/home/dion/codes/dorie/dorie/cmake/modules/DorieMacros.cmake")
endif()
message(STATUS "Python modules path: ${DORIE_PYTHON_MODULES}")
add_subdirectory("doxygen")
add_subdirectory("parameters")
add_subdirectory("sphinx")
add_subdirectory("default_files")
# copy static files to build tree
file(COPY ${CMAKE_CURRENT_LIST_DIR}/examples DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/figures DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
include(DuneSphinxCMakeDoc)
dune_cmake_sphinx_doc()
if(TARGET sphinx_html)
add_dependencies(sphinx_html doxygen_dorie)
endif()
......@@ -26,15 +26,19 @@ import shlex
deploy_mode = '@DEPLOY_SPHINX@' in ['1',"True","true"]
rst_prolog = """
.. |branch| replace:: @DEPLOY_SPHINX_GITBRANCH@
"""
def setup(app): # pass this along
app.add_config_value('deploy_mode', '', 'env')
sys.path.append('@DUNE_SPHINX_EXT_PATH@')
python_modules = '@DORIE_PYTHON_MODULES@'
#python_modules = '@DORIE_PYTHON_MODULES@'
for module in python_modules.split(";"):
sys.path.append(module)
#for module in python_modules.split(";"):
# sys.path.append(module)
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
......@@ -319,5 +323,5 @@ texinfo_documents = [
# -- Breathe configuration -----------------------------------------------
breathe_projects = { "dorie": "@CMAKE_CURRENT_BINARY_DIR@/../doxygen/xml" }
breathe_projects = { "dorie": "@CMAKE_CURRENT_BINARY_DIR@/doxygen/xml" }
breathe_default_project = "dorie"
spatial_resolution_north 0
spatial_resolution_south 0
spatial_resolution_west -1
spatial_resolution_east -1
number_BC_change_times 1
0 neumann -5.55e-6 dirichlet 0
\ No newline at end of file
spatial_resolution_north_we 0
spatial_resolution_north_fb 0
spatial_resolution_south_we 0
spatial_resolution_south_fb 0
spatial_resolution_west_sn -1
spatial_resolution_west_fb -1
spatial_resolution_east_sn -1
spatial_resolution_east_fb -1
spatial_resolution_front_sn -1
spatial_resolution_front_we -1
spatial_resolution_back_sn -1
spatial_resolution_back_we -1
number_BC_change_times 1
0 neumann -5.55e-6 dirichlet 0
\ No newline at end of file
function(scrape_parameters SOURCE_DIR XML_FILE CSS OUTPUT RESULT_NAME)
message(STATUS "Running parameter scraper on sources ${SOURCE_DIR}")
if(DEPLOY_SPHINX_SOURCE_URL)
execute_process(COMMAND ${CMAKE_BINARY_DIR}/dune-env scrape_folder.py --source ${SOURCE_DIR}
--xml ${XML_FILE} --out ${OUTPUT} --css ${CSS}
--source_url ${DEPLOY_SPHINX_SOURCE_URL}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE RETURN_CODE)
else()
execute_process(COMMAND ${CMAKE_BINARY_DIR}/dune-env scrape_folder.py --source ${SOURCE_DIR}
--xml ${XML_FILE} --out ${OUTPUT} --css ${CSS}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE RETURN_CODE)
endif()
set(${RESULT_NAME} ${RETURN_CODE} PARENT_SCOPE)
endfunction()
file(COPY ${CMAKE_CURRENT_LIST_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/..)
scrape_parameters(${PROJECT_SOURCE_DIR}/dune/dorie-rfg ${CMAKE_CURRENT_SOURCE_DIR}/field-parameters.xml ${CMAKE_CURRENT_SOURCE_DIR}/parameters.css "default_pf.ini field-parameters.html field-parameters.rst" FIELDPARSCRAPE_RETURN)
if (${FIELDPARSCRAPE_RETURN} GREATER 0)
message(FATAL_ERROR "Parameter scraper failed. DORiE can not be built.")
endif()
scrape_parameters(${PROJECT_SOURCE_DIR}/dune/dorie ${CMAKE_CURRENT_SOURCE_DIR}/parameters.xml ${CMAKE_CURRENT_SOURCE_DIR}/parameters.css "default.ini parameters.html parameters.rst" PARSCRAPE_RETURN)
if (${PARSCRAPE_RETURN} GREATER 0)
message(FATAL_ERROR "Parameter scraper failed. DORiE can not be built.")
endif()
<?xml version="1.0" encoding="UTF-8"?>
<!--
If you want to use any special characters, you will need to define them here.
A full list is found at https://www.w3.org/TR/REC-html40/sgml/entities.html
-->
<!DOCTYPE naughtyxml [
<!ENTITY alpha "&#945;">
<!ENTITY beta "&#946;">
<!ENTITY eta "&#951;">
<!ENTITY tau "&#964;">
<!ENTITY times "&#215;">
]>
<!--
XML file hierarchy:
<dorie> -> <category> -> <parameter> -> (parameter attributes)
Possible parameter attributes:
definition: meaning of the parameter, will only show up in html output
suggestion: standard value in created parameter files
values: possible values, will only show up in html output
comment: extra comment, will only show up in parameter files
All attributes are optional.
The parser supports rudimentary markdown / styling. You can add a paragraph by
adding an empty line, make text **bold** or ``monospaced``.
-->
<dorie>
<category name="general" hidden="true">
<parameter name="generator">
<definition>
Specifies which parameter field generator module should be used.
</definition>
<values> image, csv, fft, hdf5 </values>
<suggestion> csv </suggestion>
<comment> One of: image, csv, fft, hdf5 </comment>
</parameter>
<parameter name="inputFile">
<definition>
Path to file holding the parameter distribution data (i.e., image, CSV file,
or HDF5 file). Has no effect when using FFT generator.
</definition>
<values> path </values>
</parameter>
<parameter name="outputFile">
<definition>
Output file name of the parameter field array.
</definition>
<values> path </values>
<suggestion> field.h5 </suggestion>
</parameter>
<parameter name="parameterization">
<definition>
Parameterization to be used when mapping field value to parameter.
Essentially sets which ``parameters.&lt;parameterization&gt;.&lt;x&gt;``
values should be used.
</definition>
<values> vanGenuchten </values>
<suggestion> vanGenuchten </suggestion>
</parameter>
<parameter name="overwrite">
<definition>
Whether an existing parameter field array should be overwritten.
</definition>
<values> bool </values>
<suggestion> false </suggestion>
</parameter>
</category>
<category name="parameters.vanGenuchten.1" hidden="true">
<parameter name="theta_r">
<definition>
Residual water content of medium 1, used in the Mualem-van Genuchten
parameterization. Default values for sand, according to Soil Physics, p. 92.
</definition>
<values> float </values>
<suggestion> 0.03 </suggestion>
</parameter>
<parameter name="theta_s">
<definition> Saturated water content. </definition>
<values> float </values>
<suggestion> 0.32 </suggestion>
</parameter>
<parameter name="alpha">
<definition> log10(&alpha;) in the van Genuchten parameterization. Units: [1/m] </definition>
<values> float </values>
<suggestion> -2.3 </suggestion>
</parameter>
<parameter name="tau">
<definition> &tau; in the Mualem parameterization of the hydraulic permeability. </definition>
<values> float </values>
<suggestion> -1.1 </suggestion>
</parameter>
<parameter name="n">
<definition> n in the van Genuchten parameterization. </definition>
<values> float </values>
<suggestion> 4.17 </suggestion>
</parameter>
<parameter name="k0">
<definition> Saturated hydraulic conductivity. Units: [m/s] </definition>
<values> float </values>
<suggestion> 2.2E-5 </suggestion>
</parameter>
</category>
<category name="parameters.vanGenuchten.2" hidden="true">
<parameter name="theta_r">
<definition>
Residual water content of medium 2, used in the Mualem-van Genuchten
parameterization. Default values for silt, according to Soil Physics, p. 92.
</definition>
<values> float </values>
<suggestion> 0.01 </suggestion>
</parameter>
<parameter name="theta_s">
<definition> Saturated water content. </definition>
<values> float </values>
<suggestion> 0.41 </suggestion>
</parameter>
<parameter name="alpha">
<definition> log10(&alpha;) in the van Genuchten parameterization. Units: [1/m] </definition>
<values> float </values>
<suggestion> -0.7 </suggestion>
</parameter>
<parameter name="tau">
<definition> &tau; in the Mualem parameterization of the hydraulic permeability. </definition>
<values> float </values>
<suggestion> .0 </suggestion>
</parameter>
<parameter name="n">
<definition> n in the van Genuchten parameterization. </definition>
<values> float </values>
<suggestion> 1.3 </suggestion>
</parameter>