Commit caaa08a4 authored by Lukas Riedel's avatar Lukas Riedel

Merge branch 'master' into 125-new-data-structure-for-storing-boundary-conditions

Update Transport simulation and local operator to work with new
boundary condition scheme.

* Introduce OutflowBoundaryCondition, derived from base BC.
* Update BC manager to allow Outflow for Transport simulation only.
* Update transport FV local operator to use the new BC interface.
* Add outflow BC to BC unit test.

System tests have not been adapted!
parents e63b060b a73adde6
......@@ -2,6 +2,7 @@
build-cmake/
# Exclude generated files
doc/manual/config-file.rst
python/dorie/wrapper/pf_from_file.py
python/dorie/wrapper/test_dorie.py
python/dorie/dorie/cli/cmds.py
......
......@@ -5,8 +5,14 @@ variables:
CPUS_DIND: 2
DOCKER_LOGIN:
docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PW
DUNE_ENV_IMAGE:
dorie/dune-env:2.6
# DUNE environment image
BASE_IMAGE: dorie/dune-env
# Use semantic versioning (not the version of DUNE) and bump according to
# to whether changes are backwards-compatible or not.
IMAGE_VERSION: "1.2"
DUNE_ENV_IMAGE: ${BASE_IMAGE}:img-v${IMAGE_VERSION}
CMAKE_FLAGS:
-DDUNE_PYTHON_VIRTUALENV_SETUP=True
-DDUNE_PYTHON_ALLOW_GET_PIP=True
......@@ -63,6 +69,7 @@ setup:dune-env-clang:
prep:update-dune: &update
<<: *setup
stage: prep
allow_failure: true
only:
- master
- tags
......@@ -91,6 +98,7 @@ build:system-tests: &build-tests
script:
- CMAKE_FLAGS="$CMAKE_FLAGS"
$DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make $MAKE_FLAGS dorie-rfg
- $DUNECONTROL --only=dorie make $MAKE_FLAGS build_system_tests
- $DUNECONTROL --only=dorie make doc
artifacts:
......@@ -116,6 +124,7 @@ build:debug: &debug
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_CXX_FLAGS_DEBUG='-Werror'"
$DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make $MAKE_FLAGS dorie-rfg
- $DUNECONTROL --only=dorie make $MAKE_FLAGS build_unit_tests
build:debug-clang:
......@@ -129,6 +138,7 @@ build:debug-clang:
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_CXX_FLAGS_DEBUG='-Werror'"
$DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make $MAKE_FLAGS dorie-rfg
- $DUNECONTROL --only=dorie make $MAKE_FLAGS build_unit_tests
......@@ -178,6 +188,13 @@ test:unit-tests:
- $CI_PROJECT_DIR/build-cmake/dune/dorie/test
expire_in: 1 day
test:python-tests:
<<: *test
dependencies: []
script:
- $DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make test_python
# --- Deploy jobs ---
deploy:dockerhub-devel: &deploy
stage: deploy
......
......@@ -6,6 +6,12 @@
### Added
* DORiE now depends on [`yaml-cpp`](https://github.com/jbeder/yaml-cpp/), a
library for reading YAML files. The version required is >=5.2.0.
* New classes representing parameterizations. Every parameterization must now
derive from `RichardsParameterization`, and return function objects
representing parameterization functions.
* Added a abstract base class [`SimulationBase`](dune/dorie/interface/base_simulation.hh)
that models the concept of simulation steps so that they
can be later coupled with other simulations.
* Added an abstract base class
[`SimulationBase`](dune/dorie/common/simulation_base.hh)
that models the concept of simulation steps so that they
......@@ -23,9 +29,20 @@
* New class [`SimulationTransport`](dune/dorie/interface/transport_simulation.hh)
which solves the transport equation with a finite volume scheme for give
grid functions of water content and velocity.
* Grid function container to store transient grid functions !115
* Infrastructure for the input of Miller scaling fields. !110
* Add logging framework 'spdlog' as submodule !106
* Support input of boundary segmentations !119
* Reconstruction of continuous fluxes using RT finite elements !105
* Custom DG finite element map for simplices based on Pk polynomials !125
* Initial conditions expressed as analytic functions using
[muparser](http://beltoforion.de/article.php?a=muparser) !131
* Coupling between transient models for water flow and solute transport !96
* Initial conditions generated from H5 input data !130
* Generic Python VTK file reader !143
* Linear interpolator for initial conditions and scaling fields !145
* Parameterizations for hydrodynamic dispersion in solute transport !141
* Generic Python VTK file reader !143, !150
### Changed
* `Simulation` is renamed `RichardsSimulation` and moved to
......@@ -33,9 +50,6 @@
* `RichardsSimulation` now has its own `RichardsSimulationTraits` derived from
`BaseTraits`, which defines all its member types. `BaseTraits` now have
reduced content and are intended to be shared between models/simulations.
* Grid adaptation now is done in two steps: (1) mark entities of the grid to
refine/coarse and (2) adapt the grid and project the degrees of freedom on
the new grid.
* Data structures for storing and accessing parameters. The new class
`FlowParameters` maps parameter sets and scaling factors to every grid cell
on the coarsest grid level, and only stores one set of parameters for
......@@ -43,6 +57,15 @@
to call `FlowParameters::bind` with a grid entity to cache the appropriate
data. All classes and functions querying parameter data have been updated.
The old parameterization classes located in
[`param_base.hh`](dune/dorie/solver/param_base.hh),
[`param_factory.hh`](dune/dorie/solver/param_factory.hh), and
[`param_van_genuchten.hh`](dune/dorie/solver/param_van_genuchten.hh)
are still used for reading in data for the new storage scheme.
The respective objects are freed once a simulation commences.
* Grid adaptation now is done in two steps: (1) mark entities of the grid to
refine/coarse and (2) adapt the grid and project the degrees of freedom on
the new grid.
The old parameterization classes have been removed.
* `RichardsSimulation` now uses one vector of coefficients instead of two, which
now is a `shared_ptr` instead a `unique_ptr`.
......@@ -118,10 +141,18 @@
the default configuration files and the cheat sheet.
* Use logging framework 'spdlog' for all terminal output !106
* DORiE now writes vertex data by default. #129
* Switch license from MIT to GPLv3 !135
* Specifying scaling field `extensions` and `offset` is now optional !133
* Generalized initial condition specification in config file !129
* Structure and setup of Sphinx user docs !126
* Switch to stable `dune-randomfield` release branch !151, !153
* System tests for executing `dorie pfg` module !153
### Fixed
* Solver in `RichardsSimulation` was using the wrong time variable.
[!116](https://ts-gitlab.iup.uni-heidelberg.de/dorie/dorie/merge_requests/116)
* Shape of input datasets was flipped when loading scaling factors !124
### Deprecated
* The configuration file key `[parameters.interpolation]` is deprecated due to
......
cmake_minimum_required(VERSION 2.8.12)
project(dorie CXX)
cmake_minimum_required(VERSION 3.10)
project(dorie C CXX)
# set build type
if(NOT CMAKE_BUILD_TYPE)
......@@ -41,7 +41,7 @@ dune_enable_all_packages()
dune_require_cxx_standard(MODULE "dorie" VERSION 14)
# add subdirectories
add_subdirectory(plugins/vendor)
add_subdirectory("plugins/vendor")
add_subdirectory("m4")
add_subdirectory("cmake/modules")
add_subdirectory("python")
......
# Copyright Notice
DORiE – The DUNE Operated Richards Equation Solving Environment
Copyright (C) 2019 DORiE Developers
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
A copy of the [GNU General Public License](LICENSE) is distributed with the
source code of this program.
## Copyright Holders
The copyright holders of DORiE are referred to as *DORiE Developers* in the
respective copyright notices.
DORiE has been developed by (in alphabetical order)
* Dion Häfner
* Ole Klein
* Santiago Ospina De Los Ríos
* Lukas Riedel
* Felix Riexinger
This diff is collapsed.
MIT License
Copyright (c) 2018
Dion Häfner,
Ole Klein,
Santiago Ospina De Los Ríos,
Lukas Riedel,
Felix Riexinger
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
\ No newline at end of file
This diff is collapsed.
# find all required packages
FIND_PACKAGE (HDF5 REQUIRED)
# These macros check for the following packages, yielding the respective
# targets
#
# HDF5 ... hdf5
# yaml-cpp ... yaml-cpp
# muparser ... muparser::muparser
#
# All of these are required an will be autmatically linked to executables when
# using the DorieTesting CMake macros.
# Add CMake policy stack
cmake_policy(PUSH)
# Allow using `<Package>_ROOT` on CMake >3.12
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
# HDF5
set(HDF5_PREFER_PARALLEL TRUE)
find_package (HDF5 REQUIRED COMPONENTS C)
if(NOT HDF5_IS_PARALLEL)
message(SEND_ERROR "Parallel HDF5 must be installed!")
endif()
add_definitions(-DHDF5_PARALLEL)
FIND_PACKAGE (FFTW REQUIRED)
FIND_PACKAGE (SuperLU REQUIRED)
FIND_PACKAGE (MPI REQUIRED)
# Define a target because the CMake module does not
add_library(hdf5 INTERFACE IMPORTED GLOBAL)
# TODO: Use `target_XXX` functions after raising CMake requirements
# Sanitize the definitions because we cannot use the proper CMake function...
string(REPLACE -D "" HDF5_DEFINITIONS "${HDF5_DEFINITIONS}")
# Set properties directly because of a bug in CMake 3.10
set_target_properties(hdf5 PROPERTIES
INTERFACE_LINK_LIBRARIES "${HDF5_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${HDF5_INCLUDE_DIRS}"
INTERFACE_COMPILE_DEFINITIONS "${HDF5_DEFINITIONS};H5_HAVE_PARALLEL")
# yaml-cpp
find_package (yaml-cpp 0.5.2 REQUIRED)
FIND_PACKAGE (METIS)
FIND_PACKAGE (ParMETIS)
# muparser
find_package (muparser REQUIRED)
include_directories(${FFTW_INCLUDES}
${HDF5_INCLUDE_DIRS}
${YAML_CPP_INCLUDE_DIR})
# Report the DUNE libs
message (STATUS "DUNE Libraries: ${DUNE_LIBS}")
list (APPEND DUNE_LIBS
${FFTW_LIBRARIES}
${HDF5_LIBRARIES}
${YAML_CPP_LIBRARIES})
MESSAGE(STATUS "DUNE Libraries: ${DUNE_LIBS}")
# Remove CMake policy stack
cmake_policy(POP)
# Add DORiE testing functions
include(DorieTesting)
......@@ -7,7 +7,8 @@ add_custom_target(unit_tests
# Add the system test build target and test command
add_custom_target(build_system_tests)
add_custom_target(system_tests
COMMAND ctest --output-on-failure --exclude-regex ^ut.+$
COMMAND ctest
--output-on-failure --exclude-regex "^\\(ut.+\\|python_tests\\)$"
)
# create the mapping datafile as preparation for all tests
......@@ -53,6 +54,9 @@ endfunction()
# tests within DORiE and adds flags for coverage reports. Notice that
# `dune_add_test` requires more parameters than this function alone.
#
# The registered executable is automatically linked to the libraries DORiE
# DORiE depends on.
#
# Use this function exactly like `dune_add_test`.
#
function(dorie_add_unit_test)
......@@ -75,6 +79,8 @@ function(dorie_add_unit_test)
endif()
# add to build target and employ compile options
target_link_libraries(${UNIT_TEST_TARGET}
muparser::muparser hdf5 yaml-cpp spdlog)
add_coverage_links(${UNIT_TEST_TARGET})
add_dependencies(build_unit_tests ${UNIT_TEST_TARGET})
endfunction()
......@@ -129,6 +135,9 @@ endfunction()
# Use this function like `dune_add_system_test`, considering the options
# given above.
#
# When registering a new executable (`TARGET` is not specified), this
# executable will be linked to the libraries DORiE depends on.
#
function(dorie_add_metaini_test)
set(OPTIONS UNIT_TEST)
set(SINGLE TARGET METAINI SCRIPT BASENAME CREATED_TARGETS)
......@@ -177,9 +186,16 @@ function(dorie_add_metaini_test)
SCRIPT ${SYSTEM_TEST_SCRIPT}
CREATED_TARGETS created_targets
)
# report created targets to parent scope
set(${SYSTEM_TEST_CREATED_TARGETS} ${created_targets} PARENT_SCOPE)
# Link to dependencies
if(NOT SYSTEM_TEST_TARGET)
target_link_libraries(${created_targets}
muparser::muparser hdf5 yaml-cpp spdlog)
endif()
# add dependencies and flags
if(SYSTEM_TEST_UNIT_TEST)
add_coverage_links(${created_targets})
......
# - Find the FFTW library
#
# Usage:
# find_package(FFTW [REQUIRED] [QUIET] )
#
# It sets the following variables:
# FFTW_FOUND ... true if fftw is found on the system
# FFTW_LIBRARIES ... full path to fftw library
# FFTW_INCLUDES ... fftw include directory
#
# The following variables will be checked by the function
# FFTW_USE_STATIC_LIBS ... if true, only static libraries are found
# FFTW_ROOT ... if set, the libraries are exclusively searched
# under this path
# FFTW_LIBRARY ... fftw library to use
# FFTW_INCLUDE_DIR ... fftw include directory
#
#If environment variable FFTWDIR is specified, it has same effect as FFTW_ROOT
if( NOT FFTW_ROOT AND ENV{FFTWDIR} )
set( FFTW_ROOT $ENV{FFTWDIR} )
endif()
# Check if we can use PkgConfig
find_package(PkgConfig)
#Determine from PKG
if( PKG_CONFIG_FOUND AND NOT FFTW_ROOT )
pkg_check_modules( PKG_FFTW QUIET "fftw3" )
endif()
#Check whether to search static or dynamic libs
set( CMAKE_FIND_LIBRARY_SUFFIXES_SAV ${CMAKE_FIND_LIBRARY_SUFFIXES} )
if( FFTW_ROOT )
#find libs
find_library(
FFTW_LIB
NAMES "fftw3"
PATHS ${FFTW_ROOT}
PATH_SUFFIXES "lib" "lib64"
NO_DEFAULT_PATH
)
find_library(
FFTWF_LIB
NAMES "fftw3_mpi"
PATHS ${FFTW_ROOT}
PATH_SUFFIXES "lib" "lib64"
NO_DEFAULT_PATH
)
find_library(
FFTWL_LIB
NAMES "fftw3l"
PATHS ${FFTW_ROOT}
PATH_SUFFIXES "lib" "lib64"
NO_DEFAULT_PATH
)
#find includes
find_path(
FFTW_INCLUDES
NAMES "fftw3.h"
PATHS ${FFTW_ROOT}
PATH_SUFFIXES "include"
NO_DEFAULT_PATH
)
else()
find_library(
FFTW_LIB
NAMES "fftw3"
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
)
find_library(
FFTWF_LIB
NAMES "fftw3_mpi"
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
)
find_library(
FFTWL_LIB
NAMES "fftw3l"
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
)
find_path(
FFTW_INCLUDES
NAMES "fftw3.h"
PATHS ${PKG_FFTW_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR}
)
endif( FFTW_ROOT )
set(FFTW_LIBRARIES ${FFTWF_LIB} ${FFTW_LIB})
if(FFTWL_LIB)
set(FFTW_LIBRARIES ${FFTWL_LIB} ${FFTW_LIBRARIES})
endif()
set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV} )
MESSAGE(STATUS "Found FFTW library: ${FFTW_LIBRARIES}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FFTW DEFAULT_MSG
FFTW_INCLUDES FFTW_LIBRARIES)
mark_as_advanced(FFTW_INCLUDES FFTW_LIBRARIES)
# Find the muparser library
#
# Usage:
# find_package(muparser [REQUIRED] [QUIET] )
#
# Hints may be given by the (environment) variables
# muparser_ROOT ... Path to the installation library
#
# It sets the following variables:
# muparser_FOUND ... true if muparser is found on the system
# muparser_LIBRARIES ... full path to muparser library
# muparser_INCLUDES ... muparser include directory
#
# It defines the following targets:
# muparser::muparser ... muparser library to link against
#
find_library(muparser_LIBRARY
NAMES muparser muparserd
HINTS ${muparser_ROOT} ENV muparser_ROOT
)
find_path(muparser_INCLUDE_DIR
muParserDef.h
HINTS ${muparser_ROOT} ENV muparser_ROOT
)
mark_as_advanced(muparser_INCLUDE_DIR muparser_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(muparser
DEFAULT_MSG
muparser_LIBRARY muparser_INCLUDE_DIR)
if (muparser_FOUND)
set(muparser_LIBRARIES ${muparser_LIBRARY} )
set(muparser_INCLUDES ${muparser_INCLUDE_DIR} )
# add the target
add_library(muparser::muparser SHARED IMPORTED)
set_target_properties(muparser::muparser
PROPERTIES IMPORTED_LOCATION ${muparser_LIBRARIES}
INTERACE_INCLUDE_DIRECTORIES ${muparser_INCLUDES}
)
endif()
#
# .. cmake_function:: dorie_install_doc_utils
#
# Installs the software required for building the documentation
# into the `venv`. Resets the cache entry `SPHINX_EXECUTABLE`
# if it was found before and replaces it with the executable
# installed into the `venv`.
#
function(dorie_install_doc_utils)
# install requirements into dune venv
set(INSTALL_CMD -m pip install -r ${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt)
......@@ -23,30 +31,30 @@ dorie_install_doc_utils()
add_subdirectory("doxygen")
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_SOURCE_DIR}/README.md DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
include(DuneSphinxCMakeDoc)
dune_cmake_sphinx_doc(SPHINX_CONF ${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in
RST_SOURCES
index.rst
doxygen-guide.rst
logs-install.rst
other-cmake.rst
public-api.rst
python-dorie-wrapper.rst
python-dorie-parscraper.rst
python-dorie-testtools.rst
python-dorie-utilities.rst
man-bcfile.rst
man-cookbook.rst
man-installation.rst
man-config-file.rst
man-parameter-file.rst
man-grid.rst
MODULE_ONLY)
file(RELATIVE_PATH
CHEATSHEET_PFG_RELPATH
${CMAKE_CURRENT_SOURCE_DIR}/manual
${CMAKE_CURRENT_BINARY_DIR}/default_files/field-parameters.rst)
file(RELATIVE_PATH
CHEATSHEET_DORIE_RELPATH
${CMAKE_CURRENT_SOURCE_DIR}/manual
${CMAKE_CURRENT_BINARY_DIR}/default_files/parameters.rst)
configure_file(manual/config-file.rst.in
${CMAKE_CURRENT_SOURCE_DIR}/manual/config-file.rst)
configure_file(conf.py.in conf.py)
add_custom_target(sphinx_html
COMMAND ${SPHINX_EXECUTABLE}
-T -b html
-c ${CMAKE_CURRENT_BINARY_DIR} # conf.py dir
-d ${CMAKE_CURRENT_BINARY_DIR}/_doctrees # doctree pickles dir
${CMAKE_CURRENT_SOURCE_DIR} # input dir
${CMAKE_CURRENT_BINARY_DIR}/html # output dir
)
if(TARGET sphinx_html)
add_dependencies(sphinx_html doxygen_dorie)
add_dependencies(doc sphinx_html)
endif()
This diff is collapsed.
Introduction
************
This part of the documentation guides through increasingly complicated
use-cases of DORiE. It is intended for users who wish to jump right into using
DORiE, without much knowledge of all its functions. The relevant manual pages
will be linked on the way.
Prerequisites
=============
You need a working application. You can either use the image shipped via
`Docker Hub <https://hub.docker.com/r/dorie/dorie/>`_ or use a local
installation. See the installation manual for details.
Additionally, install Paraview_ for analyzing the output.
.. _Paraview: http://www.paraview.org/download/
.. _Gmsh: http://gmsh.info
Restart
=======
.. warning:: This document is work in progress (WIP).
Currently, DORiE does not have an option to restart simulations. However, it
is possible to make a pseudo-restart from a past simulation using
:doc:`initial conditions<initial>` from data files.
Pseudo-restart
--------------
Since this is not a proper restart, it is necessary to setup the simulation so
that it will start a new one from the data of the last simulation. This
includes to modify the starting time and the initial condition.