Commit 49ae51fd authored by Lukas Riedel's avatar Lukas Riedel

Add docs to parameter scraper CMake functions. Copy BC files to build dir.

parent dd194012
#
# .. cmake_function:: scrape_parameters
#
# The working directory of the function call is the CURRENT_BINARY_DIR.
#
# .. cmake_param:: SOURCE_DIR
# :single:
# :required:
#
# The source directory to parse. The scraper will perform a recursive
# walk through its subdirectories
#
# .. cmake_param:: XML_FILE
# :single:
# :required:
#
# The XML file containing the definitions of parameters to parse for.
#
# .. cmake_param:: OUTPUT
# :single:
# :required:
#
# The output YAML file to dump the data into.
#
# .. cmake_param:: MODEL
# :single:
# :optional:
#
# The name of the associated model category. Required for correct parsing
# of config queries inside models.
#
# .. cmake_param:: OVERWRITE
# :option:
#
# Option to overwrite the YAML file if it exists.
#
function(scrape_parameters)
message(STATUS "Running parameter scraper on sources ${SOURCE_DIR}")
......@@ -32,6 +68,36 @@ function(scrape_parameters)
endif()
endfunction()
#
# .. cmake_function:: create_default_config
#
# The working directory of the function call is the CURRENT_BINARY_DIR.
#
# .. cmake_param:: INPUT
# :single:
# :required:
#
# The YAML file from which to read the scraper data.
#
# .. cmake_param:: OUTPUT
# :multi:
# :required:
#
# The output files to write.
#
# .. cmake_param:: SOURCE_DIR
# :single:
# :required:
#
# The source directory of files to parse. Required for correct links from
# docs to files.
#
# .. cmake_param:: CSS
# :single:
# :optional:
#
# The CSS style file to use for the HTML output.
#
function(create_default_config INPUT OUTPUT SOURCE_DIR CSS)
message(STATUS "Creating default config ${OUTPUT}.")
set(options
......@@ -50,8 +116,11 @@ function(create_default_config INPUT OUTPUT SOURCE_DIR CSS)
endif()
endfunction()
# file(COPY ${CMAKE_CURRENT_LIST_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/..)
# copy BC files
file(COPY 2d_infiltr.bcdat DESTINATION .)
file(COPY 3d_infiltr.bcdat DESTINATION .)
# Random field generator
scrape_parameters(
SOURCE_DIR ${PROJECT_SOURCE_DIR}/dune/dorie-rfg
XML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/field-parameters.xml
......@@ -59,6 +128,14 @@ scrape_parameters(
OVERWRITE
)
create_default_config(
${CMAKE_CURRENT_BINARY_DIR}/rfg.yml
"parfield.ini;field-parameters.html;field-parameters.rst"
${PROJECT_SOURCE_DIR}/dune/dorie-rfg
${CMAKE_CURRENT_SOURCE_DIR}/parameters.css
)
# Dorie common
scrape_parameters(
SOURCE_DIR ${PROJECT_SOURCE_DIR}/dune/dorie
XML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/common-parameters.xml
......@@ -66,6 +143,7 @@ scrape_parameters(
OVERWRITE
)
# Model: Richards
scrape_parameters(
SOURCE_DIR ${PROJECT_SOURCE_DIR}/dune/dorie/model/richards
XML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/richards-parameters.xml
......@@ -73,13 +151,7 @@ scrape_parameters(
MODEL "richards"
)
create_default_config(
${CMAKE_CURRENT_BINARY_DIR}/rfg.yml
"parfield.ini;field-parameters.html;field-parameters.rst"
${PROJECT_SOURCE_DIR}/dune/dorie-rfg
${CMAKE_CURRENT_SOURCE_DIR}/parameters.css
)
# Final Dorie config
create_default_config(
${CMAKE_CURRENT_BINARY_DIR}/config.yml
"config.ini;parameters.html;parameters.rst"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment