From cd57c4d86e6e020a10191921d24f0bba052d30c8 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Thu, 3 Sep 2015 12:26:04 -0400 Subject: [PATCH 01/33] testHarness: adding support for CDash/CTest subprojects --- .../CMakeFiles/Dashboard_Tutorials.cmake.in | 104 ++++++++++++++++++ .../3.2/CMakeFiles/FOAM_Tutorials.cmake | 11 +- .../3.2/runDir/Allrun_Experimental | 13 ++- .../foam-extend/3.2/runDir/Allrun_Nightly | 15 ++- 4 files changed, 133 insertions(+), 10 deletions(-) create mode 100644 testHarness/foam-extend/3.2/CMakeFiles/Dashboard_Tutorials.cmake.in diff --git a/testHarness/foam-extend/3.2/CMakeFiles/Dashboard_Tutorials.cmake.in b/testHarness/foam-extend/3.2/CMakeFiles/Dashboard_Tutorials.cmake.in new file mode 100644 index 000000000..94794f715 --- /dev/null +++ b/testHarness/foam-extend/3.2/CMakeFiles/Dashboard_Tutorials.cmake.in @@ -0,0 +1,104 @@ +# /*-------------------------------------------------------------------------*\ +# ========= | +# \\ / F ield | foam-extend: Open Source CFD +# \\ / O peration | +# \\ / A nd | For copyright notice see file Copyright +# \\/ M anipulation | +# ----------------------------------------------------------------------------- +# License +# This file is part of foam-extend. +# +# foam-extend 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. +# +# foam-extend 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 foam-extend. If not, see . +# +# Description +# "ctest -S" script configured to drive the Experimental, Nightly and +# Continuous dashboards for the FOAM tutorials +# +# Author +# Martin Beaudoin, Hydro-Quebec, 2015. All rights reserved +# +# \*-------------------------------------------------------------------------*/ +# +set(THIS_SUBPROJECT "Tutorials") +set(CTEST_SOURCE_DIRECTORY $ENV{WM_PROJECT_DIR}) +set(CTEST_BINARY_DIRECTORY "@binary_dir@") +set(CTEST_BUILD_NAME "@BUILDNAME@") +set(CTEST_SITE "@SITE@") +set(PROCESSOR_COUNT $ENV{WM_NCOMPPROCS}) +set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + +# We add the current script as a Build note. +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +# Run in parallel +if(PROCESSOR_COUNT) + set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}") +endif() + + +# We will be using a CDash subproject if the required subproject is defined +# on the remote CDash server. +# Otherwise, the results will still get submitted, but under the global +# "Project" Dashboard, not under the "SubProjects" section. +# This way, we keep on supporting CDash sites where subprojects are +# still not defined. + +# Get the CTEST_PROJECT_SUBPROJECTS definition: +include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake) + +list(FIND CTEST_PROJECT_SUBPROJECTS ${THIS_SUBPROJECT} subProjectIsSupported) + +if (NOT subProjectIsSupported EQUAL -1) + message("Dashboard: Using SubProject: ${THIS_SUBPROJECT}") + set_property(GLOBAL PROPERTY SubProject ${THIS_SUBPROJECT}) + set_property(GLOBAL PROPERTY Label ${THIS_SUBPROJECT}) +endif() + +# Select the required model : Experimental, Nightly, Continuous +# Default model: Experimental +set(DASHBOARD_MODEL Experimental) +if(${CTEST_SCRIPT_ARG} MATCHES Nightly) + set(DASHBOARD_MODEL Nightly) +elseif(${CTEST_SCRIPT_ARG} MATCHES Continuous) + set(DASHBOARD_MODEL Continuous) +endif() + +# Starting the various tests for the specified dashboard model +ctest_start(${DASHBOARD_MODEL}) + +# No need to configure, cmake took care of it already +#ctest_configure() + + +# Intentionally no ctest_update() step in this script when running the +# Experimental dashboard. +# We do not want the source code to get updated since we actually want to test +# the current instance of this source code. So we can test without having to +# commit the source code + +if(${DASHBOARD_MODEL} MATCHES Experimental) + message("Experimental dashboard: We skip the repository update.") +else() + # Updating the repository for the Nightly and Continuous dashboards + ctest_update() +endif() + +# We compile the source code +ctest_build() + +# We run the tests +ctest_test() + +# We submit the results to the CDash service +ctest_submit() diff --git a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake index e5831b535..4eadb09c2 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake +++ b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake @@ -102,7 +102,7 @@ FOREACH(caseWithAllrun ${listofCasesWithAllrun}) # Add a dependency on the global clean-up target # When running in parallel, you need to wait for the cleanup to finish first - SET_TESTS_PROPERTIES(${testId} PROPERTIES DEPENDS ${cleanCasesTestId}) + SET_TESTS_PROPERTIES(${testId} PROPERTIES DEPENDS ${cleanCasesTestId} LABELS Tutorials) # Use this following entry instead for testing purpose #ADD_TEST(${testId} bash -c "cd ${thisCasePath}; true") @@ -117,4 +117,13 @@ EXECUTE_PROCESS( WORKING_DIRECTORY . ) +# Configure the various ctest -S Dashboard drivers + +# Driver for the tutorials +configure_file( + "$ENV{FOAM_TEST_HARNESS_DIR}/CMakeFiles/Dashboard_Tutorials.cmake.in" + "$ENV{FOAM_TEST_HARNESS_DIR}/runDir/Dashboard_Tutorials.cmake" + @ONLY) + + # That's it. diff --git a/testHarness/foam-extend/3.2/runDir/Allrun_Experimental b/testHarness/foam-extend/3.2/runDir/Allrun_Experimental index 4f529c2c1..21bba0a29 100755 --- a/testHarness/foam-extend/3.2/runDir/Allrun_Experimental +++ b/testHarness/foam-extend/3.2/runDir/Allrun_Experimental @@ -86,11 +86,16 @@ cmake $WM_PROJECT_DIR # Invoke make help for the complete list of available commands. # # User-demand testing. -# Will do: ExperimentalConfigure + ExperimentalBuild + ExperimentalTest + ExperimentalSubmit -make Experimental - +# +# The old way. Still valid, but not supporting subprojects +# Will do: ExperimentalBuild + ExperimentalTest + ExperimentalSubmit +#make Experimental +# # Nightly testing -# Will do: NightlyUpdate + NightylConfigure + NightlyBuild + NightlyTest + NightlySubmit +# Will do: NightlyUpdate + NightlyBuild + NightlyTest + NightlySubmit # make Nightly +# The new way. With support for subprojects +ctest -V -S ./Dashboard_Tutorials.cmake,Experimental + # That's it diff --git a/testHarness/foam-extend/3.2/runDir/Allrun_Nightly b/testHarness/foam-extend/3.2/runDir/Allrun_Nightly index fd684c368..ed5825517 100755 --- a/testHarness/foam-extend/3.2/runDir/Allrun_Nightly +++ b/testHarness/foam-extend/3.2/runDir/Allrun_Nightly @@ -86,11 +86,16 @@ cmake $WM_PROJECT_DIR # Invoke make help for the complete list of available commands. # # User-demand testing. -# Will do: ExperimentalConfigure + ExperimentalBuild + ExperimentalTest + ExperimentalSubmit -# make Experimental - +# +# The old way. Still valid, but not supporting subprojects +# Will do: ExperimentalBuild + ExperimentalTest + ExperimentalSubmit +#make Experimental +# # Nightly testing -# Will do: NightlyUpdate + NightylConfigure + NightlyBuild + NightlyTest + NightlySubmit -make Nightly +# Will do: NightlyUpdate + NightlyBuild + NightlyTest + NightlySubmit +# make Nightly + +# The new way. With support for subprojects +ctest -V -S ./Dashboard_Tutorials.cmake,Nightly # That's it From 47b91e9e15fadfef7ba4b14fe16aeb5a0d7d6d7b Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Thu, 3 Sep 2015 12:53:54 -0400 Subject: [PATCH 02/33] Introducing the FOAM_SITE_DIR environment variable. So we can now start using directories like $FOAM_SITE_DIR/etc in scripts for site customization. --- etc/settings.csh | 5 +++-- etc/settings.sh | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/etc/settings.csh b/etc/settings.csh index 45cd45cdc..31c46d8cd 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -52,8 +52,9 @@ setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS setenv FOAM_SRC $WM_PROJECT_DIR/src # shared site configuration - similar naming convention as ~FOAM expansion -setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS -setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS +setenv FOAM_SITE_DIR $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION +setenv FOAM_SITE_APPBIN $FOAM_SITE_DIR/bin/$WM_OPTIONS +setenv FOAM_SITE_LIBBIN $FOAM_SITE_DIR/lib/$WM_OPTIONS # user configuration setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS diff --git a/etc/settings.sh b/etc/settings.sh index 1333e93a2..90bce6e96 100755 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -90,8 +90,9 @@ export FOAM_LIBBIN=$WM_PROJECT_DIR/lib/$WM_OPTIONS export FOAM_SRC=$WM_PROJECT_DIR/src # shared site configuration - similar naming convention as ~FOAM expansion -export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS -export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS +export FOAM_SITE_DIR=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION +export FOAM_SITE_APPBIN=$FOAM_SITE_DIR/bin/$WM_OPTIONS +export FOAM_SITE_LIBBIN=$FOAM_SITE_DIR/lib/$WM_OPTIONS # user configuration export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS From 17d7081e8546872dad87cc42e50d99aada06f66f Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Fri, 4 Sep 2015 09:35:20 -0400 Subject: [PATCH 03/33] testHarness: allow overriding CTestConfig.cmake values for using local site CDash service or for using personnal (user space) CDash service. The expected order of precedence is respected: the personnal settings will override the site settings, and the site settings will override the default settings for the foam-extend CDash service hosted on SourceForge.net. --- CTestConfig.cmake | 12 ++++++++++++ .../3.2/CMakeFiles/CTestConfig.cmake.foam-extend | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 1190369a2..12f1b878e 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -6,6 +6,10 @@ ## ENABLE_TESTING() ## INCLUDE(CTest) +# These settings will allow you to publish your dashboards results +# on the foam-extend CDash service hosted on SourceForge.Net +# See here: http://foam-extend.sourceforge.net/CDash/index.php +# set(CTEST_PROJECT_NAME "foam-extend-3.2") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") @@ -13,3 +17,11 @@ set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "foam-extend.sourceforge.net") set(CTEST_DROP_LOCATION "/CDash/submit.php?project=foam-extend-3.2") set(CTEST_DROP_SITE_CDASH TRUE) + +# We can override those variables for local sites so you can use +# your own site CDash service +include($ENV{FOAM_SITE_DIR}/etc/CTestConfig.cmake OPTIONAL) + +# We can override those variables from user space so you can use +# your own personal CDash service +include($ENV{WM_PROJECT_USER_DIR}/etc/CTestConfig.cmake OPTIONAL) diff --git a/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend b/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend index 1190369a2..12f1b878e 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend +++ b/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend @@ -6,6 +6,10 @@ ## ENABLE_TESTING() ## INCLUDE(CTest) +# These settings will allow you to publish your dashboards results +# on the foam-extend CDash service hosted on SourceForge.Net +# See here: http://foam-extend.sourceforge.net/CDash/index.php +# set(CTEST_PROJECT_NAME "foam-extend-3.2") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") @@ -13,3 +17,11 @@ set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "foam-extend.sourceforge.net") set(CTEST_DROP_LOCATION "/CDash/submit.php?project=foam-extend-3.2") set(CTEST_DROP_SITE_CDASH TRUE) + +# We can override those variables for local sites so you can use +# your own site CDash service +include($ENV{FOAM_SITE_DIR}/etc/CTestConfig.cmake OPTIONAL) + +# We can override those variables from user space so you can use +# your own personal CDash service +include($ENV{WM_PROJECT_USER_DIR}/etc/CTestConfig.cmake OPTIONAL) From 346ef0f5f0ccca12470d492b95e6c025848a8e95 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Fri, 4 Sep 2015 10:20:31 -0400 Subject: [PATCH 04/33] testHarness: Choosing better names for the optional site and user CTestConfig.cmake files. Adding a comment about the expected locations for those 2 files. --- CTestConfig.cmake | 10 ++++++++-- .../3.2/CMakeFiles/CTestConfig.cmake.foam-extend | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 12f1b878e..84d537ace 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -20,8 +20,14 @@ set(CTEST_DROP_SITE_CDASH TRUE) # We can override those variables for local sites so you can use # your own site CDash service -include($ENV{FOAM_SITE_DIR}/etc/CTestConfig.cmake OPTIONAL) +# This optional file will be located here: +# $FOAM_SITE_DIR/etc/CTestConfig.site.cmake +# +include($ENV{FOAM_SITE_DIR}/etc/CTestConfig.site.cmake OPTIONAL) # We can override those variables from user space so you can use # your own personal CDash service -include($ENV{WM_PROJECT_USER_DIR}/etc/CTestConfig.cmake OPTIONAL) +# This optional file will be located here: +# $WM_PROJECT_USER_DIR/etc/CTestConfig.user.cmake +# +include($ENV{WM_PROJECT_USER_DIR}/etc/CTestConfig.user.cmake OPTIONAL) diff --git a/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend b/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend index 12f1b878e..84d537ace 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend +++ b/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend @@ -20,8 +20,14 @@ set(CTEST_DROP_SITE_CDASH TRUE) # We can override those variables for local sites so you can use # your own site CDash service -include($ENV{FOAM_SITE_DIR}/etc/CTestConfig.cmake OPTIONAL) +# This optional file will be located here: +# $FOAM_SITE_DIR/etc/CTestConfig.site.cmake +# +include($ENV{FOAM_SITE_DIR}/etc/CTestConfig.site.cmake OPTIONAL) # We can override those variables from user space so you can use # your own personal CDash service -include($ENV{WM_PROJECT_USER_DIR}/etc/CTestConfig.cmake OPTIONAL) +# This optional file will be located here: +# $WM_PROJECT_USER_DIR/etc/CTestConfig.user.cmake +# +include($ENV{WM_PROJECT_USER_DIR}/etc/CTestConfig.user.cmake OPTIONAL) From 1370279d73dc0e18e9d4997f1e6d05f99f228501 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sat, 5 Sep 2015 20:38:57 -0400 Subject: [PATCH 05/33] testHarness: For each test case, add a label from the name of the top most tutorial directories (eg: basic, incompressible, etc). We will use this label in order to categorize the various test cases under a more generic 'topic', so we can for instance limit the testharness to only the suite of 'compressible' test cases, etc., simply by using the ctest -L command. ctest --print-labels will print the list of all available labels. --- .../3.2/CMakeFiles/FOAM_Tutorials.cmake | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake index 4eadb09c2..7ba40d7fc 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake +++ b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake @@ -100,9 +100,22 @@ FOREACH(caseWithAllrun ${listofCasesWithAllrun}) MESSAGE("Adding test: ${testId}") ADD_TEST(${testId} bash -c "cd ${thisCasePath}; ./Allrun") + # We extract a label name from the top level tutorial directories + # (eg: basic, incompressible, immersedBoundary, etc). We will use this + # label in order to categorize the various test cases under a more 'generic + # topic', so we can for instance limit the testharness to the + # 'incompressible' test cases, etc., simply by using the ctest -L command. + # + # ctest --print-labels will print the list of all available labels. + # + string(REPLACE ${TEST_CASE_DIR}/ "" tmpLabel ${caseWithAllrun}) + string(FIND ${tmpLabel} "/" indexFirstSlash) + string(SUBSTRING ${tmpLabel} 0 ${indexFirstSlash} testLabel) + # Add a dependency on the global clean-up target # When running in parallel, you need to wait for the cleanup to finish first - SET_TESTS_PROPERTIES(${testId} PROPERTIES DEPENDS ${cleanCasesTestId} LABELS Tutorials) + message(" This test case will have the following labels: Tutorials, ${testLabel}") + SET_TESTS_PROPERTIES(${testId} PROPERTIES DEPENDS ${cleanCasesTestId} LABELS "Tutorials;${testLabel}") # Use this following entry instead for testing purpose #ADD_TEST(${testId} bash -c "cd ${thisCasePath}; true") From 4b1c7a2290287b1ff7278a02698f6dcf68d3f51b Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sat, 12 Sep 2015 16:55:45 -0400 Subject: [PATCH 06/33] testHarness: User guide for the testHarness in Org Mode --- doc/testHarness/Allrun | 6 + doc/testHarness/testHarness.org | 329 ++++++++++++++++++++++++++++++++ 2 files changed, 335 insertions(+) create mode 100644 doc/testHarness/Allrun create mode 100644 doc/testHarness/testHarness.org diff --git a/doc/testHarness/Allrun b/doc/testHarness/Allrun new file mode 100644 index 000000000..cfd473d82 --- /dev/null +++ b/doc/testHarness/Allrun @@ -0,0 +1,6 @@ +# Generate the ASCII version of testHarness.org +pandoc testHarness.org -N -s -S -f org -t asciidoc -o testHarness.txt + +# Generate the Mediawiki version of testHarness.org +pandoc testHarness.org -s -S -f org -t mediawiki -o testHarness.mediawiki + diff --git a/doc/testHarness/testHarness.org b/doc/testHarness/testHarness.org new file mode 100644 index 000000000..71dad5bc8 --- /dev/null +++ b/doc/testHarness/testHarness.org @@ -0,0 +1,329 @@ +# -*- mode: org; -*- +# +#+TITLE: *foam-extend-3.2: A guide to test harness* +#+AUTHOR: Martin Beaudoin +#+DATE: 5 September 2015 +#+LINK: foam-extend https://sourceforge.net/projects/openfoam-extend/ +#+OPTIONS: author:t +#+OPTIONS: toc:2 +#+OPTIONS: ^:{} +#+OPTIONS: _:{} + +############################################################################### + +* A guide to the foam-extend test harness +This file is a guide to the foam-extend test harness. + +The test harness from foam-extend version 3.2 was used as a reference +implementation for this documentation. + +The original version of this file is located at +$WM\_PROJECT\_DIR/doc/testHarness/testHarness.org. + +A plain text version of this file is located at +$WM\_PROJECT\_DIR/doc/testHarness/testHarness.txt. + +A MediaWiki version of this file is located at + +In case any converted versions (text, MediaWiki, etc.) of this file differ from +the original testHarness.org file, the latter should always be considered the +reference version. But we do appreciate your feedback and comments for improving +this text. + +For instance, if you ever decide to improve the Mediawiki version only, please +consider contributing your changes back to the testHarness.org file as +well. Otherwise, your Mediawiki changes might get overwritten by an updated +version of the .org reference file. + +** Introduction +The foam-extend test harness scripts are based mainly on Kitware CMake/CTest +utilities http://www.cmake.org/. + +In its current version, the test harness is designed for running the full suite +of foam-extend tutorials, and report the fail/success results to a CDash Web +service one can consult using a simple browser. + +The CDash Web service for foam-extend 3.2 is available here: +http://foam-extend.sourceforge.net/CDash/index.php + +For a quick introduction of CMake/CTest, see here: +http://www.cmake.org/Wiki/CMake/Testing_With_CTest + +For a more complete introduction to CMake and CTest, one can also refer to the +Kitware book `Mastering CMake: A Cross-Platform Build System` +http://www.kitware.com/products/books.php + +For more information on Kitware CDash, see here: http://www.cdash.org/ + +The rest of this document will provide suficient information so you can run the +foam-extend test harness on your own. + +** Files location and a short description +The foam-extend test harness is currently built from the following files: + +- =$WM_PROJECT_DIR/CMakeLists.txt= :: This is the main CMake file driving the + configuration of the test harness. When processed though the cmake + utility, all the necessary Makefiles and CTest scripts will get + generated. + +- =$WM_PROJECT_DIR/CTestConfig.cmake= :: This file contains the various variables + and definitions necessary to publish your test harness results over the + CDash Web service for foam-extend 3.2. + +- =$FOAM_SITE_DIR/etc/CTestConfig.site.cmake= :: This file allow you to override + the values from the main $WM\_PROJECT\_DIR/CTestConfig.cmake. This file + should be used if you are hosting your own site CDash Web + service. + +- =$WM_PROJECT_USER_DIR/etc/CTestConfig.user.cmake= :: This file allow you to + override the values from the main $WM\_PROJECT\_DIR/CTestConfig.cmake and the + site file $FOAM\_SITE\_DIR/etc/CTestConfig.site.cmake. This file should be + used if you are hosting your own user space personal CDash Web service. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt= :: + This file is a copy of the main $WM\_PROJECT\_DIR/CMakeLists.txt file. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend= :: This file is a copy of the main $WM\_PROJECT\_DIR/CTestConfig.cmake file. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/CMakeFiles/Dashboard_Tutorials.cmake.in= :: This file is a template for generating the file `ctest -S` file + $WM\_PROJECT\_DIR/testHarness/foam-extend/3.2/runDir/Dashboard\_Tutorials.cmake + CMake will take care of automatically generating the Dashboard\_Tutorials.cmake file. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake= :: This file will configure a copy the foam-extend tutorials for running + under the test harness. The copy will be made under + $WM\_PROJECT\_DIR/testHarness/foam-extend/3.2/runDir. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/runDir/Allclean= :: Cleanup + script. Will remove all the automatically generated files and directories + for the test harness. Should be called prior to running the Allrun\_\* scripts. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/runDir/Allrun_CMakeOnly= :: This + script will generate all the necessary files for running the test harness + on the foam-extend tutorials. One can then invoke `make help` to see all + the available make options. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/runDir/Allrun_Experimental= :: + Same script as `Allrun\_CMakeOnly`, but will also call `make + Experimental`. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/runDir/Allrun_Nightly= :: Same + script as `Allrun\_CMakeOnly`, but will also call `make Nightly`. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/scripts/AdditionalRunFunctions= :: Additional `bash` macros for the tutorial Allrun files. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/scripts/Allrun.default= :: + Default Allrun script for the tutorial when none are provided. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/scripts/addMissingAllrunFileToTutorial.sh= :: Bash script for adding a default Allrun file to the tutorials that do not + have one. The test harness only run tutorials with an existing Allrun file + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/scripts/prepareCasesForOneTimeStep.sh= :: This script will modify the test cases system/controlDict in order for the + case to run for only 1 time step + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/scripts/prepareCasesForTestHarness.sh= :: This script will modify the test cases Allrun file so it can run properly + under the test harness. + +** Configuring your $WM\_PROJECT\_DIR/etc/prefs.sh file for the test harness +The following environment variables are used for configuring the test harness: + +- =CDASH_SUBMIT_LOCAL_HOST_ID= :: System identifier for the FOAM CDash test harness + on foam-extend. By default, your system FQN/hostname will be used as the + system identifier when publishing your test harness results on the FOAM CDash + server on foam-extend. You can override your identifier using this environment + variable. + +- =CDASH_SCM_INFO= :: Buildname suffix for the FOAM CDash test harness on foam-extend. + By default, the git branch name and git revision number will be appended to the CDash build name. + Otherwise, for users not using git, or wanting to provide additionnal + information, simply initialize the CDASH\_SCM\_INFO with the proper information. + +- =WM_NCOMPPROCS= :: Specify the number of cores to use for the parallel execution + of the test harness. + +- =FOAM_TUTORIALS= :: Directory where the original test cases are located. For + foam-extend, this would be by default $WM\_PROJECT\_DIR/tutorials. + +** The main dashboards : Experimental, Nightly and Continuous +The result of a test run, reformatted for easy review, is called a +`dashboard`. A dashboard can be submitted to a central server, like CDash. Once +properly configured, the test harness will offer 3 main dashboards. + +- =Experimental= :: Will test the current state of the project. An experimental + submission can be performed at any time, usually interactively from the + current working copy of a developer. +- =Nightly= :: Is similar to Experimental, except that the source tree will be set + to the state it was in at a specific nightly time. This ensures that all + `nightly` submissions correspond to the state of the project at the same + point in time. `Nightly` builds are usually done automatically at a preset + time of day. Nightly build will also update your source code to the latest + available revision. So it is best not to run a Nightly dashboard on source + code that is not yet committed. +- =Continuous= :: Means that the source tree is updated to the latest revision, + and a build / test cycle is performed only if any files were actually + updated. Like `Nightly` builds, `Continuous` ones are usually done + automatically and repeatedly in intervals. + +There are also `intermediary dashboards` that allow you to select a specific +test harness intermediary step. The command `make help` will show you that list: + +#+BEGIN_SRC +... ContinuousBuild +... ContinuousConfigure +... ContinuousCoverage +... ContinuousMemCheck +... ContinuousStart +... ContinuousSubmit +... ContinuousTest +... ContinuousUpdate +... ExperimentalBuild +... ExperimentalConfigure +... ExperimentalCoverage +... ExperimentalMemCheck +... ExperimentalStart +... ExperimentalSubmit +... ExperimentalTest +... ExperimentalUpdate +... NightlyBuild +... NightlyConfigure +... NightlyCoverage +... NightlyMemCheck +... NightlyMemoryCheck +... NightlyStart +... NightlySubmit +... NightlyTest +... NightlyUpdate +#+END_SRC + +- Note :: For foam-extend, the MemCheck and Coverage dashboards are not supported. + +** Running the test harness + Running the test harness is pretty simple: + + These commands will configure and run the `Experimental` version of the test harness: + +#+BEGIN_SRC + cd $WM_PROJECT_DIR/testHarness/foam-extend/3.2/runDir + ./Allclean + ./Allrun_Experimental +#+END_SRC + + To run the `Nightly` version of the test harness: + +#+BEGIN_SRC + cd $WM_PROJECT_DIR/testHarness/foam-extend/3.2/runDir + ./Allclean + ./Allrun_Nightly +#+END_SRC + + To see the full range of available options, run the command: + +#+BEGIN_SRC +make help +#+END_SRC + +** Selecting a subset of test cases to run +Instead of using the `make` command to run the test harness, one can also use +command `ctest`. The commmand `ctest` offers additionnal options to select or limit the number +of tests to run. + +The following command will provide all the available options for ctest: + +#+BEGIN_SRC +ctest -N +#+END_SRC + +Here is a list of useful ctest options: + +- =ctest -N= :: this command will list the available tests by their name and + number. By default, all the tests are run in succession following the + numerical order shown. + +- =ctest -R = :: run all the tests whose name are matching the supplied + regular expression. For instance, to run all the tests related to cfMesh, + one can use the following command: `ctest -R cfMesh` + +- =ctest -E = :: run all the tests, but exclude the ones whose name is + matching the supplied regular expression. For instance, to run all the + tests except those for cfMesh, one can use the following command: `ctest -E + cfMesh` + +- =ctest -I [Start,End,Stride,test#,test#]= :: run individual tests by + number. `ctest -I 3,5` will run test 3, 4 and 5. `ctest -I 4,4,,4,7,13` + will run tests 4, 7 and 13. + +- =ctest -D dashboard= :: run a specific dashboard test. For example, the command + `make Experimental` can be replaced by the following suite of ctest + commands: +#+BEGIN_SRC +ctest -D ExperimentalStart +ctest -D ExperimentalConfigure +ctest -D ExperimentalBuild +ctest -D ExperimentalTest +ctest -D ExperimentalSubmit +#+END_SRC + +Here is a more complete example where we will configure, build, test and submit the test +harness results, but only for the incompressible tutorials: +#+BEGIN_SRC +ctest -D Experimental -R incompressible +#+END_SRC + + +** Browsing the CDash service + + The results of the test harness run will be published on the CDash dashboard on foam-extend. + + To see your results: + URL : http://foam-extend.sourceforge.net/CDash/index.php?project=foam-extend-3.2 + + On this interactive Web site, one can then point and click various buttons + and menus to explore the various reports uploaded from your test harness runs. + +** Configuring the test harness for using your own site or personal CDash service +The foam-extend source code comes with a set pre-configured parameters for +uploading your dashboards results on the main project CDash server. One can also +choose to host their own CDash service, either as a site service, or as a +personnal service running in your own user space. Your CDash administrator can +generate a file similar to $WM\_PROJECT\_DIR/CTestConfig.cmake where all the +necessary parameters for connecting to your local service are specified. + +In order to use your site CDash service, simply copy your site CTestConfig.cmake +file to $FOAM\_SITE\_DIR/etc/CTestConfig.site.cmake + +In order to use your personnal CDash service, simply copy your personnal CTestConfig.cmake +file to $WM\_PROJECT\_USER\_DIR/etc/CTestConfig.user.cmake + +As usual, your site configuration will override the default parameters from the +main configuration file $WM\_PROJECT\_DIR/CTestConfig.cmake. + +Likewise, your personnal configuration will override the default parameters from the +main configuration file $WM\_PROJECT\_DIR/CTestConfig.cmake and the default +parameters from the site file $FOAM\_SITE\_DIR/etc/CTestConfig.site.cmake. + + +** New features for the test harness (foam-extend 3.2): + - =Running the test harness in parallel= :: It is now possible to run the test + harness in parallel over a single node or computer. The environment + variable WM\_NCOMPPROCS will specify the number of cores to use for + running the test harness. For `n` cores specified, `n` tutorials will + be running in parallel on your computer. Since all the tests will + still run on the same computer, make sure you have enough ressources to + run `n` tutorials in parallel. Depending on the number of cores + available, one might have to tweak some of the shell `limits` + values. The command `ulimit -a` will show you the actual limits values + imposed on your shell. Some limit values like `open files` (ulimit -n) + or `max user processes` (ulimit -u) might need to be adjusted to some + higher values. In doubt, consult with your local sysadmin. + +** Notes +The MediaWiki version of this file was generated using the following command: + +#+BEGIN_SRC + pandoc testHarness.org -s -S -f org -t mediawiki -o testHarness.mediawiki +#+END_SRC + +The ASCII version of this file was generated using the following command: + +#+BEGIN_SRC + pandoc testHarness.org -N -s -S -f org -t asciidoc -o testHarness.txt +#+END_SRC From 1899be993a8e0c03013474458a731a19c46b60f4 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sat, 12 Sep 2015 17:12:41 -0400 Subject: [PATCH 07/33] testHarness: improving the documentation for the test harness --- doc/testHarness/testHarness.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/testHarness/testHarness.org b/doc/testHarness/testHarness.org index 71dad5bc8..ff41b2c66 100644 --- a/doc/testHarness/testHarness.org +++ b/doc/testHarness/testHarness.org @@ -124,7 +124,9 @@ The foam-extend test harness is currently built from the following files: under the test harness. ** Configuring your $WM\_PROJECT\_DIR/etc/prefs.sh file for the test harness -The following environment variables are used for configuring the test harness: +The following environment variables are used for configuring the test +harness. You should use your $WM\_PROJECT\_DIR/etc/prefs.sh file to initialize +these variables. - =CDASH_SUBMIT_LOCAL_HOST_ID= :: System identifier for the FOAM CDash test harness on foam-extend. By default, your system FQN/hostname will be used as the From 3969b94747ee6bae0486cde4f59e102d0b5f7be7 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Tue, 15 Sep 2015 17:24:30 -0400 Subject: [PATCH 08/33] testHarness: add FOAM_TEST_HARNESS_DIR environment variable --- etc/settings.csh | 1 + etc/settings.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/etc/settings.csh b/etc/settings.csh index 31c46d8cd..f752c2e48 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -65,6 +65,7 @@ setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials setenv FOAM_UTILITIES $FOAM_APP/utilities setenv FOAM_SOLVERS $FOAM_APP/solvers setenv FOAM_RUN $WM_PROJECT_USER_DIR/run +setenv FOAM_TEST_HARNESS_DIR $WM_PROJECT_DIR/testHarness/foam-extend/$WM_PROJECT_VERSION # add FOAM scripts and wmake to the path set path=($WM_DIR $WM_PROJECT_DIR/bin $path) diff --git a/etc/settings.sh b/etc/settings.sh index 90bce6e96..28a78bd8b 100755 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -103,6 +103,7 @@ export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials export FOAM_UTILITIES=$FOAM_APP/utilities export FOAM_SOLVERS=$FOAM_APP/solvers export FOAM_RUN=$WM_PROJECT_USER_DIR/run +export FOAM_TEST_HARNESS_DIR=$WM_PROJECT_DIR/testHarness/foam-extend/$WM_PROJECT_VERSION # add FOAM scripts and wmake to the path export PATH=$WM_DIR:$WM_PROJECT_DIR/bin:$PATH From 851d14e5ed870ac7b4c945186155dd7ac0663fe0 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Tue, 15 Sep 2015 20:47:54 -0400 Subject: [PATCH 09/33] testHarness: improved CTest coding. Adjustments for the Windows port. --- CMakeLists.txt | 151 ++++++++++++++---- .../foam-extend/3.2/CMakeFiles/CMakeLists.txt | 151 ++++++++++++++---- .../3.2/CMakeFiles/FOAM_Tutorials.cmake | 8 +- 3 files changed, 252 insertions(+), 58 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a3d35b6df..a67a33006 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,117 @@ cmake_minimum_required (VERSION 2.8) PROJECT(foam-extend-3.2) #----------------------------------------------------------------------------- +# Utility functions +# +# GetHostName(var) +# +# Set the variable named ${var} to the host hostname +# +function(GetHostName var) + set( thisHostName "unknown") + + if(CMAKE_HOST_WIN32) + execute_process( + COMMAND hostname + OUTPUT_VARIABLE thisHostname + ) + else() + execute_process( + COMMAND hostname -f + OUTPUT_VARIABLE thisHostname + ) + endif() + set(${var} ${thisHostname} PARENT_SCOPE) +endfunction() + +# +# GetGitStatus(status ecode) +# +# Get the git status for the local git repository of the source code +# The variable named ${status} will get the git status +# The variable named ${ecode} will get the command error code +# +function(GetGitStatus _status _ecode) + set( git_status "unknown") + set( git_ecode "1") + + execute_process( + COMMAND git status + WORKING_DIRECTORY ${FOAM_ROOT} + OUTPUT_VARIABLE git_status + RESULT_VARIABLE git_ecode + ERROR_QUIET + ) + set(${_status} ${git_status} PARENT_SCOPE) + set(${_ecode} ${git_ecode} PARENT_SCOPE) +endfunction() + +# +# GetGitBranchName(var) +# +# Set the variable named ${var} to the git branch name of the source code +# +function(GetGitBranchName var) + set( retValue "unknown") + + execute_process( + COMMAND git branch --no-color + WORKING_DIRECTORY ${FOAM_ROOT} + OUTPUT_VARIABLE listOfGitBranches + ) + # Create list of strings + string(REPLACE "\n" ";" listOfGitBranches ${listOfGitBranches}) + + # Iterate over list, find the string beginning with "* " + foreach(branch ${listOfGitBranches}) + string(REGEX MATCH "\\* .*$" matchString ${branch}) + string(LENGTH "${matchString}" lengthMatchString) + if(lengthMatchString GREATER 0) + # We have match. Cleanup and set retValue + string(REPLACE "* " "" retValue ${matchString}) + endif() + endforeach() + + set(${var} ${retValue} PARENT_SCOPE) +endfunction() + +# +# GetGitRevNumber(var) +# +# Set the variable named ${var} to the git revision number of the source code +# +function(GetGitRevNumber var) + set( retValue "unknown") + + execute_process( + COMMAND git rev-parse --short=12 HEAD + WORKING_DIRECTORY ${FOAM_ROOT} + OUTPUT_VARIABLE git_rev_number + ) + + # Minimal check that we do have a valid string + string(LENGTH "${git_rev_number}" lengthString) + if(lengthString GREATER 0) + set(retValue ${git_rev_number}) + endif() + + set(${var} ${retValue} PARENT_SCOPE) +endfunction() + +# CleanUpStringForCDash(var) +# +# Cleanup the variable named ${value} for characters not supported +# for CDash identifiers. Return the modified value in retVar +# +function(CleanUpStringForCDash value retVar) + string(REPLACE "/" "_" value "${value}") + string(REPLACE " " "_" value ${value}) + set(${retVar} ${value} PARENT_SCOPE) +endfunction() + +#----------------------------------------------------------------------------- +# +# # Initialization of CTest specific variables # ## Run ctest in parallel if environment variable WM_NCOMPPROCS is set @@ -57,13 +168,11 @@ IF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "") SITENAME $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} CACHE STRING "Name of the local site" ) -ELSE (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "") +ELSE () # Grab the hostname FQN; will be used for the sitename - execute_process( - COMMAND hostname -f - OUTPUT_VARIABLE SITENAME - ) -ENDIF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "") + GetHostName(SITENAME) + +ENDIF() MESSAGE("Initializing the name of this local site to: ${SITENAME}") @@ -146,27 +255,15 @@ elseif(GIT_FOUND) message("The git command was found: ${GIT_EXECUTABLE}") # Check if the source code is under a valid git repository - execute_process( - COMMAND git status - WORKING_DIRECTORY ${FOAM_ROOT} - OUTPUT_VARIABLE GIT_STATUS - RESULT_VARIABLE GIT_ECODE - ERROR_QUIET - ) + GetGitStatus(GIT_STATUS GIT_ECODE) if(NOT GIT_ECODE) - # We have a valid git repository. Grab the branch and revision info. - # Add to the build name - exec_program(git - ARGS branch --no-color 2> /dev/null | grep '*'| awk '{print $2}' - OUTPUT_VARIABLE GIT_BRANCH_NAME - ) + # We have a valid git repository. + # Grab the branch and revision info. Add to the build name + GetGitBranchName(GIT_BRANCH_NAME) message("Git branch: ${GIT_BRANCH_NAME}") - execute_process( - COMMAND git rev-parse --short=12 HEAD - OUTPUT_VARIABLE GIT_REV_NUMBER - ) + GetGitRevNumber(GIT_REV_NUMBER) message("Git revision: ${GIT_REV_NUMBER}") SET(BUILDNAME "${BUILDNAME}-git-branch=${GIT_BRANCH_NAME}") @@ -216,13 +313,13 @@ endif() # Some last minute cleanup # Seems like no '/' or ' 'are allowed in the BUILDNAME or in the SITE name -string(REPLACE "/" "_" BUILDNAME ${BUILDNAME}) -string(REPLACE " " "_" BUILDNAME ${BUILDNAME}) -string(REPLACE "/" "_" SITE ${SITE}) -string(REPLACE " " "_" SITE ${SITE}) +CleanUpStringForCDash(${BUILDNAME} BUILDNAME) +CleanUpStringForCDash(${SITE} SITE) message("Build name: ${BUILDNAME}") +message("Site name: ${SITE}") +# # Build section #----------------------------------------------------------------------------- diff --git a/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt b/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt index a3d35b6df..a67a33006 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt +++ b/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt @@ -39,6 +39,117 @@ cmake_minimum_required (VERSION 2.8) PROJECT(foam-extend-3.2) #----------------------------------------------------------------------------- +# Utility functions +# +# GetHostName(var) +# +# Set the variable named ${var} to the host hostname +# +function(GetHostName var) + set( thisHostName "unknown") + + if(CMAKE_HOST_WIN32) + execute_process( + COMMAND hostname + OUTPUT_VARIABLE thisHostname + ) + else() + execute_process( + COMMAND hostname -f + OUTPUT_VARIABLE thisHostname + ) + endif() + set(${var} ${thisHostname} PARENT_SCOPE) +endfunction() + +# +# GetGitStatus(status ecode) +# +# Get the git status for the local git repository of the source code +# The variable named ${status} will get the git status +# The variable named ${ecode} will get the command error code +# +function(GetGitStatus _status _ecode) + set( git_status "unknown") + set( git_ecode "1") + + execute_process( + COMMAND git status + WORKING_DIRECTORY ${FOAM_ROOT} + OUTPUT_VARIABLE git_status + RESULT_VARIABLE git_ecode + ERROR_QUIET + ) + set(${_status} ${git_status} PARENT_SCOPE) + set(${_ecode} ${git_ecode} PARENT_SCOPE) +endfunction() + +# +# GetGitBranchName(var) +# +# Set the variable named ${var} to the git branch name of the source code +# +function(GetGitBranchName var) + set( retValue "unknown") + + execute_process( + COMMAND git branch --no-color + WORKING_DIRECTORY ${FOAM_ROOT} + OUTPUT_VARIABLE listOfGitBranches + ) + # Create list of strings + string(REPLACE "\n" ";" listOfGitBranches ${listOfGitBranches}) + + # Iterate over list, find the string beginning with "* " + foreach(branch ${listOfGitBranches}) + string(REGEX MATCH "\\* .*$" matchString ${branch}) + string(LENGTH "${matchString}" lengthMatchString) + if(lengthMatchString GREATER 0) + # We have match. Cleanup and set retValue + string(REPLACE "* " "" retValue ${matchString}) + endif() + endforeach() + + set(${var} ${retValue} PARENT_SCOPE) +endfunction() + +# +# GetGitRevNumber(var) +# +# Set the variable named ${var} to the git revision number of the source code +# +function(GetGitRevNumber var) + set( retValue "unknown") + + execute_process( + COMMAND git rev-parse --short=12 HEAD + WORKING_DIRECTORY ${FOAM_ROOT} + OUTPUT_VARIABLE git_rev_number + ) + + # Minimal check that we do have a valid string + string(LENGTH "${git_rev_number}" lengthString) + if(lengthString GREATER 0) + set(retValue ${git_rev_number}) + endif() + + set(${var} ${retValue} PARENT_SCOPE) +endfunction() + +# CleanUpStringForCDash(var) +# +# Cleanup the variable named ${value} for characters not supported +# for CDash identifiers. Return the modified value in retVar +# +function(CleanUpStringForCDash value retVar) + string(REPLACE "/" "_" value "${value}") + string(REPLACE " " "_" value ${value}) + set(${retVar} ${value} PARENT_SCOPE) +endfunction() + +#----------------------------------------------------------------------------- +# +# # Initialization of CTest specific variables # ## Run ctest in parallel if environment variable WM_NCOMPPROCS is set @@ -57,13 +168,11 @@ IF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "") SITENAME $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} CACHE STRING "Name of the local site" ) -ELSE (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "") +ELSE () # Grab the hostname FQN; will be used for the sitename - execute_process( - COMMAND hostname -f - OUTPUT_VARIABLE SITENAME - ) -ENDIF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "") + GetHostName(SITENAME) + +ENDIF() MESSAGE("Initializing the name of this local site to: ${SITENAME}") @@ -146,27 +255,15 @@ elseif(GIT_FOUND) message("The git command was found: ${GIT_EXECUTABLE}") # Check if the source code is under a valid git repository - execute_process( - COMMAND git status - WORKING_DIRECTORY ${FOAM_ROOT} - OUTPUT_VARIABLE GIT_STATUS - RESULT_VARIABLE GIT_ECODE - ERROR_QUIET - ) + GetGitStatus(GIT_STATUS GIT_ECODE) if(NOT GIT_ECODE) - # We have a valid git repository. Grab the branch and revision info. - # Add to the build name - exec_program(git - ARGS branch --no-color 2> /dev/null | grep '*'| awk '{print $2}' - OUTPUT_VARIABLE GIT_BRANCH_NAME - ) + # We have a valid git repository. + # Grab the branch and revision info. Add to the build name + GetGitBranchName(GIT_BRANCH_NAME) message("Git branch: ${GIT_BRANCH_NAME}") - execute_process( - COMMAND git rev-parse --short=12 HEAD - OUTPUT_VARIABLE GIT_REV_NUMBER - ) + GetGitRevNumber(GIT_REV_NUMBER) message("Git revision: ${GIT_REV_NUMBER}") SET(BUILDNAME "${BUILDNAME}-git-branch=${GIT_BRANCH_NAME}") @@ -216,13 +313,13 @@ endif() # Some last minute cleanup # Seems like no '/' or ' 'are allowed in the BUILDNAME or in the SITE name -string(REPLACE "/" "_" BUILDNAME ${BUILDNAME}) -string(REPLACE " " "_" BUILDNAME ${BUILDNAME}) -string(REPLACE "/" "_" SITE ${SITE}) -string(REPLACE " " "_" SITE ${SITE}) +CleanUpStringForCDash(${BUILDNAME} BUILDNAME) +CleanUpStringForCDash(${SITE} SITE) message("Build name: ${BUILDNAME}") +message("Site name: ${SITE}") +# # Build section #----------------------------------------------------------------------------- diff --git a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake index 7ba40d7fc..9fd8d7134 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake +++ b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake @@ -90,14 +90,14 @@ FOREACH(caseWithAllrun ${listofCasesWithAllrun}) MESSAGE("Found Allrun file in directory: ${thisCasePath}") # Grab the parent name of the case directory - string(REPLACE ${TEST_CASE_DIR}/ "" caseParentPath ${caseWithAllrun}) + string(REPLACE ${TEST_CASE_DIR}/ "" caseParentPath ${thisCasePath}) # Construct the testId string(REPLACE "/" "_" testId ${caseParentPath}) - SET(testId ${testId}${testIdSuffix}) + SET(testId ${testId}_Allrun${testIdSuffix}) # Add the test to the test harness - MESSAGE("Adding test: ${testId}") + MESSAGE(" Adding test: ${testId}") ADD_TEST(${testId} bash -c "cd ${thisCasePath}; ./Allrun") # We extract a label name from the top level tutorial directories @@ -120,7 +120,7 @@ FOREACH(caseWithAllrun ${listofCasesWithAllrun}) # Use this following entry instead for testing purpose #ADD_TEST(${testId} bash -c "cd ${thisCasePath}; true") - ENDIF(NOT ${thisCasePath} STREQUAL ${TEST_CASE_DIR}) + ENDIF() ENDFOREACH(caseWithAllrun) # Modify the cases Allrun files to incorporate additional shell functions From 6e7926a6f4e317d169d4f9caee91109648b281f9 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Tue, 15 Sep 2015 22:44:47 -0400 Subject: [PATCH 10/33] testHarness: adjusting the Makefile generator for cmake on Windows --- testHarness/foam-extend/3.2/runDir/Allrun_CMakeOnly | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/testHarness/foam-extend/3.2/runDir/Allrun_CMakeOnly b/testHarness/foam-extend/3.2/runDir/Allrun_CMakeOnly index af4dcab18..91117a1f9 100755 --- a/testHarness/foam-extend/3.2/runDir/Allrun_CMakeOnly +++ b/testHarness/foam-extend/3.2/runDir/Allrun_CMakeOnly @@ -73,7 +73,12 @@ fi # Make sure the CMake and tutorials runtime files are updated # We need cmake version 2.8.0 at least -cmake $WM_PROJECT_DIR +if [ "$WM_ARCH_BASE" == "mingw" ] +then + cmake $WM_PROJECT_DIR -G "MSYS Makefiles" +else + cmake $WM_PROJECT_DIR -G "Unix Makefiles" +fi # All set. Now we can run the available test harness # From 3659d131e6e41176e693f96c297c7be178917beb Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Wed, 16 Sep 2015 09:27:34 -0400 Subject: [PATCH 11/33] testHarness: adjusting the ctest command invocation for scripts under Windows/Mingw --- CMakeLists.txt | 10 ++++++- .../foam-extend/3.2/CMakeFiles/CMakeLists.txt | 10 ++++++- .../3.2/CMakeFiles/FOAM_Tutorials.cmake | 29 ++++++++++++++----- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a67a33006..f8aa0cffa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -379,10 +379,18 @@ IF(BUILD_TESTING) IF(RUN_FROM_ONE_TIMESTEP) # Modify the cases controlDict file in order to run for only one time step MESSAGE("${testRunTimeDirectory}: Modifying the controlDict files for running only one time step in directory: ${TEST_CASE_DIR}") - EXECUTE_PROCESS( + if(CMAKE_HOST_WIN32) + # Need to supply a bash shell to run the script under Windows + EXECUTE_PROCESS( + COMMAND bash -c "$ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR}" + WORKING_DIRECTORY . + ) + else() + EXECUTE_PROCESS( COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR} WORKING_DIRECTORY . ) + endif() ENDIF(RUN_FROM_ONE_TIMESTEP) ENDIF(BUILD_TESTING) diff --git a/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt b/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt index a67a33006..f8aa0cffa 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt +++ b/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt @@ -379,10 +379,18 @@ IF(BUILD_TESTING) IF(RUN_FROM_ONE_TIMESTEP) # Modify the cases controlDict file in order to run for only one time step MESSAGE("${testRunTimeDirectory}: Modifying the controlDict files for running only one time step in directory: ${TEST_CASE_DIR}") - EXECUTE_PROCESS( + if(CMAKE_HOST_WIN32) + # Need to supply a bash shell to run the script under Windows + EXECUTE_PROCESS( + COMMAND bash -c "$ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR}" + WORKING_DIRECTORY . + ) + else() + EXECUTE_PROCESS( COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR} WORKING_DIRECTORY . ) + endif() ENDIF(RUN_FROM_ONE_TIMESTEP) ENDIF(BUILD_TESTING) diff --git a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake index 9fd8d7134..088f09211 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake +++ b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake @@ -53,11 +53,18 @@ file(COPY $ENV{FOAM_TUTORIALS}/ DESTINATION ${TEST_CASE_DIR}) # The test harness relies on the presence of an Allrun file for # running the case MESSAGE("${testRunTimeDirectory}: Checking for missing Allrun file in tutorials") -EXECUTE_PROCESS( +if(CMAKE_HOST_WIN32) + # Need to supply a bash shell to run the script under Windows + EXECUTE_PROCESS( + COMMAND bash -c "$ENV{FOAM_TEST_HARNESS_DIR}/scripts/addMissingAllrunFileToTutorial.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/Allrun.default" + WORKING_DIRECTORY . + ) +else() + EXECUTE_PROCESS( COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/addMissingAllrunFileToTutorial.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/Allrun.default WORKING_DIRECTORY . ) - +endif() # Iterate over each tutorial case: # We are looking for tutorial cases with an Allrun file. # If this file is present, (and it should), we add this case to the list of cases to run. @@ -100,10 +107,10 @@ FOREACH(caseWithAllrun ${listofCasesWithAllrun}) MESSAGE(" Adding test: ${testId}") ADD_TEST(${testId} bash -c "cd ${thisCasePath}; ./Allrun") - # We extract a label name from the top level tutorial directories - # (eg: basic, incompressible, immersedBoundary, etc). We will use this + # We extract a label name from the top level tutorial directories + # (eg: basic, incompressible, immersedBoundary, etc). We will use this # label in order to categorize the various test cases under a more 'generic - # topic', so we can for instance limit the testharness to the + # topic', so we can for instance limit the testharness to the # 'incompressible' test cases, etc., simply by using the ctest -L command. # # ctest --print-labels will print the list of all available labels. @@ -125,10 +132,18 @@ ENDFOREACH(caseWithAllrun) # Modify the cases Allrun files to incorporate additional shell functions MESSAGE("${testRunTimeDirectory}: Modifying the Allrun files for additional shell functions in directory: ${TEST_CASE_DIR}") -EXECUTE_PROCESS( +if(CMAKE_HOST_WIN32) + # Need to supply a bash shell to run the script under Windows + EXECUTE_PROCESS( + COMMAND bash -c "$ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForTestHarness.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/AdditionalRunFunctions" + WORKING_DIRECTORY . + ) +else() + EXECUTE_PROCESS( COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForTestHarness.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/AdditionalRunFunctions WORKING_DIRECTORY . ) +endif() # Configure the various ctest -S Dashboard drivers @@ -137,6 +152,6 @@ configure_file( "$ENV{FOAM_TEST_HARNESS_DIR}/CMakeFiles/Dashboard_Tutorials.cmake.in" "$ENV{FOAM_TEST_HARNESS_DIR}/runDir/Dashboard_Tutorials.cmake" @ONLY) - + # That's it. From d84216bdbc243013be26ae94fc4d372dd53afcdb Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sun, 20 Sep 2015 22:38:04 -0400 Subject: [PATCH 12/33] wmake: correcting dependencies syntax in .dep files on Windows --- wmake/scripts/addCompile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wmake/scripts/addCompile b/wmake/scripts/addCompile index 6dd3ba40f..54c1e0577 100755 --- a/wmake/scripts/addCompile +++ b/wmake/scripts/addCompile @@ -47,13 +47,13 @@ fi if [ "$WM_PROJECT_DIR" ] then - sed -e s%$WM_PROJECT_DIR%'$(WM_PROJECT_DIR)'% > $depName + sed -e s%:.*$WM_PROJECT_DIR%': $(WM_PROJECT_DIR)'% > $depName else cat > $depName fi sed -e s%".*.o.*:"%'$(OBJECTS_DIR)/'"$objectName\:"% \ - -e s%$WM_PROJECT_DIR%'$(WM_PROJECT_DIR)'% \ + -e s%:.*$WM_PROJECT_DIR%': $(WM_PROJECT_DIR)'% \ >> $depName echo '$(OBJECTS_DIR)/'$objectName': $(EXE_DEP)' >> $depName From 723023562125f8380a622cf4a3ec2627e2ffcb00 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sun, 20 Sep 2015 22:47:05 -0400 Subject: [PATCH 13/33] testHarness: adjusting the Makefile generator for cmake on Windows --- testHarness/foam-extend/3.2/runDir/Allrun_Experimental | 7 ++++++- testHarness/foam-extend/3.2/runDir/Allrun_Nightly | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/testHarness/foam-extend/3.2/runDir/Allrun_Experimental b/testHarness/foam-extend/3.2/runDir/Allrun_Experimental index 21bba0a29..186882d09 100755 --- a/testHarness/foam-extend/3.2/runDir/Allrun_Experimental +++ b/testHarness/foam-extend/3.2/runDir/Allrun_Experimental @@ -79,7 +79,12 @@ fi # Make sure the CMake and tutorials runtime files are updated # We need cmake version 2.8.0 at least -cmake $WM_PROJECT_DIR +if [ "$WM_ARCH_BASE" == "mingw" ] +then + cmake $WM_PROJECT_DIR -G "MSYS Makefiles" +else + cmake $WM_PROJECT_DIR -G "Unix Makefiles" +fi # All set. Now we can run the available test harness # diff --git a/testHarness/foam-extend/3.2/runDir/Allrun_Nightly b/testHarness/foam-extend/3.2/runDir/Allrun_Nightly index ed5825517..a21748e7c 100755 --- a/testHarness/foam-extend/3.2/runDir/Allrun_Nightly +++ b/testHarness/foam-extend/3.2/runDir/Allrun_Nightly @@ -79,7 +79,12 @@ fi # Make sure the CMake and tutorials runtime files are updated # We need cmake version 2.8.0 at least -cmake $WM_PROJECT_DIR +if [ "$WM_ARCH_BASE" == "mingw" ] +then + cmake $WM_PROJECT_DIR -G "MSYS Makefiles" +else + cmake $WM_PROJECT_DIR -G "Unix Makefiles" +fi # All set. Now we can run the available test harness # From f5816ce3459101d5209d30f5dfbc8f8812d1648a Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Thu, 3 Sep 2015 12:26:04 -0400 Subject: [PATCH 14/33] testHarness: adding support for CDash/CTest subprojects --- .../CMakeFiles/Dashboard_Tutorials.cmake.in | 104 ++++++++++++++++++ .../3.2/CMakeFiles/FOAM_Tutorials.cmake | 11 +- .../3.2/runDir/Allrun_Experimental | 13 ++- .../foam-extend/3.2/runDir/Allrun_Nightly | 15 ++- 4 files changed, 133 insertions(+), 10 deletions(-) create mode 100644 testHarness/foam-extend/3.2/CMakeFiles/Dashboard_Tutorials.cmake.in diff --git a/testHarness/foam-extend/3.2/CMakeFiles/Dashboard_Tutorials.cmake.in b/testHarness/foam-extend/3.2/CMakeFiles/Dashboard_Tutorials.cmake.in new file mode 100644 index 000000000..94794f715 --- /dev/null +++ b/testHarness/foam-extend/3.2/CMakeFiles/Dashboard_Tutorials.cmake.in @@ -0,0 +1,104 @@ +# /*-------------------------------------------------------------------------*\ +# ========= | +# \\ / F ield | foam-extend: Open Source CFD +# \\ / O peration | +# \\ / A nd | For copyright notice see file Copyright +# \\/ M anipulation | +# ----------------------------------------------------------------------------- +# License +# This file is part of foam-extend. +# +# foam-extend 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. +# +# foam-extend 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 foam-extend. If not, see . +# +# Description +# "ctest -S" script configured to drive the Experimental, Nightly and +# Continuous dashboards for the FOAM tutorials +# +# Author +# Martin Beaudoin, Hydro-Quebec, 2015. All rights reserved +# +# \*-------------------------------------------------------------------------*/ +# +set(THIS_SUBPROJECT "Tutorials") +set(CTEST_SOURCE_DIRECTORY $ENV{WM_PROJECT_DIR}) +set(CTEST_BINARY_DIRECTORY "@binary_dir@") +set(CTEST_BUILD_NAME "@BUILDNAME@") +set(CTEST_SITE "@SITE@") +set(PROCESSOR_COUNT $ENV{WM_NCOMPPROCS}) +set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + +# We add the current script as a Build note. +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +# Run in parallel +if(PROCESSOR_COUNT) + set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}") +endif() + + +# We will be using a CDash subproject if the required subproject is defined +# on the remote CDash server. +# Otherwise, the results will still get submitted, but under the global +# "Project" Dashboard, not under the "SubProjects" section. +# This way, we keep on supporting CDash sites where subprojects are +# still not defined. + +# Get the CTEST_PROJECT_SUBPROJECTS definition: +include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake) + +list(FIND CTEST_PROJECT_SUBPROJECTS ${THIS_SUBPROJECT} subProjectIsSupported) + +if (NOT subProjectIsSupported EQUAL -1) + message("Dashboard: Using SubProject: ${THIS_SUBPROJECT}") + set_property(GLOBAL PROPERTY SubProject ${THIS_SUBPROJECT}) + set_property(GLOBAL PROPERTY Label ${THIS_SUBPROJECT}) +endif() + +# Select the required model : Experimental, Nightly, Continuous +# Default model: Experimental +set(DASHBOARD_MODEL Experimental) +if(${CTEST_SCRIPT_ARG} MATCHES Nightly) + set(DASHBOARD_MODEL Nightly) +elseif(${CTEST_SCRIPT_ARG} MATCHES Continuous) + set(DASHBOARD_MODEL Continuous) +endif() + +# Starting the various tests for the specified dashboard model +ctest_start(${DASHBOARD_MODEL}) + +# No need to configure, cmake took care of it already +#ctest_configure() + + +# Intentionally no ctest_update() step in this script when running the +# Experimental dashboard. +# We do not want the source code to get updated since we actually want to test +# the current instance of this source code. So we can test without having to +# commit the source code + +if(${DASHBOARD_MODEL} MATCHES Experimental) + message("Experimental dashboard: We skip the repository update.") +else() + # Updating the repository for the Nightly and Continuous dashboards + ctest_update() +endif() + +# We compile the source code +ctest_build() + +# We run the tests +ctest_test() + +# We submit the results to the CDash service +ctest_submit() diff --git a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake index e5831b535..4eadb09c2 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake +++ b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake @@ -102,7 +102,7 @@ FOREACH(caseWithAllrun ${listofCasesWithAllrun}) # Add a dependency on the global clean-up target # When running in parallel, you need to wait for the cleanup to finish first - SET_TESTS_PROPERTIES(${testId} PROPERTIES DEPENDS ${cleanCasesTestId}) + SET_TESTS_PROPERTIES(${testId} PROPERTIES DEPENDS ${cleanCasesTestId} LABELS Tutorials) # Use this following entry instead for testing purpose #ADD_TEST(${testId} bash -c "cd ${thisCasePath}; true") @@ -117,4 +117,13 @@ EXECUTE_PROCESS( WORKING_DIRECTORY . ) +# Configure the various ctest -S Dashboard drivers + +# Driver for the tutorials +configure_file( + "$ENV{FOAM_TEST_HARNESS_DIR}/CMakeFiles/Dashboard_Tutorials.cmake.in" + "$ENV{FOAM_TEST_HARNESS_DIR}/runDir/Dashboard_Tutorials.cmake" + @ONLY) + + # That's it. diff --git a/testHarness/foam-extend/3.2/runDir/Allrun_Experimental b/testHarness/foam-extend/3.2/runDir/Allrun_Experimental index 4f529c2c1..21bba0a29 100755 --- a/testHarness/foam-extend/3.2/runDir/Allrun_Experimental +++ b/testHarness/foam-extend/3.2/runDir/Allrun_Experimental @@ -86,11 +86,16 @@ cmake $WM_PROJECT_DIR # Invoke make help for the complete list of available commands. # # User-demand testing. -# Will do: ExperimentalConfigure + ExperimentalBuild + ExperimentalTest + ExperimentalSubmit -make Experimental - +# +# The old way. Still valid, but not supporting subprojects +# Will do: ExperimentalBuild + ExperimentalTest + ExperimentalSubmit +#make Experimental +# # Nightly testing -# Will do: NightlyUpdate + NightylConfigure + NightlyBuild + NightlyTest + NightlySubmit +# Will do: NightlyUpdate + NightlyBuild + NightlyTest + NightlySubmit # make Nightly +# The new way. With support for subprojects +ctest -V -S ./Dashboard_Tutorials.cmake,Experimental + # That's it diff --git a/testHarness/foam-extend/3.2/runDir/Allrun_Nightly b/testHarness/foam-extend/3.2/runDir/Allrun_Nightly index fd684c368..ed5825517 100755 --- a/testHarness/foam-extend/3.2/runDir/Allrun_Nightly +++ b/testHarness/foam-extend/3.2/runDir/Allrun_Nightly @@ -86,11 +86,16 @@ cmake $WM_PROJECT_DIR # Invoke make help for the complete list of available commands. # # User-demand testing. -# Will do: ExperimentalConfigure + ExperimentalBuild + ExperimentalTest + ExperimentalSubmit -# make Experimental - +# +# The old way. Still valid, but not supporting subprojects +# Will do: ExperimentalBuild + ExperimentalTest + ExperimentalSubmit +#make Experimental +# # Nightly testing -# Will do: NightlyUpdate + NightylConfigure + NightlyBuild + NightlyTest + NightlySubmit -make Nightly +# Will do: NightlyUpdate + NightlyBuild + NightlyTest + NightlySubmit +# make Nightly + +# The new way. With support for subprojects +ctest -V -S ./Dashboard_Tutorials.cmake,Nightly # That's it From ad3bd3074a644dda7de485998e729c7308d4dd84 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Thu, 3 Sep 2015 12:53:54 -0400 Subject: [PATCH 15/33] Introducing the FOAM_SITE_DIR environment variable. So we can now start using directories like $FOAM_SITE_DIR/etc in scripts for site customization. --- etc/settings.csh | 5 +++-- etc/settings.sh | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/etc/settings.csh b/etc/settings.csh index 45cd45cdc..31c46d8cd 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -52,8 +52,9 @@ setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS setenv FOAM_SRC $WM_PROJECT_DIR/src # shared site configuration - similar naming convention as ~FOAM expansion -setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS -setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS +setenv FOAM_SITE_DIR $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION +setenv FOAM_SITE_APPBIN $FOAM_SITE_DIR/bin/$WM_OPTIONS +setenv FOAM_SITE_LIBBIN $FOAM_SITE_DIR/lib/$WM_OPTIONS # user configuration setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS diff --git a/etc/settings.sh b/etc/settings.sh index 1333e93a2..90bce6e96 100755 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -90,8 +90,9 @@ export FOAM_LIBBIN=$WM_PROJECT_DIR/lib/$WM_OPTIONS export FOAM_SRC=$WM_PROJECT_DIR/src # shared site configuration - similar naming convention as ~FOAM expansion -export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS -export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS +export FOAM_SITE_DIR=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION +export FOAM_SITE_APPBIN=$FOAM_SITE_DIR/bin/$WM_OPTIONS +export FOAM_SITE_LIBBIN=$FOAM_SITE_DIR/lib/$WM_OPTIONS # user configuration export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS From a6bccbe942628906f018d7aee57b0b77083aee8a Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Fri, 4 Sep 2015 09:35:20 -0400 Subject: [PATCH 16/33] testHarness: allow overriding CTestConfig.cmake values for using local site CDash service or for using personnal (user space) CDash service. The expected order of precedence is respected: the personnal settings will override the site settings, and the site settings will override the default settings for the foam-extend CDash service hosted on SourceForge.net. --- CTestConfig.cmake | 12 ++++++++++++ .../3.2/CMakeFiles/CTestConfig.cmake.foam-extend | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 1190369a2..12f1b878e 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -6,6 +6,10 @@ ## ENABLE_TESTING() ## INCLUDE(CTest) +# These settings will allow you to publish your dashboards results +# on the foam-extend CDash service hosted on SourceForge.Net +# See here: http://foam-extend.sourceforge.net/CDash/index.php +# set(CTEST_PROJECT_NAME "foam-extend-3.2") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") @@ -13,3 +17,11 @@ set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "foam-extend.sourceforge.net") set(CTEST_DROP_LOCATION "/CDash/submit.php?project=foam-extend-3.2") set(CTEST_DROP_SITE_CDASH TRUE) + +# We can override those variables for local sites so you can use +# your own site CDash service +include($ENV{FOAM_SITE_DIR}/etc/CTestConfig.cmake OPTIONAL) + +# We can override those variables from user space so you can use +# your own personal CDash service +include($ENV{WM_PROJECT_USER_DIR}/etc/CTestConfig.cmake OPTIONAL) diff --git a/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend b/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend index 1190369a2..12f1b878e 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend +++ b/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend @@ -6,6 +6,10 @@ ## ENABLE_TESTING() ## INCLUDE(CTest) +# These settings will allow you to publish your dashboards results +# on the foam-extend CDash service hosted on SourceForge.Net +# See here: http://foam-extend.sourceforge.net/CDash/index.php +# set(CTEST_PROJECT_NAME "foam-extend-3.2") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") @@ -13,3 +17,11 @@ set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "foam-extend.sourceforge.net") set(CTEST_DROP_LOCATION "/CDash/submit.php?project=foam-extend-3.2") set(CTEST_DROP_SITE_CDASH TRUE) + +# We can override those variables for local sites so you can use +# your own site CDash service +include($ENV{FOAM_SITE_DIR}/etc/CTestConfig.cmake OPTIONAL) + +# We can override those variables from user space so you can use +# your own personal CDash service +include($ENV{WM_PROJECT_USER_DIR}/etc/CTestConfig.cmake OPTIONAL) From 3c9b632afbb8db53ede1959a30140c9e8a56d174 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Fri, 4 Sep 2015 10:20:31 -0400 Subject: [PATCH 17/33] testHarness: Choosing better names for the optional site and user CTestConfig.cmake files. Adding a comment about the expected locations for those 2 files. --- CTestConfig.cmake | 10 ++++++++-- .../3.2/CMakeFiles/CTestConfig.cmake.foam-extend | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 12f1b878e..84d537ace 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -20,8 +20,14 @@ set(CTEST_DROP_SITE_CDASH TRUE) # We can override those variables for local sites so you can use # your own site CDash service -include($ENV{FOAM_SITE_DIR}/etc/CTestConfig.cmake OPTIONAL) +# This optional file will be located here: +# $FOAM_SITE_DIR/etc/CTestConfig.site.cmake +# +include($ENV{FOAM_SITE_DIR}/etc/CTestConfig.site.cmake OPTIONAL) # We can override those variables from user space so you can use # your own personal CDash service -include($ENV{WM_PROJECT_USER_DIR}/etc/CTestConfig.cmake OPTIONAL) +# This optional file will be located here: +# $WM_PROJECT_USER_DIR/etc/CTestConfig.user.cmake +# +include($ENV{WM_PROJECT_USER_DIR}/etc/CTestConfig.user.cmake OPTIONAL) diff --git a/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend b/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend index 12f1b878e..84d537ace 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend +++ b/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend @@ -20,8 +20,14 @@ set(CTEST_DROP_SITE_CDASH TRUE) # We can override those variables for local sites so you can use # your own site CDash service -include($ENV{FOAM_SITE_DIR}/etc/CTestConfig.cmake OPTIONAL) +# This optional file will be located here: +# $FOAM_SITE_DIR/etc/CTestConfig.site.cmake +# +include($ENV{FOAM_SITE_DIR}/etc/CTestConfig.site.cmake OPTIONAL) # We can override those variables from user space so you can use # your own personal CDash service -include($ENV{WM_PROJECT_USER_DIR}/etc/CTestConfig.cmake OPTIONAL) +# This optional file will be located here: +# $WM_PROJECT_USER_DIR/etc/CTestConfig.user.cmake +# +include($ENV{WM_PROJECT_USER_DIR}/etc/CTestConfig.user.cmake OPTIONAL) From 9826a2d0c3c19df221299ce02fce9b1f427db7f9 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sat, 5 Sep 2015 20:38:57 -0400 Subject: [PATCH 18/33] testHarness: For each test case, add a label from the name of the top most tutorial directories (eg: basic, incompressible, etc). We will use this label in order to categorize the various test cases under a more generic 'topic', so we can for instance limit the testharness to only the suite of 'compressible' test cases, etc., simply by using the ctest -L command. ctest --print-labels will print the list of all available labels. --- .../3.2/CMakeFiles/FOAM_Tutorials.cmake | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake index 4eadb09c2..7ba40d7fc 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake +++ b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake @@ -100,9 +100,22 @@ FOREACH(caseWithAllrun ${listofCasesWithAllrun}) MESSAGE("Adding test: ${testId}") ADD_TEST(${testId} bash -c "cd ${thisCasePath}; ./Allrun") + # We extract a label name from the top level tutorial directories + # (eg: basic, incompressible, immersedBoundary, etc). We will use this + # label in order to categorize the various test cases under a more 'generic + # topic', so we can for instance limit the testharness to the + # 'incompressible' test cases, etc., simply by using the ctest -L command. + # + # ctest --print-labels will print the list of all available labels. + # + string(REPLACE ${TEST_CASE_DIR}/ "" tmpLabel ${caseWithAllrun}) + string(FIND ${tmpLabel} "/" indexFirstSlash) + string(SUBSTRING ${tmpLabel} 0 ${indexFirstSlash} testLabel) + # Add a dependency on the global clean-up target # When running in parallel, you need to wait for the cleanup to finish first - SET_TESTS_PROPERTIES(${testId} PROPERTIES DEPENDS ${cleanCasesTestId} LABELS Tutorials) + message(" This test case will have the following labels: Tutorials, ${testLabel}") + SET_TESTS_PROPERTIES(${testId} PROPERTIES DEPENDS ${cleanCasesTestId} LABELS "Tutorials;${testLabel}") # Use this following entry instead for testing purpose #ADD_TEST(${testId} bash -c "cd ${thisCasePath}; true") From 1ff17de662e9615822c20be97c3bfe9a4d191f1a Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sat, 12 Sep 2015 16:55:45 -0400 Subject: [PATCH 19/33] testHarness: User guide for the testHarness in Org Mode --- doc/testHarness/Allrun | 6 + doc/testHarness/testHarness.org | 329 ++++++++++++++++++++++++++++++++ 2 files changed, 335 insertions(+) create mode 100644 doc/testHarness/Allrun create mode 100644 doc/testHarness/testHarness.org diff --git a/doc/testHarness/Allrun b/doc/testHarness/Allrun new file mode 100644 index 000000000..cfd473d82 --- /dev/null +++ b/doc/testHarness/Allrun @@ -0,0 +1,6 @@ +# Generate the ASCII version of testHarness.org +pandoc testHarness.org -N -s -S -f org -t asciidoc -o testHarness.txt + +# Generate the Mediawiki version of testHarness.org +pandoc testHarness.org -s -S -f org -t mediawiki -o testHarness.mediawiki + diff --git a/doc/testHarness/testHarness.org b/doc/testHarness/testHarness.org new file mode 100644 index 000000000..71dad5bc8 --- /dev/null +++ b/doc/testHarness/testHarness.org @@ -0,0 +1,329 @@ +# -*- mode: org; -*- +# +#+TITLE: *foam-extend-3.2: A guide to test harness* +#+AUTHOR: Martin Beaudoin +#+DATE: 5 September 2015 +#+LINK: foam-extend https://sourceforge.net/projects/openfoam-extend/ +#+OPTIONS: author:t +#+OPTIONS: toc:2 +#+OPTIONS: ^:{} +#+OPTIONS: _:{} + +############################################################################### + +* A guide to the foam-extend test harness +This file is a guide to the foam-extend test harness. + +The test harness from foam-extend version 3.2 was used as a reference +implementation for this documentation. + +The original version of this file is located at +$WM\_PROJECT\_DIR/doc/testHarness/testHarness.org. + +A plain text version of this file is located at +$WM\_PROJECT\_DIR/doc/testHarness/testHarness.txt. + +A MediaWiki version of this file is located at + +In case any converted versions (text, MediaWiki, etc.) of this file differ from +the original testHarness.org file, the latter should always be considered the +reference version. But we do appreciate your feedback and comments for improving +this text. + +For instance, if you ever decide to improve the Mediawiki version only, please +consider contributing your changes back to the testHarness.org file as +well. Otherwise, your Mediawiki changes might get overwritten by an updated +version of the .org reference file. + +** Introduction +The foam-extend test harness scripts are based mainly on Kitware CMake/CTest +utilities http://www.cmake.org/. + +In its current version, the test harness is designed for running the full suite +of foam-extend tutorials, and report the fail/success results to a CDash Web +service one can consult using a simple browser. + +The CDash Web service for foam-extend 3.2 is available here: +http://foam-extend.sourceforge.net/CDash/index.php + +For a quick introduction of CMake/CTest, see here: +http://www.cmake.org/Wiki/CMake/Testing_With_CTest + +For a more complete introduction to CMake and CTest, one can also refer to the +Kitware book `Mastering CMake: A Cross-Platform Build System` +http://www.kitware.com/products/books.php + +For more information on Kitware CDash, see here: http://www.cdash.org/ + +The rest of this document will provide suficient information so you can run the +foam-extend test harness on your own. + +** Files location and a short description +The foam-extend test harness is currently built from the following files: + +- =$WM_PROJECT_DIR/CMakeLists.txt= :: This is the main CMake file driving the + configuration of the test harness. When processed though the cmake + utility, all the necessary Makefiles and CTest scripts will get + generated. + +- =$WM_PROJECT_DIR/CTestConfig.cmake= :: This file contains the various variables + and definitions necessary to publish your test harness results over the + CDash Web service for foam-extend 3.2. + +- =$FOAM_SITE_DIR/etc/CTestConfig.site.cmake= :: This file allow you to override + the values from the main $WM\_PROJECT\_DIR/CTestConfig.cmake. This file + should be used if you are hosting your own site CDash Web + service. + +- =$WM_PROJECT_USER_DIR/etc/CTestConfig.user.cmake= :: This file allow you to + override the values from the main $WM\_PROJECT\_DIR/CTestConfig.cmake and the + site file $FOAM\_SITE\_DIR/etc/CTestConfig.site.cmake. This file should be + used if you are hosting your own user space personal CDash Web service. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt= :: + This file is a copy of the main $WM\_PROJECT\_DIR/CMakeLists.txt file. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/CMakeFiles/CTestConfig.cmake.foam-extend= :: This file is a copy of the main $WM\_PROJECT\_DIR/CTestConfig.cmake file. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/CMakeFiles/Dashboard_Tutorials.cmake.in= :: This file is a template for generating the file `ctest -S` file + $WM\_PROJECT\_DIR/testHarness/foam-extend/3.2/runDir/Dashboard\_Tutorials.cmake + CMake will take care of automatically generating the Dashboard\_Tutorials.cmake file. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake= :: This file will configure a copy the foam-extend tutorials for running + under the test harness. The copy will be made under + $WM\_PROJECT\_DIR/testHarness/foam-extend/3.2/runDir. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/runDir/Allclean= :: Cleanup + script. Will remove all the automatically generated files and directories + for the test harness. Should be called prior to running the Allrun\_\* scripts. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/runDir/Allrun_CMakeOnly= :: This + script will generate all the necessary files for running the test harness + on the foam-extend tutorials. One can then invoke `make help` to see all + the available make options. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/runDir/Allrun_Experimental= :: + Same script as `Allrun\_CMakeOnly`, but will also call `make + Experimental`. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/runDir/Allrun_Nightly= :: Same + script as `Allrun\_CMakeOnly`, but will also call `make Nightly`. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/scripts/AdditionalRunFunctions= :: Additional `bash` macros for the tutorial Allrun files. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/scripts/Allrun.default= :: + Default Allrun script for the tutorial when none are provided. + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/scripts/addMissingAllrunFileToTutorial.sh= :: Bash script for adding a default Allrun file to the tutorials that do not + have one. The test harness only run tutorials with an existing Allrun file + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/scripts/prepareCasesForOneTimeStep.sh= :: This script will modify the test cases system/controlDict in order for the + case to run for only 1 time step + +- =$WM_PROJECT_DIR/testHarness/foam-extend/3.2/scripts/prepareCasesForTestHarness.sh= :: This script will modify the test cases Allrun file so it can run properly + under the test harness. + +** Configuring your $WM\_PROJECT\_DIR/etc/prefs.sh file for the test harness +The following environment variables are used for configuring the test harness: + +- =CDASH_SUBMIT_LOCAL_HOST_ID= :: System identifier for the FOAM CDash test harness + on foam-extend. By default, your system FQN/hostname will be used as the + system identifier when publishing your test harness results on the FOAM CDash + server on foam-extend. You can override your identifier using this environment + variable. + +- =CDASH_SCM_INFO= :: Buildname suffix for the FOAM CDash test harness on foam-extend. + By default, the git branch name and git revision number will be appended to the CDash build name. + Otherwise, for users not using git, or wanting to provide additionnal + information, simply initialize the CDASH\_SCM\_INFO with the proper information. + +- =WM_NCOMPPROCS= :: Specify the number of cores to use for the parallel execution + of the test harness. + +- =FOAM_TUTORIALS= :: Directory where the original test cases are located. For + foam-extend, this would be by default $WM\_PROJECT\_DIR/tutorials. + +** The main dashboards : Experimental, Nightly and Continuous +The result of a test run, reformatted for easy review, is called a +`dashboard`. A dashboard can be submitted to a central server, like CDash. Once +properly configured, the test harness will offer 3 main dashboards. + +- =Experimental= :: Will test the current state of the project. An experimental + submission can be performed at any time, usually interactively from the + current working copy of a developer. +- =Nightly= :: Is similar to Experimental, except that the source tree will be set + to the state it was in at a specific nightly time. This ensures that all + `nightly` submissions correspond to the state of the project at the same + point in time. `Nightly` builds are usually done automatically at a preset + time of day. Nightly build will also update your source code to the latest + available revision. So it is best not to run a Nightly dashboard on source + code that is not yet committed. +- =Continuous= :: Means that the source tree is updated to the latest revision, + and a build / test cycle is performed only if any files were actually + updated. Like `Nightly` builds, `Continuous` ones are usually done + automatically and repeatedly in intervals. + +There are also `intermediary dashboards` that allow you to select a specific +test harness intermediary step. The command `make help` will show you that list: + +#+BEGIN_SRC +... ContinuousBuild +... ContinuousConfigure +... ContinuousCoverage +... ContinuousMemCheck +... ContinuousStart +... ContinuousSubmit +... ContinuousTest +... ContinuousUpdate +... ExperimentalBuild +... ExperimentalConfigure +... ExperimentalCoverage +... ExperimentalMemCheck +... ExperimentalStart +... ExperimentalSubmit +... ExperimentalTest +... ExperimentalUpdate +... NightlyBuild +... NightlyConfigure +... NightlyCoverage +... NightlyMemCheck +... NightlyMemoryCheck +... NightlyStart +... NightlySubmit +... NightlyTest +... NightlyUpdate +#+END_SRC + +- Note :: For foam-extend, the MemCheck and Coverage dashboards are not supported. + +** Running the test harness + Running the test harness is pretty simple: + + These commands will configure and run the `Experimental` version of the test harness: + +#+BEGIN_SRC + cd $WM_PROJECT_DIR/testHarness/foam-extend/3.2/runDir + ./Allclean + ./Allrun_Experimental +#+END_SRC + + To run the `Nightly` version of the test harness: + +#+BEGIN_SRC + cd $WM_PROJECT_DIR/testHarness/foam-extend/3.2/runDir + ./Allclean + ./Allrun_Nightly +#+END_SRC + + To see the full range of available options, run the command: + +#+BEGIN_SRC +make help +#+END_SRC + +** Selecting a subset of test cases to run +Instead of using the `make` command to run the test harness, one can also use +command `ctest`. The commmand `ctest` offers additionnal options to select or limit the number +of tests to run. + +The following command will provide all the available options for ctest: + +#+BEGIN_SRC +ctest -N +#+END_SRC + +Here is a list of useful ctest options: + +- =ctest -N= :: this command will list the available tests by their name and + number. By default, all the tests are run in succession following the + numerical order shown. + +- =ctest -R = :: run all the tests whose name are matching the supplied + regular expression. For instance, to run all the tests related to cfMesh, + one can use the following command: `ctest -R cfMesh` + +- =ctest -E = :: run all the tests, but exclude the ones whose name is + matching the supplied regular expression. For instance, to run all the + tests except those for cfMesh, one can use the following command: `ctest -E + cfMesh` + +- =ctest -I [Start,End,Stride,test#,test#]= :: run individual tests by + number. `ctest -I 3,5` will run test 3, 4 and 5. `ctest -I 4,4,,4,7,13` + will run tests 4, 7 and 13. + +- =ctest -D dashboard= :: run a specific dashboard test. For example, the command + `make Experimental` can be replaced by the following suite of ctest + commands: +#+BEGIN_SRC +ctest -D ExperimentalStart +ctest -D ExperimentalConfigure +ctest -D ExperimentalBuild +ctest -D ExperimentalTest +ctest -D ExperimentalSubmit +#+END_SRC + +Here is a more complete example where we will configure, build, test and submit the test +harness results, but only for the incompressible tutorials: +#+BEGIN_SRC +ctest -D Experimental -R incompressible +#+END_SRC + + +** Browsing the CDash service + + The results of the test harness run will be published on the CDash dashboard on foam-extend. + + To see your results: + URL : http://foam-extend.sourceforge.net/CDash/index.php?project=foam-extend-3.2 + + On this interactive Web site, one can then point and click various buttons + and menus to explore the various reports uploaded from your test harness runs. + +** Configuring the test harness for using your own site or personal CDash service +The foam-extend source code comes with a set pre-configured parameters for +uploading your dashboards results on the main project CDash server. One can also +choose to host their own CDash service, either as a site service, or as a +personnal service running in your own user space. Your CDash administrator can +generate a file similar to $WM\_PROJECT\_DIR/CTestConfig.cmake where all the +necessary parameters for connecting to your local service are specified. + +In order to use your site CDash service, simply copy your site CTestConfig.cmake +file to $FOAM\_SITE\_DIR/etc/CTestConfig.site.cmake + +In order to use your personnal CDash service, simply copy your personnal CTestConfig.cmake +file to $WM\_PROJECT\_USER\_DIR/etc/CTestConfig.user.cmake + +As usual, your site configuration will override the default parameters from the +main configuration file $WM\_PROJECT\_DIR/CTestConfig.cmake. + +Likewise, your personnal configuration will override the default parameters from the +main configuration file $WM\_PROJECT\_DIR/CTestConfig.cmake and the default +parameters from the site file $FOAM\_SITE\_DIR/etc/CTestConfig.site.cmake. + + +** New features for the test harness (foam-extend 3.2): + - =Running the test harness in parallel= :: It is now possible to run the test + harness in parallel over a single node or computer. The environment + variable WM\_NCOMPPROCS will specify the number of cores to use for + running the test harness. For `n` cores specified, `n` tutorials will + be running in parallel on your computer. Since all the tests will + still run on the same computer, make sure you have enough ressources to + run `n` tutorials in parallel. Depending on the number of cores + available, one might have to tweak some of the shell `limits` + values. The command `ulimit -a` will show you the actual limits values + imposed on your shell. Some limit values like `open files` (ulimit -n) + or `max user processes` (ulimit -u) might need to be adjusted to some + higher values. In doubt, consult with your local sysadmin. + +** Notes +The MediaWiki version of this file was generated using the following command: + +#+BEGIN_SRC + pandoc testHarness.org -s -S -f org -t mediawiki -o testHarness.mediawiki +#+END_SRC + +The ASCII version of this file was generated using the following command: + +#+BEGIN_SRC + pandoc testHarness.org -N -s -S -f org -t asciidoc -o testHarness.txt +#+END_SRC From 568b982954dc6b36bcbd85c9b4905bdb72c3e033 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sat, 12 Sep 2015 17:12:41 -0400 Subject: [PATCH 20/33] testHarness: improving the documentation for the test harness --- doc/testHarness/testHarness.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/testHarness/testHarness.org b/doc/testHarness/testHarness.org index 71dad5bc8..ff41b2c66 100644 --- a/doc/testHarness/testHarness.org +++ b/doc/testHarness/testHarness.org @@ -124,7 +124,9 @@ The foam-extend test harness is currently built from the following files: under the test harness. ** Configuring your $WM\_PROJECT\_DIR/etc/prefs.sh file for the test harness -The following environment variables are used for configuring the test harness: +The following environment variables are used for configuring the test +harness. You should use your $WM\_PROJECT\_DIR/etc/prefs.sh file to initialize +these variables. - =CDASH_SUBMIT_LOCAL_HOST_ID= :: System identifier for the FOAM CDash test harness on foam-extend. By default, your system FQN/hostname will be used as the From a2f96bf6f41fbdc7c59cf01a9cd4006d0fa1b3f8 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Tue, 15 Sep 2015 17:24:30 -0400 Subject: [PATCH 21/33] testHarness: add FOAM_TEST_HARNESS_DIR environment variable --- etc/settings.csh | 1 + etc/settings.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/etc/settings.csh b/etc/settings.csh index 31c46d8cd..f752c2e48 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -65,6 +65,7 @@ setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials setenv FOAM_UTILITIES $FOAM_APP/utilities setenv FOAM_SOLVERS $FOAM_APP/solvers setenv FOAM_RUN $WM_PROJECT_USER_DIR/run +setenv FOAM_TEST_HARNESS_DIR $WM_PROJECT_DIR/testHarness/foam-extend/$WM_PROJECT_VERSION # add FOAM scripts and wmake to the path set path=($WM_DIR $WM_PROJECT_DIR/bin $path) diff --git a/etc/settings.sh b/etc/settings.sh index 90bce6e96..28a78bd8b 100755 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -103,6 +103,7 @@ export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials export FOAM_UTILITIES=$FOAM_APP/utilities export FOAM_SOLVERS=$FOAM_APP/solvers export FOAM_RUN=$WM_PROJECT_USER_DIR/run +export FOAM_TEST_HARNESS_DIR=$WM_PROJECT_DIR/testHarness/foam-extend/$WM_PROJECT_VERSION # add FOAM scripts and wmake to the path export PATH=$WM_DIR:$WM_PROJECT_DIR/bin:$PATH From 209da85a766a4a7e601b8d4f29657701547d625c Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Tue, 15 Sep 2015 20:47:54 -0400 Subject: [PATCH 22/33] testHarness: improved CTest coding. Adjustments for the Windows port. --- CMakeLists.txt | 151 ++++++++++++++---- .../foam-extend/3.2/CMakeFiles/CMakeLists.txt | 151 ++++++++++++++---- .../3.2/CMakeFiles/FOAM_Tutorials.cmake | 8 +- 3 files changed, 252 insertions(+), 58 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a3d35b6df..a67a33006 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,117 @@ cmake_minimum_required (VERSION 2.8) PROJECT(foam-extend-3.2) #----------------------------------------------------------------------------- +# Utility functions +# +# GetHostName(var) +# +# Set the variable named ${var} to the host hostname +# +function(GetHostName var) + set( thisHostName "unknown") + + if(CMAKE_HOST_WIN32) + execute_process( + COMMAND hostname + OUTPUT_VARIABLE thisHostname + ) + else() + execute_process( + COMMAND hostname -f + OUTPUT_VARIABLE thisHostname + ) + endif() + set(${var} ${thisHostname} PARENT_SCOPE) +endfunction() + +# +# GetGitStatus(status ecode) +# +# Get the git status for the local git repository of the source code +# The variable named ${status} will get the git status +# The variable named ${ecode} will get the command error code +# +function(GetGitStatus _status _ecode) + set( git_status "unknown") + set( git_ecode "1") + + execute_process( + COMMAND git status + WORKING_DIRECTORY ${FOAM_ROOT} + OUTPUT_VARIABLE git_status + RESULT_VARIABLE git_ecode + ERROR_QUIET + ) + set(${_status} ${git_status} PARENT_SCOPE) + set(${_ecode} ${git_ecode} PARENT_SCOPE) +endfunction() + +# +# GetGitBranchName(var) +# +# Set the variable named ${var} to the git branch name of the source code +# +function(GetGitBranchName var) + set( retValue "unknown") + + execute_process( + COMMAND git branch --no-color + WORKING_DIRECTORY ${FOAM_ROOT} + OUTPUT_VARIABLE listOfGitBranches + ) + # Create list of strings + string(REPLACE "\n" ";" listOfGitBranches ${listOfGitBranches}) + + # Iterate over list, find the string beginning with "* " + foreach(branch ${listOfGitBranches}) + string(REGEX MATCH "\\* .*$" matchString ${branch}) + string(LENGTH "${matchString}" lengthMatchString) + if(lengthMatchString GREATER 0) + # We have match. Cleanup and set retValue + string(REPLACE "* " "" retValue ${matchString}) + endif() + endforeach() + + set(${var} ${retValue} PARENT_SCOPE) +endfunction() + +# +# GetGitRevNumber(var) +# +# Set the variable named ${var} to the git revision number of the source code +# +function(GetGitRevNumber var) + set( retValue "unknown") + + execute_process( + COMMAND git rev-parse --short=12 HEAD + WORKING_DIRECTORY ${FOAM_ROOT} + OUTPUT_VARIABLE git_rev_number + ) + + # Minimal check that we do have a valid string + string(LENGTH "${git_rev_number}" lengthString) + if(lengthString GREATER 0) + set(retValue ${git_rev_number}) + endif() + + set(${var} ${retValue} PARENT_SCOPE) +endfunction() + +# CleanUpStringForCDash(var) +# +# Cleanup the variable named ${value} for characters not supported +# for CDash identifiers. Return the modified value in retVar +# +function(CleanUpStringForCDash value retVar) + string(REPLACE "/" "_" value "${value}") + string(REPLACE " " "_" value ${value}) + set(${retVar} ${value} PARENT_SCOPE) +endfunction() + +#----------------------------------------------------------------------------- +# +# # Initialization of CTest specific variables # ## Run ctest in parallel if environment variable WM_NCOMPPROCS is set @@ -57,13 +168,11 @@ IF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "") SITENAME $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} CACHE STRING "Name of the local site" ) -ELSE (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "") +ELSE () # Grab the hostname FQN; will be used for the sitename - execute_process( - COMMAND hostname -f - OUTPUT_VARIABLE SITENAME - ) -ENDIF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "") + GetHostName(SITENAME) + +ENDIF() MESSAGE("Initializing the name of this local site to: ${SITENAME}") @@ -146,27 +255,15 @@ elseif(GIT_FOUND) message("The git command was found: ${GIT_EXECUTABLE}") # Check if the source code is under a valid git repository - execute_process( - COMMAND git status - WORKING_DIRECTORY ${FOAM_ROOT} - OUTPUT_VARIABLE GIT_STATUS - RESULT_VARIABLE GIT_ECODE - ERROR_QUIET - ) + GetGitStatus(GIT_STATUS GIT_ECODE) if(NOT GIT_ECODE) - # We have a valid git repository. Grab the branch and revision info. - # Add to the build name - exec_program(git - ARGS branch --no-color 2> /dev/null | grep '*'| awk '{print $2}' - OUTPUT_VARIABLE GIT_BRANCH_NAME - ) + # We have a valid git repository. + # Grab the branch and revision info. Add to the build name + GetGitBranchName(GIT_BRANCH_NAME) message("Git branch: ${GIT_BRANCH_NAME}") - execute_process( - COMMAND git rev-parse --short=12 HEAD - OUTPUT_VARIABLE GIT_REV_NUMBER - ) + GetGitRevNumber(GIT_REV_NUMBER) message("Git revision: ${GIT_REV_NUMBER}") SET(BUILDNAME "${BUILDNAME}-git-branch=${GIT_BRANCH_NAME}") @@ -216,13 +313,13 @@ endif() # Some last minute cleanup # Seems like no '/' or ' 'are allowed in the BUILDNAME or in the SITE name -string(REPLACE "/" "_" BUILDNAME ${BUILDNAME}) -string(REPLACE " " "_" BUILDNAME ${BUILDNAME}) -string(REPLACE "/" "_" SITE ${SITE}) -string(REPLACE " " "_" SITE ${SITE}) +CleanUpStringForCDash(${BUILDNAME} BUILDNAME) +CleanUpStringForCDash(${SITE} SITE) message("Build name: ${BUILDNAME}") +message("Site name: ${SITE}") +# # Build section #----------------------------------------------------------------------------- diff --git a/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt b/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt index a3d35b6df..a67a33006 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt +++ b/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt @@ -39,6 +39,117 @@ cmake_minimum_required (VERSION 2.8) PROJECT(foam-extend-3.2) #----------------------------------------------------------------------------- +# Utility functions +# +# GetHostName(var) +# +# Set the variable named ${var} to the host hostname +# +function(GetHostName var) + set( thisHostName "unknown") + + if(CMAKE_HOST_WIN32) + execute_process( + COMMAND hostname + OUTPUT_VARIABLE thisHostname + ) + else() + execute_process( + COMMAND hostname -f + OUTPUT_VARIABLE thisHostname + ) + endif() + set(${var} ${thisHostname} PARENT_SCOPE) +endfunction() + +# +# GetGitStatus(status ecode) +# +# Get the git status for the local git repository of the source code +# The variable named ${status} will get the git status +# The variable named ${ecode} will get the command error code +# +function(GetGitStatus _status _ecode) + set( git_status "unknown") + set( git_ecode "1") + + execute_process( + COMMAND git status + WORKING_DIRECTORY ${FOAM_ROOT} + OUTPUT_VARIABLE git_status + RESULT_VARIABLE git_ecode + ERROR_QUIET + ) + set(${_status} ${git_status} PARENT_SCOPE) + set(${_ecode} ${git_ecode} PARENT_SCOPE) +endfunction() + +# +# GetGitBranchName(var) +# +# Set the variable named ${var} to the git branch name of the source code +# +function(GetGitBranchName var) + set( retValue "unknown") + + execute_process( + COMMAND git branch --no-color + WORKING_DIRECTORY ${FOAM_ROOT} + OUTPUT_VARIABLE listOfGitBranches + ) + # Create list of strings + string(REPLACE "\n" ";" listOfGitBranches ${listOfGitBranches}) + + # Iterate over list, find the string beginning with "* " + foreach(branch ${listOfGitBranches}) + string(REGEX MATCH "\\* .*$" matchString ${branch}) + string(LENGTH "${matchString}" lengthMatchString) + if(lengthMatchString GREATER 0) + # We have match. Cleanup and set retValue + string(REPLACE "* " "" retValue ${matchString}) + endif() + endforeach() + + set(${var} ${retValue} PARENT_SCOPE) +endfunction() + +# +# GetGitRevNumber(var) +# +# Set the variable named ${var} to the git revision number of the source code +# +function(GetGitRevNumber var) + set( retValue "unknown") + + execute_process( + COMMAND git rev-parse --short=12 HEAD + WORKING_DIRECTORY ${FOAM_ROOT} + OUTPUT_VARIABLE git_rev_number + ) + + # Minimal check that we do have a valid string + string(LENGTH "${git_rev_number}" lengthString) + if(lengthString GREATER 0) + set(retValue ${git_rev_number}) + endif() + + set(${var} ${retValue} PARENT_SCOPE) +endfunction() + +# CleanUpStringForCDash(var) +# +# Cleanup the variable named ${value} for characters not supported +# for CDash identifiers. Return the modified value in retVar +# +function(CleanUpStringForCDash value retVar) + string(REPLACE "/" "_" value "${value}") + string(REPLACE " " "_" value ${value}) + set(${retVar} ${value} PARENT_SCOPE) +endfunction() + +#----------------------------------------------------------------------------- +# +# # Initialization of CTest specific variables # ## Run ctest in parallel if environment variable WM_NCOMPPROCS is set @@ -57,13 +168,11 @@ IF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "") SITENAME $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} CACHE STRING "Name of the local site" ) -ELSE (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "") +ELSE () # Grab the hostname FQN; will be used for the sitename - execute_process( - COMMAND hostname -f - OUTPUT_VARIABLE SITENAME - ) -ENDIF (NOT $ENV{CDASH_SUBMIT_LOCAL_HOST_ID} STREQUAL "") + GetHostName(SITENAME) + +ENDIF() MESSAGE("Initializing the name of this local site to: ${SITENAME}") @@ -146,27 +255,15 @@ elseif(GIT_FOUND) message("The git command was found: ${GIT_EXECUTABLE}") # Check if the source code is under a valid git repository - execute_process( - COMMAND git status - WORKING_DIRECTORY ${FOAM_ROOT} - OUTPUT_VARIABLE GIT_STATUS - RESULT_VARIABLE GIT_ECODE - ERROR_QUIET - ) + GetGitStatus(GIT_STATUS GIT_ECODE) if(NOT GIT_ECODE) - # We have a valid git repository. Grab the branch and revision info. - # Add to the build name - exec_program(git - ARGS branch --no-color 2> /dev/null | grep '*'| awk '{print $2}' - OUTPUT_VARIABLE GIT_BRANCH_NAME - ) + # We have a valid git repository. + # Grab the branch and revision info. Add to the build name + GetGitBranchName(GIT_BRANCH_NAME) message("Git branch: ${GIT_BRANCH_NAME}") - execute_process( - COMMAND git rev-parse --short=12 HEAD - OUTPUT_VARIABLE GIT_REV_NUMBER - ) + GetGitRevNumber(GIT_REV_NUMBER) message("Git revision: ${GIT_REV_NUMBER}") SET(BUILDNAME "${BUILDNAME}-git-branch=${GIT_BRANCH_NAME}") @@ -216,13 +313,13 @@ endif() # Some last minute cleanup # Seems like no '/' or ' 'are allowed in the BUILDNAME or in the SITE name -string(REPLACE "/" "_" BUILDNAME ${BUILDNAME}) -string(REPLACE " " "_" BUILDNAME ${BUILDNAME}) -string(REPLACE "/" "_" SITE ${SITE}) -string(REPLACE " " "_" SITE ${SITE}) +CleanUpStringForCDash(${BUILDNAME} BUILDNAME) +CleanUpStringForCDash(${SITE} SITE) message("Build name: ${BUILDNAME}") +message("Site name: ${SITE}") +# # Build section #----------------------------------------------------------------------------- diff --git a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake index 7ba40d7fc..9fd8d7134 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake +++ b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake @@ -90,14 +90,14 @@ FOREACH(caseWithAllrun ${listofCasesWithAllrun}) MESSAGE("Found Allrun file in directory: ${thisCasePath}") # Grab the parent name of the case directory - string(REPLACE ${TEST_CASE_DIR}/ "" caseParentPath ${caseWithAllrun}) + string(REPLACE ${TEST_CASE_DIR}/ "" caseParentPath ${thisCasePath}) # Construct the testId string(REPLACE "/" "_" testId ${caseParentPath}) - SET(testId ${testId}${testIdSuffix}) + SET(testId ${testId}_Allrun${testIdSuffix}) # Add the test to the test harness - MESSAGE("Adding test: ${testId}") + MESSAGE(" Adding test: ${testId}") ADD_TEST(${testId} bash -c "cd ${thisCasePath}; ./Allrun") # We extract a label name from the top level tutorial directories @@ -120,7 +120,7 @@ FOREACH(caseWithAllrun ${listofCasesWithAllrun}) # Use this following entry instead for testing purpose #ADD_TEST(${testId} bash -c "cd ${thisCasePath}; true") - ENDIF(NOT ${thisCasePath} STREQUAL ${TEST_CASE_DIR}) + ENDIF() ENDFOREACH(caseWithAllrun) # Modify the cases Allrun files to incorporate additional shell functions From 7d10a1bbffd146be072ccad56c1c5ef545d103ae Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Tue, 15 Sep 2015 22:44:47 -0400 Subject: [PATCH 23/33] testHarness: adjusting the Makefile generator for cmake on Windows --- testHarness/foam-extend/3.2/runDir/Allrun_CMakeOnly | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/testHarness/foam-extend/3.2/runDir/Allrun_CMakeOnly b/testHarness/foam-extend/3.2/runDir/Allrun_CMakeOnly index af4dcab18..91117a1f9 100755 --- a/testHarness/foam-extend/3.2/runDir/Allrun_CMakeOnly +++ b/testHarness/foam-extend/3.2/runDir/Allrun_CMakeOnly @@ -73,7 +73,12 @@ fi # Make sure the CMake and tutorials runtime files are updated # We need cmake version 2.8.0 at least -cmake $WM_PROJECT_DIR +if [ "$WM_ARCH_BASE" == "mingw" ] +then + cmake $WM_PROJECT_DIR -G "MSYS Makefiles" +else + cmake $WM_PROJECT_DIR -G "Unix Makefiles" +fi # All set. Now we can run the available test harness # From 0a48ccb4d28ed916edb285f56f98b8b8e2c6d8b9 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Wed, 16 Sep 2015 09:27:34 -0400 Subject: [PATCH 24/33] testHarness: adjusting the ctest command invocation for scripts under Windows/Mingw --- CMakeLists.txt | 10 ++++++- .../foam-extend/3.2/CMakeFiles/CMakeLists.txt | 10 ++++++- .../3.2/CMakeFiles/FOAM_Tutorials.cmake | 29 ++++++++++++++----- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a67a33006..f8aa0cffa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -379,10 +379,18 @@ IF(BUILD_TESTING) IF(RUN_FROM_ONE_TIMESTEP) # Modify the cases controlDict file in order to run for only one time step MESSAGE("${testRunTimeDirectory}: Modifying the controlDict files for running only one time step in directory: ${TEST_CASE_DIR}") - EXECUTE_PROCESS( + if(CMAKE_HOST_WIN32) + # Need to supply a bash shell to run the script under Windows + EXECUTE_PROCESS( + COMMAND bash -c "$ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR}" + WORKING_DIRECTORY . + ) + else() + EXECUTE_PROCESS( COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR} WORKING_DIRECTORY . ) + endif() ENDIF(RUN_FROM_ONE_TIMESTEP) ENDIF(BUILD_TESTING) diff --git a/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt b/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt index a67a33006..f8aa0cffa 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt +++ b/testHarness/foam-extend/3.2/CMakeFiles/CMakeLists.txt @@ -379,10 +379,18 @@ IF(BUILD_TESTING) IF(RUN_FROM_ONE_TIMESTEP) # Modify the cases controlDict file in order to run for only one time step MESSAGE("${testRunTimeDirectory}: Modifying the controlDict files for running only one time step in directory: ${TEST_CASE_DIR}") - EXECUTE_PROCESS( + if(CMAKE_HOST_WIN32) + # Need to supply a bash shell to run the script under Windows + EXECUTE_PROCESS( + COMMAND bash -c "$ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR}" + WORKING_DIRECTORY . + ) + else() + EXECUTE_PROCESS( COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR} WORKING_DIRECTORY . ) + endif() ENDIF(RUN_FROM_ONE_TIMESTEP) ENDIF(BUILD_TESTING) diff --git a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake index 9fd8d7134..088f09211 100644 --- a/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake +++ b/testHarness/foam-extend/3.2/CMakeFiles/FOAM_Tutorials.cmake @@ -53,11 +53,18 @@ file(COPY $ENV{FOAM_TUTORIALS}/ DESTINATION ${TEST_CASE_DIR}) # The test harness relies on the presence of an Allrun file for # running the case MESSAGE("${testRunTimeDirectory}: Checking for missing Allrun file in tutorials") -EXECUTE_PROCESS( +if(CMAKE_HOST_WIN32) + # Need to supply a bash shell to run the script under Windows + EXECUTE_PROCESS( + COMMAND bash -c "$ENV{FOAM_TEST_HARNESS_DIR}/scripts/addMissingAllrunFileToTutorial.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/Allrun.default" + WORKING_DIRECTORY . + ) +else() + EXECUTE_PROCESS( COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/addMissingAllrunFileToTutorial.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/Allrun.default WORKING_DIRECTORY . ) - +endif() # Iterate over each tutorial case: # We are looking for tutorial cases with an Allrun file. # If this file is present, (and it should), we add this case to the list of cases to run. @@ -100,10 +107,10 @@ FOREACH(caseWithAllrun ${listofCasesWithAllrun}) MESSAGE(" Adding test: ${testId}") ADD_TEST(${testId} bash -c "cd ${thisCasePath}; ./Allrun") - # We extract a label name from the top level tutorial directories - # (eg: basic, incompressible, immersedBoundary, etc). We will use this + # We extract a label name from the top level tutorial directories + # (eg: basic, incompressible, immersedBoundary, etc). We will use this # label in order to categorize the various test cases under a more 'generic - # topic', so we can for instance limit the testharness to the + # topic', so we can for instance limit the testharness to the # 'incompressible' test cases, etc., simply by using the ctest -L command. # # ctest --print-labels will print the list of all available labels. @@ -125,10 +132,18 @@ ENDFOREACH(caseWithAllrun) # Modify the cases Allrun files to incorporate additional shell functions MESSAGE("${testRunTimeDirectory}: Modifying the Allrun files for additional shell functions in directory: ${TEST_CASE_DIR}") -EXECUTE_PROCESS( +if(CMAKE_HOST_WIN32) + # Need to supply a bash shell to run the script under Windows + EXECUTE_PROCESS( + COMMAND bash -c "$ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForTestHarness.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/AdditionalRunFunctions" + WORKING_DIRECTORY . + ) +else() + EXECUTE_PROCESS( COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForTestHarness.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/AdditionalRunFunctions WORKING_DIRECTORY . ) +endif() # Configure the various ctest -S Dashboard drivers @@ -137,6 +152,6 @@ configure_file( "$ENV{FOAM_TEST_HARNESS_DIR}/CMakeFiles/Dashboard_Tutorials.cmake.in" "$ENV{FOAM_TEST_HARNESS_DIR}/runDir/Dashboard_Tutorials.cmake" @ONLY) - + # That's it. From 8e0581a1cf110e8a01b48db8c9b3f160cb05fb4b Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sun, 20 Sep 2015 22:38:04 -0400 Subject: [PATCH 25/33] wmake: correcting dependencies syntax in .dep files on Windows --- wmake/scripts/addCompile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wmake/scripts/addCompile b/wmake/scripts/addCompile index 6dd3ba40f..54c1e0577 100755 --- a/wmake/scripts/addCompile +++ b/wmake/scripts/addCompile @@ -47,13 +47,13 @@ fi if [ "$WM_PROJECT_DIR" ] then - sed -e s%$WM_PROJECT_DIR%'$(WM_PROJECT_DIR)'% > $depName + sed -e s%:.*$WM_PROJECT_DIR%': $(WM_PROJECT_DIR)'% > $depName else cat > $depName fi sed -e s%".*.o.*:"%'$(OBJECTS_DIR)/'"$objectName\:"% \ - -e s%$WM_PROJECT_DIR%'$(WM_PROJECT_DIR)'% \ + -e s%:.*$WM_PROJECT_DIR%': $(WM_PROJECT_DIR)'% \ >> $depName echo '$(OBJECTS_DIR)/'$objectName': $(EXE_DEP)' >> $depName From f6f896a5767108d38585463e365d9ee4de93682b Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sun, 20 Sep 2015 22:47:05 -0400 Subject: [PATCH 26/33] testHarness: adjusting the Makefile generator for cmake on Windows --- testHarness/foam-extend/3.2/runDir/Allrun_Experimental | 7 ++++++- testHarness/foam-extend/3.2/runDir/Allrun_Nightly | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/testHarness/foam-extend/3.2/runDir/Allrun_Experimental b/testHarness/foam-extend/3.2/runDir/Allrun_Experimental index 21bba0a29..186882d09 100755 --- a/testHarness/foam-extend/3.2/runDir/Allrun_Experimental +++ b/testHarness/foam-extend/3.2/runDir/Allrun_Experimental @@ -79,7 +79,12 @@ fi # Make sure the CMake and tutorials runtime files are updated # We need cmake version 2.8.0 at least -cmake $WM_PROJECT_DIR +if [ "$WM_ARCH_BASE" == "mingw" ] +then + cmake $WM_PROJECT_DIR -G "MSYS Makefiles" +else + cmake $WM_PROJECT_DIR -G "Unix Makefiles" +fi # All set. Now we can run the available test harness # diff --git a/testHarness/foam-extend/3.2/runDir/Allrun_Nightly b/testHarness/foam-extend/3.2/runDir/Allrun_Nightly index ed5825517..a21748e7c 100755 --- a/testHarness/foam-extend/3.2/runDir/Allrun_Nightly +++ b/testHarness/foam-extend/3.2/runDir/Allrun_Nightly @@ -79,7 +79,12 @@ fi # Make sure the CMake and tutorials runtime files are updated # We need cmake version 2.8.0 at least -cmake $WM_PROJECT_DIR +if [ "$WM_ARCH_BASE" == "mingw" ] +then + cmake $WM_PROJECT_DIR -G "MSYS Makefiles" +else + cmake $WM_PROJECT_DIR -G "Unix Makefiles" +fi # All set. Now we can run the available test harness # From c813770215985ede2dae8c520b6faf5e3794d576 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 28 Sep 2015 08:58:02 +0100 Subject: [PATCH 27/33] Fixed immersed boundary run scripts --- .../backwardStepShortTurbulentSimpleIbFoam/Allrun | 2 +- tutorials/immersedBoundary/cylBumpInterIbFoam/Allrun | 1 + .../immersedBoundary/simpleSilencerLaminarIcoIbFoam/Allrun | 2 +- tutorials/immersedBoundary/sphereInChannel/Allrun | 4 ++-- tutorials/immersedBoundary/thickPlateRefinedMesh/Allrun | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tutorials/immersedBoundary/backwardStepShortTurbulentSimpleIbFoam/Allrun b/tutorials/immersedBoundary/backwardStepShortTurbulentSimpleIbFoam/Allrun index d876fdd19..cd11a5b06 100755 --- a/tutorials/immersedBoundary/backwardStepShortTurbulentSimpleIbFoam/Allrun +++ b/tutorials/immersedBoundary/backwardStepShortTurbulentSimpleIbFoam/Allrun @@ -6,7 +6,7 @@ application="simpleIbFoam" runApplication blockMesh -cp save/boundary constant/polyMesh +\cp save/boundary constant/polyMesh \mkdir 0 \cp 0_org/* 0/ diff --git a/tutorials/immersedBoundary/cylBumpInterIbFoam/Allrun b/tutorials/immersedBoundary/cylBumpInterIbFoam/Allrun index 8f160b756..b18d84959 100755 --- a/tutorials/immersedBoundary/cylBumpInterIbFoam/Allrun +++ b/tutorials/immersedBoundary/cylBumpInterIbFoam/Allrun @@ -6,6 +6,7 @@ application="interIbFoam" runApplication blockMesh +\cp -f save/boundary constant/polyMesh/ mkdir 0 cp 0_org/* 0/ diff --git a/tutorials/immersedBoundary/simpleSilencerLaminarIcoIbFoam/Allrun b/tutorials/immersedBoundary/simpleSilencerLaminarIcoIbFoam/Allrun index e530f6951..0d6a7b158 100755 --- a/tutorials/immersedBoundary/simpleSilencerLaminarIcoIbFoam/Allrun +++ b/tutorials/immersedBoundary/simpleSilencerLaminarIcoIbFoam/Allrun @@ -9,7 +9,7 @@ mkdir constant/polyMesh cp -f save/blockMeshDict constant/polyMesh runApplication blockMesh -cp -f save/boundary constant/polyMesh/ +\cp -f save/boundary constant/polyMesh/ runApplication refineImmersedBoundaryMesh -ibCellCellFaces diff --git a/tutorials/immersedBoundary/sphereInChannel/Allrun b/tutorials/immersedBoundary/sphereInChannel/Allrun index 2abb86f7a..f346111da 100755 --- a/tutorials/immersedBoundary/sphereInChannel/Allrun +++ b/tutorials/immersedBoundary/sphereInChannel/Allrun @@ -8,10 +8,10 @@ application="icoIbFoam" compileApplication refineSphereMesh mkdir constant/polyMesh -cp -f save/blockMeshDict constant/polyMesh +\cp -f save/blockMeshDict constant/polyMesh runApplication blockMesh -cp -f save/boundary constant/polyMesh/ +\cp -f save/boundary constant/polyMesh/ runApplication refineSphereMesh diff --git a/tutorials/immersedBoundary/thickPlateRefinedMesh/Allrun b/tutorials/immersedBoundary/thickPlateRefinedMesh/Allrun index fb7deeb43..ee0a6f248 100755 --- a/tutorials/immersedBoundary/thickPlateRefinedMesh/Allrun +++ b/tutorials/immersedBoundary/thickPlateRefinedMesh/Allrun @@ -8,10 +8,10 @@ application="icoIbFoam" compileApplication refineThickPlateMesh mkdir constant/polyMesh -cp -f save/blockMeshDict constant/polyMesh +\cp -f save/blockMeshDict constant/polyMesh runApplication blockMesh -cp -f save/boundary constant/polyMesh/ +\cp -f save/boundary constant/polyMesh/ runApplication refineThickPlateMesh From a3cd647cf9e0f71f5df33c7fe7d16daf96e5e57c Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Wed, 30 Sep 2015 09:48:55 +0100 Subject: [PATCH 28/33] Dynamic immersed boundary capability with an example moving immersed boundary mesh and tutorial --- .../immersedBoundary/icoDyMIbFoam/Make/files | 3 + .../icoDyMIbFoam/Make/options | 16 + .../icoDyMIbFoam/createFields.H | 52 + .../icoDyMIbFoam/icoDyMIbFoam.C | 141 +++ src/Allwmake | 1 + .../immersedBoundaryDynamicMesh/Make/files | 4 + .../immersedBoundaryDynamicMesh/Make/options | 18 + .../immersedBoundarySolidBodyMotionFvMesh.C | 119 +++ .../immersedBoundarySolidBodyMotionFvMesh.H | 112 +++ .../movingImmersedBoundary.C | 98 ++ .../movingImmersedBoundary.H | 121 +++ .../movingCylinderInChannelIco/.gitignore | 52 + .../movingCylinderInChannelIco/0_org/U | 65 ++ .../movingCylinderInChannelIco/0_org/p | 65 ++ .../movingCylinderInChannelIco/Allclean | 9 + .../movingCylinderInChannelIco/Allrun | 15 + .../constant/dynamicMeshDict | 899 ++++++++++++++++++ .../constant/polyMesh/blockMeshDict | 69 ++ .../constant/transportProperties | 19 + .../constant/triSurface/ibCylinder.ftr | 210 ++++ .../constant/triSurface/ibCylinder.stl | 674 +++++++++++++ .../save/blockMeshDict | 69 ++ .../movingCylinderInChannelIco/save/boundary | 60 ++ .../system/controlDict | 83 ++ .../system/decomposeParDict | 50 + .../system/fvSchemes | 59 ++ .../system/fvSolution | 68 ++ .../system/mapFieldsDict | 30 + 28 files changed, 3181 insertions(+) create mode 100644 applications/solvers/immersedBoundary/icoDyMIbFoam/Make/files create mode 100644 applications/solvers/immersedBoundary/icoDyMIbFoam/Make/options create mode 100644 applications/solvers/immersedBoundary/icoDyMIbFoam/createFields.H create mode 100644 applications/solvers/immersedBoundary/icoDyMIbFoam/icoDyMIbFoam.C create mode 100644 src/immersedBoundary/immersedBoundaryDynamicMesh/Make/files create mode 100644 src/immersedBoundary/immersedBoundaryDynamicMesh/Make/options create mode 100644 src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundarySolidBodyMotionFvMesh/immersedBoundarySolidBodyMotionFvMesh.C create mode 100644 src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundarySolidBodyMotionFvMesh/immersedBoundarySolidBodyMotionFvMesh.H create mode 100644 src/immersedBoundary/immersedBoundaryDynamicMesh/movingImmersedBoundary/movingImmersedBoundary.C create mode 100644 src/immersedBoundary/immersedBoundaryDynamicMesh/movingImmersedBoundary/movingImmersedBoundary.H create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/.gitignore create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/0_org/U create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/0_org/p create mode 100755 tutorials/immersedBoundary/movingCylinderInChannelIco/Allclean create mode 100755 tutorials/immersedBoundary/movingCylinderInChannelIco/Allrun create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/constant/dynamicMeshDict create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/constant/polyMesh/blockMeshDict create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/constant/transportProperties create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/constant/triSurface/ibCylinder.ftr create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/constant/triSurface/ibCylinder.stl create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/save/blockMeshDict create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/save/boundary create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/system/controlDict create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/system/decomposeParDict create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/system/fvSchemes create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/system/fvSolution create mode 100644 tutorials/immersedBoundary/movingCylinderInChannelIco/system/mapFieldsDict diff --git a/applications/solvers/immersedBoundary/icoDyMIbFoam/Make/files b/applications/solvers/immersedBoundary/icoDyMIbFoam/Make/files new file mode 100644 index 000000000..4244bed5d --- /dev/null +++ b/applications/solvers/immersedBoundary/icoDyMIbFoam/Make/files @@ -0,0 +1,3 @@ +icoDyMIbFoam.C + +EXE = $(FOAM_APPBIN)/icoDyMIbFoam diff --git a/applications/solvers/immersedBoundary/icoDyMIbFoam/Make/options b/applications/solvers/immersedBoundary/icoDyMIbFoam/Make/options new file mode 100644 index 000000000..e905566e4 --- /dev/null +++ b/applications/solvers/immersedBoundary/icoDyMIbFoam/Make/options @@ -0,0 +1,16 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/immersedBoundary/immersedBoundary/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \ + -I./lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lmeshTools \ + -limmersedBoundary \ + -ldynamicFvMesh \ + -ldynamicMesh \ + -L$(FOAM_USER_LIBBIN) -loversetMesh \ + -llduSolvers diff --git a/applications/solvers/immersedBoundary/icoDyMIbFoam/createFields.H b/applications/solvers/immersedBoundary/icoDyMIbFoam/createFields.H new file mode 100644 index 000000000..94776ab99 --- /dev/null +++ b/applications/solvers/immersedBoundary/icoDyMIbFoam/createFields.H @@ -0,0 +1,52 @@ + Info<< "Reading transportProperties\n" << endl; + + IOdictionary transportProperties + ( + IOobject + ( + "transportProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + dimensionedScalar nu + ( + transportProperties.lookup("nu") + ); + + Info<< "Reading field p\n" << endl; + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + +# include "createPhi.H" + + label pRefCell = 0; + scalar pRefValue = 0.0; + setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue); diff --git a/applications/solvers/immersedBoundary/icoDyMIbFoam/icoDyMIbFoam.C b/applications/solvers/immersedBoundary/icoDyMIbFoam/icoDyMIbFoam.C new file mode 100644 index 000000000..ec8742d4b --- /dev/null +++ b/applications/solvers/immersedBoundary/icoDyMIbFoam/icoDyMIbFoam.C @@ -0,0 +1,141 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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 2 of the License, or (at your + option) any later version. + + OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + icoDyMOversetFoam + +Description + Transient solver for incompressible, laminar flow of Newtonian fluids + with dynamic mesh and immersed boundary mesh support. + +Author + Hrvoje Jasak, Wikki Ltd. All rights reserved + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "dynamicFvMesh.H" +#include "immersedBoundaryFvPatch.H" +#include "immersedBoundaryAdjustPhi.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ +# include "setRootCase.H" +# include "createTime.H" +# include "createDynamicFvMesh.H" +# include "createFields.H" +# include "initContinuityErrs.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.loop()) + { + Info<< "Time = " << runTime.timeName() << nl << endl; + + // Make the fluxes absolute + fvc::makeAbsolute(phi, U); + + bool meshChanged = mesh.update(); + reduce(meshChanged, orOp()); + Info<< "Mesh update" << meshChanged << endl; +# include "createIbMasks.H" + + // Make the fluxes relative to the mesh motion + fvc::makeRelative(phi, U); + +# include "readPIMPLEControls.H" +# include "CourantNo.H" + + // Pressure-velocity corrector + int oCorr = 0; + do + { + fvVectorMatrix UEqn + ( + fvm::ddt(U) + + fvm::div(phi, U) + - fvm::laplacian(nu, U) + ); + + solve(UEqn == -fvc::grad(p)); + + // --- PISO loop + for (int corr = 0; corr < nCorr; corr++) + { + volScalarField rUA = 1.0/UEqn.A(); + + U = rUA*UEqn.H(); + // Immersed boundary update + U.correctBoundaryConditions(); + + phi = faceIbMask*(fvc::interpolate(U) & mesh.Sf()); + + // Adjust immersed boundary fluxes + immersedBoundaryAdjustPhi(phi, U); + adjustPhi(phi, U, p); + + for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pEqn + ( + fvm::laplacian(rUA, p) == fvc::div(phi) + ); + + pEqn.setReference(pRefCell, pRefValue); + pEqn.solve(); + + if (nonOrth == nNonOrthCorr) + { + phi -= pEqn.flux(); + } + } + +# include "immersedBoundaryContinuityErrs.H" + + // Make the fluxes relative to the mesh motion + fvc::makeRelative(phi, U); + + U -= rUA*fvc::grad(p); + U.correctBoundaryConditions(); + } + } while (++oCorr < nOuterCorr); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return(0); +} + + +// ************************************************************************* // diff --git a/src/Allwmake b/src/Allwmake index b3a191dd7..3b600c806 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -77,6 +77,7 @@ wmake libso dbns wmake libso immersedBoundary/immersedBoundary wmake libso immersedBoundary/immersedBoundaryTurbulence wmake libso immersedBoundary/immersedBoundaryForce +wmake libso immersedBoundary/immersedBoundaryDynamicMesh ( cd cudaSolvers ; ./Allwmake ) diff --git a/src/immersedBoundary/immersedBoundaryDynamicMesh/Make/files b/src/immersedBoundary/immersedBoundaryDynamicMesh/Make/files new file mode 100644 index 000000000..b0b7154fa --- /dev/null +++ b/src/immersedBoundary/immersedBoundaryDynamicMesh/Make/files @@ -0,0 +1,4 @@ +movingImmersedBoundary/movingImmersedBoundary.C +immersedBoundarySolidBodyMotionFvMesh/immersedBoundarySolidBodyMotionFvMesh.C + +LIB = $(FOAM_LIBBIN)/libimmersedBoundaryDynamicFvMesh diff --git a/src/immersedBoundary/immersedBoundaryDynamicMesh/Make/options b/src/immersedBoundary/immersedBoundaryDynamicMesh/Make/options new file mode 100644 index 000000000..cd204ebdf --- /dev/null +++ b/src/immersedBoundary/immersedBoundaryDynamicMesh/Make/options @@ -0,0 +1,18 @@ +EXE_INC = \ + -I$(LIB_SRC)/immersedBoundary/immersedBoundary/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/surfMesh/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/meshMotion/solidBodyMotion/lnInclude \ + +EXE_LIBS = \ + -limmersedBoundary \ + -lfiniteVolume \ + -lmeshTools \ + -lsurfMesh \ + -lsampling \ + -ldynamicMesh \ + -ldynamicFvMesh \ + -lsolidBodyMotion diff --git a/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundarySolidBodyMotionFvMesh/immersedBoundarySolidBodyMotionFvMesh.C b/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundarySolidBodyMotionFvMesh/immersedBoundarySolidBodyMotionFvMesh.C new file mode 100644 index 000000000..c779c4b39 --- /dev/null +++ b/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundarySolidBodyMotionFvMesh/immersedBoundarySolidBodyMotionFvMesh.C @@ -0,0 +1,119 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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 2 of the License, or (at your + option) any later version. + + OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "immersedBoundarySolidBodyMotionFvMesh.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(immersedBoundarySolidBodyMotionFvMesh, 0); + addToRunTimeSelectionTable + ( + dynamicFvMesh, + immersedBoundarySolidBodyMotionFvMesh, + IOobject + ); +} + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::immersedBoundarySolidBodyMotionFvMesh:: +immersedBoundarySolidBodyMotionFvMesh +( + const IOobject& io +) +: + dynamicFvMesh(io), + dynamicMeshCoeffs_ + ( + IOdictionary + ( + IOobject + ( + "dynamicMeshDict", + time().constant(), + *this, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ).subDict(typeName + "Coeffs") + ), + ibMotions_() +{ + // Read motion function for all regions + PtrList motionDicts(dynamicMeshCoeffs_.lookup("motionFunctions")); + + ibMotions_.setSize(motionDicts.size()); + + forAll (motionDicts, mI) + { + ibMotions_.set + ( + mI, + new movingImmersedBoundary + ( + motionDicts[mI].keyword(), + *this, + motionDicts[mI].dict() + ) + ); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::immersedBoundarySolidBodyMotionFvMesh:: +~immersedBoundarySolidBodyMotionFvMesh() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::immersedBoundarySolidBodyMotionFvMesh::update() +{ + forAll (ibMotions_, ibI) + { + ibMotions_[ibI].movePoints(); + } + + // Force flux and addressing recalculation as in topo change + pointField newAllPoints = allPoints(); + + movePoints(newAllPoints); + + return true; +} + + +// ************************************************************************* // diff --git a/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundarySolidBodyMotionFvMesh/immersedBoundarySolidBodyMotionFvMesh.H b/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundarySolidBodyMotionFvMesh/immersedBoundarySolidBodyMotionFvMesh.H new file mode 100644 index 000000000..9c4ea6389 --- /dev/null +++ b/src/immersedBoundary/immersedBoundaryDynamicMesh/immersedBoundarySolidBodyMotionFvMesh/immersedBoundarySolidBodyMotionFvMesh.H @@ -0,0 +1,112 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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 2 of the License, or (at your + option) any later version. + + OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::immersedBoundarySolidBodyMotionFvMesh + +Description + Solid-body motion of the immersed boundary mesh specified by a + run-time selectable motion function for each immersed boundary surface + +SourceFiles + immersedBoundarySolidBodyMotionFvMesh.C + +\*---------------------------------------------------------------------------*/ + +#ifndef immersedBoundarySolidBodyMotionFvMesh_H +#define immersedBoundarySolidBodyMotionFvMesh_H + +#include "dynamicFvMesh.H" +#include "dictionary.H" +#include "movingImmersedBoundary.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class immersedBoundarySolidBodyMotionFvMesh Declaration +\*---------------------------------------------------------------------------*/ + +class immersedBoundarySolidBodyMotionFvMesh +: + public dynamicFvMesh +{ + // Private data + + //- Dictionary of motion control parameters + dictionary dynamicMeshCoeffs_; + + //- Immersed boundary motion control function + PtrList ibMotions_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + immersedBoundarySolidBodyMotionFvMesh + ( + const immersedBoundarySolidBodyMotionFvMesh& + ); + + //- Disallow default bitwise assignment + void operator= + ( + const immersedBoundarySolidBodyMotionFvMesh& + ); + + +public: + + //- Runtime type information + TypeName("immersedBoundarySolidBodyMotionFvMesh"); + + + // Constructors + + //- Construct from IOobject + explicit immersedBoundarySolidBodyMotionFvMesh(const IOobject& io); + + + // Destructor + virtual ~immersedBoundarySolidBodyMotionFvMesh(); + + + // Member Functions + + //- Update the mesh for both mesh motion and topology change + virtual bool update(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/immersedBoundary/immersedBoundaryDynamicMesh/movingImmersedBoundary/movingImmersedBoundary.C b/src/immersedBoundary/immersedBoundaryDynamicMesh/movingImmersedBoundary/movingImmersedBoundary.C new file mode 100644 index 000000000..f9e1dacf8 --- /dev/null +++ b/src/immersedBoundary/immersedBoundaryDynamicMesh/movingImmersedBoundary/movingImmersedBoundary.C @@ -0,0 +1,98 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | + \\ / A nd | For copyright notice see file Copyright + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend 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. + + foam-extend 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 foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "movingImmersedBoundary.H" +#include "immersedBoundaryPolyPatch.H" +#include "transformField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::movingImmersedBoundary::movingImmersedBoundary +( + const word& name, + const fvMesh& mesh, + const dictionary& dict +) +: + name_(name), + mesh_(mesh), + sbmfPtr_(solidBodyMotionFunction::New(dict, mesh.time())), + refIbSurface_ + ( + IOobject + ( + name + ".ftr", + mesh.time().constant(), // instance + "triSurface", // local + mesh, // registry + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::movingImmersedBoundary::~movingImmersedBoundary() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::movingImmersedBoundary::movePoints() const +{ + // Get ibMesh from patch + const label patchID = mesh().boundaryMesh().findPatchID(name()); + + if (patchID < 0) + { + FatalErrorIn + ( + "void movingImmersedBoundary::movePoints() const" + ) << "Patch " << name() << " not found. Available patch names: " + << mesh().boundaryMesh().names() + << abort(FatalError); + } + + const immersedBoundaryPolyPatch& cibPatch = + refCast + ( + mesh().boundaryMesh()[patchID] + ); + + // Get non-const reference to patch + immersedBoundaryPolyPatch& ibPatch = + const_cast(cibPatch); + + // Move points + ibPatch.moveTriSurfacePoints + ( + transform(sbmfPtr_->transformation(), refIbSurface_.points()) + ); +} + + +// ************************************************************************* // diff --git a/src/immersedBoundary/immersedBoundaryDynamicMesh/movingImmersedBoundary/movingImmersedBoundary.H b/src/immersedBoundary/immersedBoundaryDynamicMesh/movingImmersedBoundary/movingImmersedBoundary.H new file mode 100644 index 000000000..6ab636eaa --- /dev/null +++ b/src/immersedBoundary/immersedBoundaryDynamicMesh/movingImmersedBoundary/movingImmersedBoundary.H @@ -0,0 +1,121 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | + \\ / A nd | For copyright notice see file Copyright + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend 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. + + foam-extend 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 foam-extend. If not, see . + +Class + Foam::movingImmersedBoundary + +Description + Moving immesed boundary. Motion is prescribed using a solid body motion + function. + +SourceFiles + movingImmersedBoundary.C + +\*---------------------------------------------------------------------------*/ + +#ifndef movingImmersedBoundary_H +#define movingImmersedBoundary_H + +#include "fvMesh.H" +#include "solidBodyMotionFunction.H" +#include "triSurfaceMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class movingImmersedBoundary Declaration +\*---------------------------------------------------------------------------*/ + +class movingImmersedBoundary +{ + // Private data + + //- Patch name + const word name_; + + //- Mesh reference + const fvMesh& mesh_; + + //- Overset region motion control function + autoPtr sbmfPtr_; + + //- Reference tri surface mesh position + triSurfaceMesh refIbSurface_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + movingImmersedBoundary(const movingImmersedBoundary&); + + //- Disallow default bitwise assignment + void operator=(const movingImmersedBoundary&); + + +public: + + // Constructors + + //- Construct from dictionary + movingImmersedBoundary + ( + const word& name, + const fvMesh& mesh, + const dictionary& dict + ); + + + //- Destructor + ~movingImmersedBoundary(); + + // Member Functions + + //- Return name + const word& name() const + { + return name_; + } + + //- Return mesh + const fvMesh& mesh() const + { + return mesh_; + } + + //- Move immersed boundary patch points + void movePoints() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/.gitignore b/tutorials/immersedBoundary/movingCylinderInChannelIco/.gitignore new file mode 100644 index 000000000..f42669c4e --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/.gitignore @@ -0,0 +1,52 @@ +# git-ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. + +# editor and misc backup files - anywhere +*~ +.*~ +*.bak +*.bak[0-9][0-9] +*.orig +*.orig[0-9][0-9] +\#*\# + +# file-browser settings - anywhere +.directory + +# CVS recovered versions - anywhere +.#* + +# SVN directories - anywhere + +.svn/ + +# OpenFOAM results + +[1-9]*/ +!/0/ +processor* +*/polyMesh/* +!*/polyMesh/blockMeshDict +cellToRegion* +log* + +# packages - anywhere + +*.tar.bz2 +*.tar.gz +*.tar +*.tgz +*.gtgz + +# Pictures and movies + +*.png +*.jpg +*.jpeg +*.bmp +*.png +*.avi +*.mp4 +*.mpg + +#end-of-file diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/0_org/U b/tutorials/immersedBoundary/movingCylinderInChannelIco/0_org/U new file mode 100644 index 000000000..88a4980f5 --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/0_org/U @@ -0,0 +1,65 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | foam-extend: Open Source CFD | +| \\ / O peration | Version: 3.2 | +| \\ / A nd | Web: http://www.foam-extend.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (1 0 0); + +boundaryField +{ + ibCylinder + { + type immersedBoundary; + refValue uniform (0 0 0); + refGradient uniform (0 0 0); + fixesValue yes; + + setDeadCellValue yes; + deadCellValue (0 0 0); + } + + in + { + type fixedValue; + value uniform (1 0 0); + } + + out + { + type inletOutlet; + inletValue uniform (0 0 0); + value uniform (1 0 0); + } + + top + { + type fixedValue; + value uniform (0 0 0); + } + + bottom + { + type fixedValue; + value uniform (0 0 0); + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/0_org/p b/tutorials/immersedBoundary/movingCylinderInChannelIco/0_org/p new file mode 100644 index 000000000..1a2c3d8c7 --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/0_org/p @@ -0,0 +1,65 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | foam-extend: Open Source CFD | +| \\ / O peration | Version: 3.2 | +| \\ / A nd | Web: http://www.foam-extend.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + ibCylinder + { + type immersedBoundary; + refValue uniform 0; + refGradient uniform 0; + fixesValue no; + + setDeadCellValue yes; + deadCellValue 0; + + value uniform 0; + } + + in + { + type zeroGradient; + } + + out + { +// type zeroGradient; + + type fixedValue; + value uniform 0; + } + + top + { + type zeroGradient; + } + + bottom + { + type zeroGradient; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/Allclean b/tutorials/immersedBoundary/movingCylinderInChannelIco/Allclean new file mode 100755 index 000000000..cdfb5bacf --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/Allclean @@ -0,0 +1,9 @@ +#!/bin/sh + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase + +\rm -rf 0 +\rm -f constant/polyMesh/boundary diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/Allrun b/tutorials/immersedBoundary/movingCylinderInChannelIco/Allrun new file mode 100755 index 000000000..d2530784e --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/Allrun @@ -0,0 +1,15 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Get application name +application="icoDyMIbFoam" + +runApplication blockMesh +\cp save/boundary constant/polyMesh/ + +mkdir 0 +\cp -f 0_org/* 0/ + +runApplication potentialIbFoam +runApplication $application diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/dynamicMeshDict b/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/dynamicMeshDict new file mode 100644 index 000000000..e5d3bda4e --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/dynamicMeshDict @@ -0,0 +1,899 @@ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | foam-extend: Open Source CFD | +| \\ / O peration | Version: 3.2 | +| \\ / A nd | Web: http://www.foam-extend.org | +| \\/ M anipulation | For copyright notice see file Copyright | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// dynamicFvMesh staticFvMesh; +dynamicFvMesh immersedBoundarySolidBodyMotionFvMesh; + +immersedBoundarySolidBodyMotionFvMeshCoeffs +{ + motionFunctions + ( + ibCylinder + { +// solidBodyMotionFunction translation; +// translationCoeffs +// { +// velocity (0.1 0 0); +// } + + solidBodyMotionFunction linearOscillation; + linearOscillationCoeffs + { + amplitude (0.5 0 0); + period 2.5; + } + } + ); +} + + +// ************************************************************************* // diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/polyMesh/blockMeshDict b/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/polyMesh/blockMeshDict new file mode 100644 index 000000000..070ca5469 --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/polyMesh/blockMeshDict @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | foam-extend: Open Source CFD | +| \\ / O peration | Version: 3.2 | +| \\ / A nd | Web: http://www.foam-extend.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + (-1 -0.5 0) + (2 -0.5 0) + (2 0.5 0) + (-1 0.5 0) + (-1 -0.5 0.1) + (2 -0.5 0.1) + (2 0.5 0.1) + (-1 0.5 0.1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (75 25 1) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + patch in + ( + (0 4 7 3) + ) + patch out + ( + (2 6 5 1) + ) + patch top + ( + (3 7 6 2) + ) + patch bottom + ( + (1 5 4 0) + ) + empty frontAndBack + ( + (0 3 2 1) + (4 5 6 7) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/transportProperties b/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/transportProperties new file mode 100644 index 000000000..2bd6cf228 --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/transportProperties @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | foam-extend: Open Source CFD | +| \\ / O peration | Version: 3.2 | +| \\ / A nd | Web: http://www.foam-extend.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +nu nu [0 2 -1 0 0 0 0] 0.01; + +// ************************************************************************* // diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/triSurface/ibCylinder.ftr b/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/triSurface/ibCylinder.ftr new file mode 100644 index 000000000..70df0a4b4 --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/triSurface/ibCylinder.ftr @@ -0,0 +1,210 @@ + +1 +( + +cylinder +empty +) + + +96 +( +(0.176776 -0.176776 0) +(0.176776 0.176776 0) +(-0.176776 0.176776 0) +(-0.176776 -0.176776 0) +(0.241481 -0.064705 0) +(0.241481 0.064705 0) +(0.064705 0.241481 0) +(-0.064705 0.241481 0) +(-0.241481 0.064705 0) +(-0.241481 -0.064705 0) +(0.064705 -0.241481 0) +(-0.064705 -0.241481 0) +(0.216506 -0.125 0) +(0.216506 0.125 0) +(0.125 0.216506 0) +(-0.125 0.216506 0) +(-0.216506 0.125 0) +(-0.216506 -0.125 0) +(0.125 -0.216506 0) +(-0.125 -0.216506 0) +(0.247861 -0.0326315 0) +(0.247861 0.0326315 0) +(0.0326315 0.247861 0) +(-0.0326315 0.247861 0) +(-0.247861 0.0326315 0) +(-0.247861 -0.0326315 0) +(0.0326315 -0.247861 0) +(-0.0326315 -0.247861 0) +(0.25 8.32665e-17 0) +(-8.32665e-17 0.25 0) +(-0.25 -8.32665e-17 0) +(8.32665e-17 -0.25 0) +(0.198338 -0.152191 0) +(0.198338 0.152191 0) +(0.152191 0.198338 0) +(-0.152191 0.198338 0) +(-0.198338 0.152191 0) +(-0.198338 -0.152191 0) +(0.152191 -0.198338 0) +(-0.152191 -0.198338 0) +(0.23097 -0.095671 0) +(0.23097 0.095671 0) +(0.095671 0.23097 0) +(-0.095671 0.23097 0) +(-0.23097 0.095671 0) +(-0.23097 -0.095671 0) +(0.095671 -0.23097 0) +(-0.095671 -0.23097 0) +(0.176776 -0.176776 0.1) +(0.176776 0.176776 0.1) +(-0.176776 0.176776 0.1) +(-0.176776 -0.176776 0.1) +(0.241481 -0.064705 0.1) +(0.241481 0.064705 0.1) +(0.064705 0.241481 0.1) +(-0.064705 0.241481 0.1) +(-0.241481 0.064705 0.1) +(-0.241481 -0.064705 0.1) +(0.064705 -0.241481 0.1) +(-0.064705 -0.241481 0.1) +(0.216506 -0.125 0.1) +(0.216506 0.125 0.1) +(0.125 0.216506 0.1) +(-0.125 0.216506 0.1) +(-0.216506 0.125 0.1) +(-0.216506 -0.125 0.1) +(0.125 -0.216506 0.1) +(-0.125 -0.216506 0.1) +(0.247861 -0.0326315 0.1) +(0.247861 0.0326315 0.1) +(0.0326315 0.247861 0.1) +(-0.0326315 0.247861 0.1) +(-0.247861 0.0326315 0.1) +(-0.247861 -0.0326315 0.1) +(0.0326315 -0.247861 0.1) +(-0.0326315 -0.247861 0.1) +(0.25 -8.32665e-17 0.1) +(8.32665e-17 0.25 0.1) +(-0.25 8.32665e-17 0.1) +(-8.32665e-17 -0.25 0.1) +(0.198338 -0.152191 0.1) +(0.198338 0.152191 0.1) +(0.152191 0.198338 0.1) +(-0.152191 0.198338 0.1) +(-0.198338 0.152191 0.1) +(-0.198338 -0.152191 0.1) +(0.152191 -0.198338 0.1) +(-0.152191 -0.198338 0.1) +(0.23097 -0.095671 0.1) +(0.23097 0.095671 0.1) +(0.095671 0.23097 0.1) +(-0.095671 0.23097 0.1) +(-0.23097 0.095671 0.1) +(-0.23097 -0.095671 0.1) +(0.095671 -0.23097 0.1) +(-0.095671 -0.23097 0.1) +) + + +96 +( +((0 32 80) 0) +((80 48 0) 0) +((32 12 60) 0) +((60 80 32) 0) +((12 40 88) 0) +((88 60 12) 0) +((40 4 52) 0) +((52 88 40) 0) +((4 20 68) 0) +((68 52 4) 0) +((76 68 20) 0) +((20 28 76) 0) +((28 21 69) 0) +((69 76 28) 0) +((21 5 53) 0) +((53 69 21) 0) +((5 41 89) 0) +((89 53 5) 0) +((41 13 61) 0) +((61 89 41) 0) +((13 33 81) 0) +((81 61 13) 0) +((33 1 49) 0) +((49 81 33) 0) +((1 34 82) 0) +((82 49 1) 0) +((34 14 62) 0) +((62 82 34) 0) +((14 42 90) 0) +((90 62 14) 0) +((42 6 54) 0) +((54 90 42) 0) +((6 22 70) 0) +((70 54 6) 0) +((77 70 22) 0) +((22 29 77) 0) +((29 23 71) 0) +((71 77 29) 0) +((23 7 55) 0) +((55 71 23) 0) +((7 43 91) 0) +((91 55 7) 0) +((43 15 63) 0) +((63 91 43) 0) +((15 35 83) 0) +((83 63 15) 0) +((35 2 50) 0) +((50 83 35) 0) +((2 36 84) 0) +((84 50 2) 0) +((36 16 64) 0) +((64 84 36) 0) +((16 44 92) 0) +((92 64 16) 0) +((44 8 56) 0) +((56 92 44) 0) +((8 24 72) 0) +((72 56 8) 0) +((78 72 24) 0) +((24 30 78) 0) +((30 25 73) 0) +((73 78 30) 0) +((25 9 57) 0) +((57 73 25) 0) +((9 45 93) 0) +((93 57 9) 0) +((45 17 65) 0) +((65 93 45) 0) +((17 37 85) 0) +((85 65 17) 0) +((37 3 51) 0) +((51 85 37) 0) +((0 48 86) 0) +((86 38 0) 0) +((38 86 66) 0) +((66 18 38) 0) +((18 66 94) 0) +((94 46 18) 0) +((46 94 58) 0) +((58 10 46) 0) +((10 58 74) 0) +((74 26 10) 0) +((31 26 74) 0) +((74 79 31) 0) +((79 75 27) 0) +((27 31 79) 0) +((27 75 59) 0) +((59 11 27) 0) +((11 59 95) 0) +((95 47 11) 0) +((47 95 67) 0) +((67 19 47) 0) +((19 67 87) 0) +((87 39 19) 0) +((39 87 51) 0) +((51 3 39) 0) +) + diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/triSurface/ibCylinder.stl b/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/triSurface/ibCylinder.stl new file mode 100644 index 000000000..5c7847333 --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/triSurface/ibCylinder.stl @@ -0,0 +1,674 @@ +solid cylinder + facet normal 0.75183 -0.659357 0 + outer loop + vertex 0.176776 -0.176776 0 + vertex 0.198338 -0.152191 0 + vertex 0.198338 -0.152191 0.1 + endloop + endfacet + facet normal 0.75183 -0.659357 0 + outer loop + vertex 0.198338 -0.152191 0.1 + vertex 0.176776 -0.176776 0.1 + vertex 0.176776 -0.176776 0 + endloop + endfacet + facet normal 0.831471 -0.555568 0 + outer loop + vertex 0.198338 -0.152191 0 + vertex 0.216506 -0.125 0 + vertex 0.216506 -0.125 0.1 + endloop + endfacet + facet normal 0.831471 -0.555568 0 + outer loop + vertex 0.216506 -0.125 0.1 + vertex 0.198338 -0.152191 0.1 + vertex 0.198338 -0.152191 0 + endloop + endfacet + facet normal 0.896872 -0.44229 0 + outer loop + vertex 0.216506 -0.125 0 + vertex 0.23097 -0.095671 0 + vertex 0.23097 -0.095671 0.1 + endloop + endfacet + facet normal 0.896872 -0.44229 0 + outer loop + vertex 0.23097 -0.095671 0.1 + vertex 0.216506 -0.125 0.1 + vertex 0.216506 -0.125 0 + endloop + endfacet + facet normal 0.94693 -0.321438 0 + outer loop + vertex 0.23097 -0.095671 0 + vertex 0.241481 -0.064705 0 + vertex 0.241481 -0.064705 0.1 + endloop + endfacet + facet normal 0.94693 -0.321438 0 + outer loop + vertex 0.241481 -0.064705 0.1 + vertex 0.23097 -0.095671 0.1 + vertex 0.23097 -0.095671 0 + endloop + endfacet + facet normal 0.980787 -0.195081 0 + outer loop + vertex 0.241481 -0.064705 0 + vertex 0.247861 -0.0326315 0 + vertex 0.247861 -0.0326315 0.1 + endloop + endfacet + facet normal 0.980787 -0.195081 0 + outer loop + vertex 0.247861 -0.0326315 0.1 + vertex 0.241481 -0.064705 0.1 + vertex 0.241481 -0.064705 0 + endloop + endfacet + facet normal 0.997858 -0.0654097 0 + outer loop + vertex 0.25 -8.32665e-17 0.1 + vertex 0.247861 -0.0326315 0.1 + vertex 0.247861 -0.0326315 0 + endloop + endfacet + facet normal 0.997858 -0.0654097 -1.07752e-16 + outer loop + vertex 0.247861 -0.0326315 0 + vertex 0.25 8.32665e-17 0 + vertex 0.25 -8.32665e-17 0.1 + endloop + endfacet + facet normal 0.997858 0.0654097 0 + outer loop + vertex 0.25 8.32665e-17 0 + vertex 0.247861 0.0326315 0 + vertex 0.247861 0.0326315 0.1 + endloop + endfacet + facet normal 0.997858 0.0654097 1.07752e-16 + outer loop + vertex 0.247861 0.0326315 0.1 + vertex 0.25 -8.32665e-17 0.1 + vertex 0.25 8.32665e-17 0 + endloop + endfacet + facet normal 0.980787 0.195081 0 + outer loop + vertex 0.247861 0.0326315 0 + vertex 0.241481 0.064705 0 + vertex 0.241481 0.064705 0.1 + endloop + endfacet + facet normal 0.980787 0.195081 0 + outer loop + vertex 0.241481 0.064705 0.1 + vertex 0.247861 0.0326315 0.1 + vertex 0.247861 0.0326315 0 + endloop + endfacet + facet normal 0.94693 0.321438 0 + outer loop + vertex 0.241481 0.064705 0 + vertex 0.23097 0.095671 0 + vertex 0.23097 0.095671 0.1 + endloop + endfacet + facet normal 0.94693 0.321438 0 + outer loop + vertex 0.23097 0.095671 0.1 + vertex 0.241481 0.064705 0.1 + vertex 0.241481 0.064705 0 + endloop + endfacet + facet normal 0.896872 0.44229 0 + outer loop + vertex 0.23097 0.095671 0 + vertex 0.216506 0.125 0 + vertex 0.216506 0.125 0.1 + endloop + endfacet + facet normal 0.896872 0.44229 0 + outer loop + vertex 0.216506 0.125 0.1 + vertex 0.23097 0.095671 0.1 + vertex 0.23097 0.095671 0 + endloop + endfacet + facet normal 0.831471 0.555568 0 + outer loop + vertex 0.216506 0.125 0 + vertex 0.198338 0.152191 0 + vertex 0.198338 0.152191 0.1 + endloop + endfacet + facet normal 0.831471 0.555568 0 + outer loop + vertex 0.198338 0.152191 0.1 + vertex 0.216506 0.125 0.1 + vertex 0.216506 0.125 0 + endloop + endfacet + facet normal 0.75183 0.659357 0 + outer loop + vertex 0.198338 0.152191 0 + vertex 0.176776 0.176776 0 + vertex 0.176776 0.176776 0.1 + endloop + endfacet + facet normal 0.75183 0.659357 0 + outer loop + vertex 0.176776 0.176776 0.1 + vertex 0.198338 0.152191 0.1 + vertex 0.198338 0.152191 0 + endloop + endfacet + facet normal 0.659357 0.75183 0 + outer loop + vertex 0.176776 0.176776 0 + vertex 0.152191 0.198338 0 + vertex 0.152191 0.198338 0.1 + endloop + endfacet + facet normal 0.659357 0.75183 0 + outer loop + vertex 0.152191 0.198338 0.1 + vertex 0.176776 0.176776 0.1 + vertex 0.176776 0.176776 0 + endloop + endfacet + facet normal 0.555568 0.831471 0 + outer loop + vertex 0.152191 0.198338 0 + vertex 0.125 0.216506 0 + vertex 0.125 0.216506 0.1 + endloop + endfacet + facet normal 0.555568 0.831471 0 + outer loop + vertex 0.125 0.216506 0.1 + vertex 0.152191 0.198338 0.1 + vertex 0.152191 0.198338 0 + endloop + endfacet + facet normal 0.44229 0.896872 0 + outer loop + vertex 0.125 0.216506 0 + vertex 0.095671 0.23097 0 + vertex 0.095671 0.23097 0.1 + endloop + endfacet + facet normal 0.44229 0.896872 0 + outer loop + vertex 0.095671 0.23097 0.1 + vertex 0.125 0.216506 0.1 + vertex 0.125 0.216506 0 + endloop + endfacet + facet normal 0.321438 0.94693 0 + outer loop + vertex 0.095671 0.23097 0 + vertex 0.064705 0.241481 0 + vertex 0.064705 0.241481 0.1 + endloop + endfacet + facet normal 0.321438 0.94693 0 + outer loop + vertex 0.064705 0.241481 0.1 + vertex 0.095671 0.23097 0.1 + vertex 0.095671 0.23097 0 + endloop + endfacet + facet normal 0.195081 0.980787 0 + outer loop + vertex 0.064705 0.241481 0 + vertex 0.0326315 0.247861 0 + vertex 0.0326315 0.247861 0.1 + endloop + endfacet + facet normal 0.195081 0.980787 0 + outer loop + vertex 0.0326315 0.247861 0.1 + vertex 0.064705 0.241481 0.1 + vertex 0.064705 0.241481 0 + endloop + endfacet + facet normal 0.0654097 0.997858 0 + outer loop + vertex 8.32665e-17 0.25 0.1 + vertex 0.0326315 0.247861 0.1 + vertex 0.0326315 0.247861 0 + endloop + endfacet + facet normal 0.0654097 0.997858 -1.07752e-16 + outer loop + vertex 0.0326315 0.247861 0 + vertex -8.32665e-17 0.25 0 + vertex 8.32665e-17 0.25 0.1 + endloop + endfacet + facet normal -0.0654097 0.997858 0 + outer loop + vertex -8.32665e-17 0.25 0 + vertex -0.0326315 0.247861 0 + vertex -0.0326315 0.247861 0.1 + endloop + endfacet + facet normal -0.0654097 0.997858 1.07752e-16 + outer loop + vertex -0.0326315 0.247861 0.1 + vertex 8.32665e-17 0.25 0.1 + vertex -8.32665e-17 0.25 0 + endloop + endfacet + facet normal -0.195081 0.980787 0 + outer loop + vertex -0.0326315 0.247861 0 + vertex -0.064705 0.241481 0 + vertex -0.064705 0.241481 0.1 + endloop + endfacet + facet normal -0.195081 0.980787 0 + outer loop + vertex -0.064705 0.241481 0.1 + vertex -0.0326315 0.247861 0.1 + vertex -0.0326315 0.247861 0 + endloop + endfacet + facet normal -0.321438 0.94693 0 + outer loop + vertex -0.064705 0.241481 0 + vertex -0.095671 0.23097 0 + vertex -0.095671 0.23097 0.1 + endloop + endfacet + facet normal -0.321438 0.94693 0 + outer loop + vertex -0.095671 0.23097 0.1 + vertex -0.064705 0.241481 0.1 + vertex -0.064705 0.241481 0 + endloop + endfacet + facet normal -0.44229 0.896872 0 + outer loop + vertex -0.095671 0.23097 0 + vertex -0.125 0.216506 0 + vertex -0.125 0.216506 0.1 + endloop + endfacet + facet normal -0.44229 0.896872 0 + outer loop + vertex -0.125 0.216506 0.1 + vertex -0.095671 0.23097 0.1 + vertex -0.095671 0.23097 0 + endloop + endfacet + facet normal -0.555568 0.831471 0 + outer loop + vertex -0.125 0.216506 0 + vertex -0.152191 0.198338 0 + vertex -0.152191 0.198338 0.1 + endloop + endfacet + facet normal -0.555568 0.831471 0 + outer loop + vertex -0.152191 0.198338 0.1 + vertex -0.125 0.216506 0.1 + vertex -0.125 0.216506 0 + endloop + endfacet + facet normal -0.659357 0.75183 0 + outer loop + vertex -0.152191 0.198338 0 + vertex -0.176776 0.176776 0 + vertex -0.176776 0.176776 0.1 + endloop + endfacet + facet normal -0.659357 0.75183 0 + outer loop + vertex -0.176776 0.176776 0.1 + vertex -0.152191 0.198338 0.1 + vertex -0.152191 0.198338 0 + endloop + endfacet + facet normal -0.75183 0.659357 0 + outer loop + vertex -0.176776 0.176776 0 + vertex -0.198338 0.152191 0 + vertex -0.198338 0.152191 0.1 + endloop + endfacet + facet normal -0.75183 0.659357 0 + outer loop + vertex -0.198338 0.152191 0.1 + vertex -0.176776 0.176776 0.1 + vertex -0.176776 0.176776 0 + endloop + endfacet + facet normal -0.831471 0.555568 0 + outer loop + vertex -0.198338 0.152191 0 + vertex -0.216506 0.125 0 + vertex -0.216506 0.125 0.1 + endloop + endfacet + facet normal -0.831471 0.555568 0 + outer loop + vertex -0.216506 0.125 0.1 + vertex -0.198338 0.152191 0.1 + vertex -0.198338 0.152191 0 + endloop + endfacet + facet normal -0.896872 0.44229 0 + outer loop + vertex -0.216506 0.125 0 + vertex -0.23097 0.095671 0 + vertex -0.23097 0.095671 0.1 + endloop + endfacet + facet normal -0.896872 0.44229 0 + outer loop + vertex -0.23097 0.095671 0.1 + vertex -0.216506 0.125 0.1 + vertex -0.216506 0.125 0 + endloop + endfacet + facet normal -0.94693 0.321438 0 + outer loop + vertex -0.23097 0.095671 0 + vertex -0.241481 0.064705 0 + vertex -0.241481 0.064705 0.1 + endloop + endfacet + facet normal -0.94693 0.321438 0 + outer loop + vertex -0.241481 0.064705 0.1 + vertex -0.23097 0.095671 0.1 + vertex -0.23097 0.095671 0 + endloop + endfacet + facet normal -0.980787 0.195081 0 + outer loop + vertex -0.241481 0.064705 0 + vertex -0.247861 0.0326315 0 + vertex -0.247861 0.0326315 0.1 + endloop + endfacet + facet normal -0.980787 0.195081 0 + outer loop + vertex -0.247861 0.0326315 0.1 + vertex -0.241481 0.064705 0.1 + vertex -0.241481 0.064705 0 + endloop + endfacet + facet normal -0.997858 0.0654097 0 + outer loop + vertex -0.25 8.32665e-17 0.1 + vertex -0.247861 0.0326315 0.1 + vertex -0.247861 0.0326315 0 + endloop + endfacet + facet normal -0.997858 0.0654097 -1.07752e-16 + outer loop + vertex -0.247861 0.0326315 0 + vertex -0.25 -8.32665e-17 0 + vertex -0.25 8.32665e-17 0.1 + endloop + endfacet + facet normal -0.997858 -0.0654097 0 + outer loop + vertex -0.25 -8.32665e-17 0 + vertex -0.247861 -0.0326315 0 + vertex -0.247861 -0.0326315 0.1 + endloop + endfacet + facet normal -0.997858 -0.0654097 1.07752e-16 + outer loop + vertex -0.247861 -0.0326315 0.1 + vertex -0.25 8.32665e-17 0.1 + vertex -0.25 -8.32665e-17 0 + endloop + endfacet + facet normal -0.980787 -0.195081 0 + outer loop + vertex -0.247861 -0.0326315 0 + vertex -0.241481 -0.064705 0 + vertex -0.241481 -0.064705 0.1 + endloop + endfacet + facet normal -0.980787 -0.195081 0 + outer loop + vertex -0.241481 -0.064705 0.1 + vertex -0.247861 -0.0326315 0.1 + vertex -0.247861 -0.0326315 0 + endloop + endfacet + facet normal -0.94693 -0.321438 0 + outer loop + vertex -0.241481 -0.064705 0 + vertex -0.23097 -0.095671 0 + vertex -0.23097 -0.095671 0.1 + endloop + endfacet + facet normal -0.94693 -0.321438 0 + outer loop + vertex -0.23097 -0.095671 0.1 + vertex -0.241481 -0.064705 0.1 + vertex -0.241481 -0.064705 0 + endloop + endfacet + facet normal -0.896872 -0.44229 0 + outer loop + vertex -0.23097 -0.095671 0 + vertex -0.216506 -0.125 0 + vertex -0.216506 -0.125 0.1 + endloop + endfacet + facet normal -0.896872 -0.44229 0 + outer loop + vertex -0.216506 -0.125 0.1 + vertex -0.23097 -0.095671 0.1 + vertex -0.23097 -0.095671 0 + endloop + endfacet + facet normal -0.831471 -0.555568 0 + outer loop + vertex -0.216506 -0.125 0 + vertex -0.198338 -0.152191 0 + vertex -0.198338 -0.152191 0.1 + endloop + endfacet + facet normal -0.831471 -0.555568 0 + outer loop + vertex -0.198338 -0.152191 0.1 + vertex -0.216506 -0.125 0.1 + vertex -0.216506 -0.125 0 + endloop + endfacet + facet normal -0.75183 -0.659357 0 + outer loop + vertex -0.198338 -0.152191 0 + vertex -0.176776 -0.176776 0 + vertex -0.176776 -0.176776 0.1 + endloop + endfacet + facet normal -0.75183 -0.659357 0 + outer loop + vertex -0.176776 -0.176776 0.1 + vertex -0.198338 -0.152191 0.1 + vertex -0.198338 -0.152191 0 + endloop + endfacet + facet normal 0.659357 -0.75183 0 + outer loop + vertex 0.176776 -0.176776 0 + vertex 0.176776 -0.176776 0.1 + vertex 0.152191 -0.198338 0.1 + endloop + endfacet + facet normal 0.659357 -0.75183 0 + outer loop + vertex 0.152191 -0.198338 0.1 + vertex 0.152191 -0.198338 0 + vertex 0.176776 -0.176776 0 + endloop + endfacet + facet normal 0.555568 -0.831471 0 + outer loop + vertex 0.152191 -0.198338 0 + vertex 0.152191 -0.198338 0.1 + vertex 0.125 -0.216506 0.1 + endloop + endfacet + facet normal 0.555568 -0.831471 0 + outer loop + vertex 0.125 -0.216506 0.1 + vertex 0.125 -0.216506 0 + vertex 0.152191 -0.198338 0 + endloop + endfacet + facet normal 0.44229 -0.896872 0 + outer loop + vertex 0.125 -0.216506 0 + vertex 0.125 -0.216506 0.1 + vertex 0.095671 -0.23097 0.1 + endloop + endfacet + facet normal 0.44229 -0.896872 0 + outer loop + vertex 0.095671 -0.23097 0.1 + vertex 0.095671 -0.23097 0 + vertex 0.125 -0.216506 0 + endloop + endfacet + facet normal 0.321438 -0.94693 0 + outer loop + vertex 0.095671 -0.23097 0 + vertex 0.095671 -0.23097 0.1 + vertex 0.064705 -0.241481 0.1 + endloop + endfacet + facet normal 0.321438 -0.94693 0 + outer loop + vertex 0.064705 -0.241481 0.1 + vertex 0.064705 -0.241481 0 + vertex 0.095671 -0.23097 0 + endloop + endfacet + facet normal 0.195081 -0.980787 0 + outer loop + vertex 0.064705 -0.241481 0 + vertex 0.064705 -0.241481 0.1 + vertex 0.0326315 -0.247861 0.1 + endloop + endfacet + facet normal 0.195081 -0.980787 0 + outer loop + vertex 0.0326315 -0.247861 0.1 + vertex 0.0326315 -0.247861 0 + vertex 0.064705 -0.241481 0 + endloop + endfacet + facet normal 0.0654097 -0.997858 0 + outer loop + vertex 8.32665e-17 -0.25 0 + vertex 0.0326315 -0.247861 0 + vertex 0.0326315 -0.247861 0.1 + endloop + endfacet + facet normal 0.0654097 -0.997858 1.07752e-16 + outer loop + vertex 0.0326315 -0.247861 0.1 + vertex -8.32665e-17 -0.25 0.1 + vertex 8.32665e-17 -0.25 0 + endloop + endfacet + facet normal -0.0654097 -0.997858 0 + outer loop + vertex -8.32665e-17 -0.25 0.1 + vertex -0.0326315 -0.247861 0.1 + vertex -0.0326315 -0.247861 0 + endloop + endfacet + facet normal -0.0654097 -0.997858 -1.07752e-16 + outer loop + vertex -0.0326315 -0.247861 0 + vertex 8.32665e-17 -0.25 0 + vertex -8.32665e-17 -0.25 0.1 + endloop + endfacet + facet normal -0.195081 -0.980787 0 + outer loop + vertex -0.0326315 -0.247861 0 + vertex -0.0326315 -0.247861 0.1 + vertex -0.064705 -0.241481 0.1 + endloop + endfacet + facet normal -0.195081 -0.980787 -0 + outer loop + vertex -0.064705 -0.241481 0.1 + vertex -0.064705 -0.241481 0 + vertex -0.0326315 -0.247861 0 + endloop + endfacet + facet normal -0.321438 -0.94693 0 + outer loop + vertex -0.064705 -0.241481 0 + vertex -0.064705 -0.241481 0.1 + vertex -0.095671 -0.23097 0.1 + endloop + endfacet + facet normal -0.321438 -0.94693 -0 + outer loop + vertex -0.095671 -0.23097 0.1 + vertex -0.095671 -0.23097 0 + vertex -0.064705 -0.241481 0 + endloop + endfacet + facet normal -0.44229 -0.896872 0 + outer loop + vertex -0.095671 -0.23097 0 + vertex -0.095671 -0.23097 0.1 + vertex -0.125 -0.216506 0.1 + endloop + endfacet + facet normal -0.44229 -0.896872 -0 + outer loop + vertex -0.125 -0.216506 0.1 + vertex -0.125 -0.216506 0 + vertex -0.095671 -0.23097 0 + endloop + endfacet + facet normal -0.555568 -0.831471 0 + outer loop + vertex -0.125 -0.216506 0 + vertex -0.125 -0.216506 0.1 + vertex -0.152191 -0.198338 0.1 + endloop + endfacet + facet normal -0.555568 -0.831471 -0 + outer loop + vertex -0.152191 -0.198338 0.1 + vertex -0.152191 -0.198338 0 + vertex -0.125 -0.216506 0 + endloop + endfacet + facet normal -0.659357 -0.75183 0 + outer loop + vertex -0.152191 -0.198338 0 + vertex -0.152191 -0.198338 0.1 + vertex -0.176776 -0.176776 0.1 + endloop + endfacet + facet normal -0.659357 -0.75183 -0 + outer loop + vertex -0.176776 -0.176776 0.1 + vertex -0.176776 -0.176776 0 + vertex -0.152191 -0.198338 0 + endloop + endfacet +endsolid cylinder diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/save/blockMeshDict b/tutorials/immersedBoundary/movingCylinderInChannelIco/save/blockMeshDict new file mode 100644 index 000000000..070ca5469 --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/save/blockMeshDict @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | foam-extend: Open Source CFD | +| \\ / O peration | Version: 3.2 | +| \\ / A nd | Web: http://www.foam-extend.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + (-1 -0.5 0) + (2 -0.5 0) + (2 0.5 0) + (-1 0.5 0) + (-1 -0.5 0.1) + (2 -0.5 0.1) + (2 0.5 0.1) + (-1 0.5 0.1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (75 25 1) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + patch in + ( + (0 4 7 3) + ) + patch out + ( + (2 6 5 1) + ) + patch top + ( + (3 7 6 2) + ) + patch bottom + ( + (1 5 4 0) + ) + empty frontAndBack + ( + (0 3 2 1) + (4 5 6 7) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/save/boundary b/tutorials/immersedBoundary/movingCylinderInChannelIco/save/boundary new file mode 100644 index 000000000..6bacece3d --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/save/boundary @@ -0,0 +1,60 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | foam-extend: Open Source CFD | +| \\ / O peration | Version: 3.2 | +| \\ / A nd | Web: http://www.foam-extend.org | +| \\/ M anipulation | For copyright notice see file Copyright | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +6 +( + ibCylinder + { + type immersedBoundary; + nFaces 0; + startFace 3650; + + internalFlow no; + } + in + { + type patch; + nFaces 25; + startFace 3650; + } + out + { + type patch; + nFaces 25; + startFace 3675; + } + top + { + type patch; + nFaces 75; + startFace 3700; + } + bottom + { + type patch; + nFaces 75; + startFace 3775; + } + frontAndBack + { + type empty; + nFaces 3750; + startFace 3850; + } +) + +// ************************************************************************* // diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/system/controlDict b/tutorials/immersedBoundary/movingCylinderInChannelIco/system/controlDict new file mode 100644 index 000000000..21e890c9f --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/system/controlDict @@ -0,0 +1,83 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | foam-extend: Open Source CFD | +| \\ / O peration | Version: 3.2 | +| \\ / A nd | Web: http://www.foam-extend.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application icoDyMFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 5; + +deltaT 0.01; + +writeControl runTime; +writeInterval 0.2; + +// writeControl timeStep; +// writeInterval 1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression compressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep no; + +maxCo 0.2; + +libs +( + "libimmersedBoundary.so" + "libimmersedBoundaryDynamicFvMesh.so" +); + +functions +( + forces + { + type immersedBoundaryForces; + functionObjectLibs ("libimmersedBoundaryForceFunctionObject.so"); + + outputControl timeStep; + outputInterval 1; + patches ( ibCylinder ); + + pName p; + UName U; + rhoName rhoInf; + rhoInf 1; + + log true; + CofR ( 0 0 0 ); + + Aref 0.05; + Uref 1; + } +); + +// ************************************************************************* // diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/system/decomposeParDict b/tutorials/immersedBoundary/movingCylinderInChannelIco/system/decomposeParDict new file mode 100644 index 000000000..9107479e0 --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/system/decomposeParDict @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | foam-extend: Open Source CFD | +| \\ / O peration | Version: 3.2 | +| \\ / A nd | Web: http://www.foam-extend.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 10; + +method simple; + +simpleCoeffs +{ + n (5 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (1 1 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + processorWeights 4(1 1 1 1); +} + +manualCoeffs +{ + dataFile "cellDecomposition"; +} + +distributed no; + +roots +( +); + +// ************************************************************************* // diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/system/fvSchemes b/tutorials/immersedBoundary/movingCylinderInChannelIco/system/fvSchemes new file mode 100644 index 000000000..974b06b9a --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/system/fvSchemes @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | foam-extend: Open Source CFD | +| \\ / O peration | Version: 3.2 | +| \\ / A nd | Web: http://www.foam-extend.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss upwind; +} + +laplacianSchemes +{ + default none; + laplacian(nu,U) Gauss linear corrected; + laplacian((1|A(U)),p) Gauss linear corrected; + + laplacian(1,p) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; + interpolate(HbyA) linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + p; +} + +// ************************************************************************* // diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/system/fvSolution b/tutorials/immersedBoundary/movingCylinderInChannelIco/system/fvSolution new file mode 100644 index 000000000..515d57959 --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/system/fvSolution @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | foam-extend: Open Source CFD | +| \\ / O peration | Version: 3.2 | +| \\ / A nd | Web: http://www.foam-extend.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver amgSolver; + cycle W-cycle; + policy PAMG; + nPreSweeps 2; + nPostSweeps 2; + groupSize 4; + minCoarseEqns 4; + nMaxLevels 100; + scale on; + smoother symGaussSeidel; + + minIter 1; + maxIter 100; + tolerance 1e-7; + relTol 0.01; + } + + U + { + solver BiCGStab; + preconditioner ILU0; + + minIter 1; + maxIter 1000; + tolerance 1e-08; + relTol 0; + } +} + +SIMPLE +{ + nNonOrthogonalCorrectors 5; + + pRefPoint (0 -0.45 0.05); + pRefValue 0; +} + +PIMPLE +{ + nOuterCorrectors 1; + nCorrectors 4; + nNonOrthogonalCorrectors 0; + + pRefPoint (0 -0.45 0.05); + pRefValue 0; +} + +// ************************************************************************* // diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/system/mapFieldsDict b/tutorials/immersedBoundary/movingCylinderInChannelIco/system/mapFieldsDict new file mode 100644 index 000000000..66655e92f --- /dev/null +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/system/mapFieldsDict @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | foam-extend: Open Source CFD | +| \\ / O peration | Version: 3.2 | +| \\ / A nd | Web: http://www.foam-extend.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object mapFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// List of pairs of source/target patches for mapping +patchMap +( +// lid movingWall +); + +// List of target patches cutting the source domain (these need to be +// handled specially e.g. interpolated from internal values) +cuttingPatches +( +// fixedWalls +); + +// ************************************************************************* // From f092ab0a7c97e72675307fb61684ebd446bdde67 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Wed, 30 Sep 2015 16:16:21 +0100 Subject: [PATCH 29/33] Clean up corrupted file --- .../constant/dynamicMeshDict | 856 ------------------ 1 file changed, 856 deletions(-) diff --git a/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/dynamicMeshDict b/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/dynamicMeshDict index e5d3bda4e..b1c2f5245 100644 --- a/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/dynamicMeshDict +++ b/tutorials/immersedBoundary/movingCylinderInChannelIco/constant/dynamicMeshDict @@ -1,859 +1,3 @@ -+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | foam-extend: Open Source CFD | From 307a519444152122d7b25bd597592a26e11e9442 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 5 Oct 2015 15:25:33 +0100 Subject: [PATCH 30/33] HOTFIX: Adjust Windows build instructions repo --- doc/buildInstructions/Windows/README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/buildInstructions/Windows/README.txt b/doc/buildInstructions/Windows/README.txt index a620d5ac9..fa757824f 100644 --- a/doc/buildInstructions/Windows/README.txt +++ b/doc/buildInstructions/Windows/README.txt @@ -69,7 +69,7 @@ already have the correct tools installed on your system. using the command: - git clone --branch nextRelease git://git.code.sf.net/p/openfoam-extend/foam-extend-3.1 foam-extend-3.2 + git clone --branch nextRelease git://git.code.sf.net/p/foam-extend/foam-extend-3.2 5) Open a new MSYS shell and chdir to your foam-extend-3.2 source directory. From b0b48ae33875804f3282d29ef67d46e730ff37da Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 5 Oct 2015 15:25:33 +0100 Subject: [PATCH 31/33] HOTFIX: Adjust Windows build instructions repo --- doc/buildInstructions/Windows/README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/buildInstructions/Windows/README.txt b/doc/buildInstructions/Windows/README.txt index a620d5ac9..fa757824f 100644 --- a/doc/buildInstructions/Windows/README.txt +++ b/doc/buildInstructions/Windows/README.txt @@ -69,7 +69,7 @@ already have the correct tools installed on your system. using the command: - git clone --branch nextRelease git://git.code.sf.net/p/openfoam-extend/foam-extend-3.1 foam-extend-3.2 + git clone --branch nextRelease git://git.code.sf.net/p/foam-extend/foam-extend-3.2 5) Open a new MSYS shell and chdir to your foam-extend-3.2 source directory. From 83c8f053b2c7565518997c318a1e7f2178748e41 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 5 Oct 2015 15:27:24 +0100 Subject: [PATCH 32/33] Bugfix: removed library --- applications/solvers/immersedBoundary/icoDyMIbFoam/Make/options | 1 - 1 file changed, 1 deletion(-) diff --git a/applications/solvers/immersedBoundary/icoDyMIbFoam/Make/options b/applications/solvers/immersedBoundary/icoDyMIbFoam/Make/options index e905566e4..cf1d1c500 100644 --- a/applications/solvers/immersedBoundary/icoDyMIbFoam/Make/options +++ b/applications/solvers/immersedBoundary/icoDyMIbFoam/Make/options @@ -12,5 +12,4 @@ EXE_LIBS = \ -limmersedBoundary \ -ldynamicFvMesh \ -ldynamicMesh \ - -L$(FOAM_USER_LIBBIN) -loversetMesh \ -llduSolvers From 5395edc55d81f8aa06cc449e537495ef8829134a Mon Sep 17 00:00:00 2001 From: wyldckat Date: Sat, 10 Oct 2015 15:28:51 +0100 Subject: [PATCH 33/33] Switch all URLs from ftp.gnu.org to ftpmirror.gnu.org, along with usng http instead of ftp. Fixes report #291: https://sourceforge.net/p/openfoam-extend/ticketsfoamextendrelease/291/ --- ThirdParty/AllMake.stage1 | 26 +++++++++++----------- ThirdParty/rpmBuild/SPECS/bison-2.4.3.spec | 2 +- ThirdParty/rpmBuild/SPECS/bison-2.7.spec | 2 +- ThirdParty/rpmBuild/SPECS/gcc-4.4.5.spec | 2 +- ThirdParty/rpmBuild/SPECS/gcc-4.5.1.spec | 2 +- ThirdParty/rpmBuild/SPECS/gcc-4.6.4.spec | 2 +- ThirdParty/rpmBuild/SPECS/gcc-4.7.4.spec | 2 +- ThirdParty/rpmBuild/SPECS/gcc-4.8.4.spec | 2 +- ThirdParty/rpmBuild/SPECS/gcc-4.9.2.spec | 2 +- ThirdParty/rpmBuild/SPECS/gmp-4.3.2.spec | 2 +- ThirdParty/rpmBuild/SPECS/gmp-5.0.1.spec | 2 +- ThirdParty/rpmBuild/SPECS/gmp-5.1.2.spec | 2 +- ThirdParty/rpmBuild/SPECS/m4-1.4.16.spec | 2 +- ThirdParty/rpmBuild/SPECS/mpfr-3.0.0.spec | 2 +- ThirdParty/rpmBuild/SPECS/mpfr-3.0.1.spec | 2 +- 15 files changed, 27 insertions(+), 27 deletions(-) diff --git a/ThirdParty/AllMake.stage1 b/ThirdParty/AllMake.stage1 index 0c8068e80..3f71101db 100755 --- a/ThirdParty/AllMake.stage1 +++ b/ThirdParty/AllMake.stage1 @@ -65,43 +65,43 @@ echo # [ ! -z "$WM_THIRD_PARTY_USE_GCC_445" ] && { echo "Building gmp-5.0.1 mpfr-3.0.1 gcc-4.4.5" - ( rpm_make -p gmp-5.0.1 -s gmp-5.0.1.spec -u ftp://ftp.gnu.org/gnu/gmp/gmp-5.0.1.tar.gz ) - ( rpm_make -p mpfr-3.0.1 -s mpfr-3.0.1.spec -u ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.0.1.tar.gz ) - ( rpm_make -p gcc-4.4.5 -s gcc-4.4.5.spec -u ftp://ftp.gnu.org/gnu/gcc/gcc-4.4.5/gcc-4.4.5.tar.gz ) + ( rpm_make -p gmp-5.0.1 -s gmp-5.0.1.spec -u http://ftpmirror.gnu.org/gmp/gmp-5.0.1.tar.gz ) + ( rpm_make -p mpfr-3.0.1 -s mpfr-3.0.1.spec -u http://ftpmirror.gnu.org/mpfr/mpfr-3.0.1.tar.gz ) + ( rpm_make -p gcc-4.4.5 -s gcc-4.4.5.spec -u http://ftpmirror.gnu.org/gcc/gcc-4.4.5/gcc-4.4.5.tar.gz ) } # Gcc 4.5.1 and companion libraries # [ ! -z "$WM_THIRD_PARTY_USE_GCC_451" ] && { echo "Building gmp-5.0.1 mpfr-3.0.1 mpc-0.8.2 gcc-4.5.1" - ( rpm_make -p gmp-5.0.1 -s gmp-5.0.1.spec -u ftp://ftp.gnu.org/gnu/gmp/gmp-5.0.1.tar.gz ) - ( rpm_make -p mpfr-3.0.1 -s mpfr-3.0.1.spec -u ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.0.1.tar.gz ) + ( rpm_make -p gmp-5.0.1 -s gmp-5.0.1.spec -u http://ftpmirror.gnu.org/gmp/gmp-5.0.1.tar.gz ) + ( rpm_make -p mpfr-3.0.1 -s mpfr-3.0.1.spec -u http://ftpmirror.gnu.org/mpfr/mpfr-3.0.1.tar.gz ) ( rpm_make -p mpc-0.8.2 -s mpc-0.8.2.spec -u http://www.multiprecision.org/mpc/download/mpc-0.8.2.tar.gz ) - ( rpm_make -p gcc-4.5.1 -s gcc-4.5.1.spec -u ftp://ftp.gnu.org/gnu/gcc/gcc-4.5.1/gcc-4.5.1.tar.gz ) + ( rpm_make -p gcc-4.5.1 -s gcc-4.5.1.spec -u http://ftpmirror.gnu.org/gcc/gcc-4.5.1/gcc-4.5.1.tar.gz ) } # Gcc 4.6.3 and companion libraries # [ ! -z "$WM_THIRD_PARTY_USE_GCC_463" ] && { echo "Building gmp-5.0.5 mpfr-3.1.0 mpc-0.9 gcc-4.6.3" - ( rpm_make -p gmp-5.0.5 -s gmp-5.0.5.spec -u ftp://ftp.gnu.org/gnu/gmp/gmp-5.0.5.tar.bz2 ) - ( rpm_make -p mpfr-3.1.0 -s mpfr-3.1.0.spec -u ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.0.tar.gz ) + ( rpm_make -p gmp-5.0.5 -s gmp-5.0.5.spec -u http://ftpmirror.gnu.org/gmp/gmp-5.0.5.tar.bz2 ) + ( rpm_make -p mpfr-3.1.0 -s mpfr-3.1.0.spec -u http://ftpmirror.gnu.org/mpfr/mpfr-3.1.0.tar.gz ) ( rpm_make -p mpc-0.9 -s mpc-0.9.spec -u http://www.multiprecision.org/mpc/download/mpc-0.9.tar.gz ) - ( rpm_make -p gcc-4.6.3 -s gcc-4.6.3.spec -u ftp://ftp.gnu.org/gnu/gcc/gcc-4.6.3/gcc-4.6.3.tar.gz ) + ( rpm_make -p gcc-4.6.3 -s gcc-4.6.3.spec -u http://ftpmirror.gnu.org/gcc/gcc-4.6.3/gcc-4.6.3.tar.gz ) } # Gcc 4.8.4 and companion libraries # [ ! -z "$WM_THIRD_PARTY_USE_GCC_484" ] && { echo "Building gcc-4.8.4" - ( rpm_make -p gcc-4.8.4 -s gcc-4.8.4.spec -u ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.4/gcc-4.8.4.tar.gz ) + ( rpm_make -p gcc-4.8.4 -s gcc-4.8.4.spec -u http://ftpmirror.gnu.org/gcc/gcc-4.8.4/gcc-4.8.4.tar.gz ) } # Gcc 4.9.2 and companion libraries # [ ! -z "$WM_THIRD_PARTY_USE_GCC_492" ] && { echo "Building gcc-4.9.2" - ( rpm_make -p gcc-4.9.2 -s gcc-4.9.2.spec -u ftp://ftp.gnu.org/gnu/gcc/gcc-4.9.2/gcc-4.9.2.tar.gz ) + ( rpm_make -p gcc-4.9.2 -s gcc-4.9.2.spec -u http://ftpmirror.gnu.org/gcc/gcc-4.9.2/gcc-4.9.2.tar.gz ) } # Clang 3.6.0 @@ -123,7 +123,7 @@ echo [ ! -z "$WM_THIRD_PARTY_USE_M4_1416" ] && { echo "Building m4 1.4.16" # You need a recent version of m4 in order to compile a recent version of bison - ( rpm_make -p m4-1.4.16 -s m4-1.4.16.spec -u http://ftp.gnu.org/gnu/m4/m4-1.4.16.tar.gz ) + ( rpm_make -p m4-1.4.16 -s m4-1.4.16.spec -u http://ftpmirror.gnu.org/m4/m4-1.4.16.tar.gz ) } # bison 2.7 @@ -131,7 +131,7 @@ echo [ ! -z "$WM_THIRD_PARTY_USE_BISON_27" ] && { echo "Building bison 2.7" # You need a recent version of m4 in order to compile a recent version of bison - ( rpm_make -p bison-2.7 -s bison-2.7.spec -u http://ftp.gnu.org/gnu/bison/bison-2.7.tar.gz ) + ( rpm_make -p bison-2.7 -s bison-2.7.spec -u http://ftpmirror.gnu.org/bison/bison-2.7.tar.gz ) } # flex 2.5.35 diff --git a/ThirdParty/rpmBuild/SPECS/bison-2.4.3.spec b/ThirdParty/rpmBuild/SPECS/bison-2.4.3.spec index ec4e2d121..0a9b98010 100644 --- a/ThirdParty/rpmBuild/SPECS/bison-2.4.3.spec +++ b/ThirdParty/rpmBuild/SPECS/bison-2.4.3.spec @@ -72,7 +72,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: http://ftp.gnu.org/gnu/bison +URL: http://ftpmirror.gnu.org/bison Source: %url/%{name}-%{version}.tar.gz Prefix: %{_prefix} Group: Development/Tools diff --git a/ThirdParty/rpmBuild/SPECS/bison-2.7.spec b/ThirdParty/rpmBuild/SPECS/bison-2.7.spec index 96a678db9..cec8fead0 100644 --- a/ThirdParty/rpmBuild/SPECS/bison-2.7.spec +++ b/ThirdParty/rpmBuild/SPECS/bison-2.7.spec @@ -72,7 +72,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: http://ftp.gnu.org/gnu/bison +URL: http://ftpmirror.gnu.org/bison Source: %url/%{name}-%{version}.tar.gz Prefix: %{_prefix} Group: Development/Tools diff --git a/ThirdParty/rpmBuild/SPECS/gcc-4.4.5.spec b/ThirdParty/rpmBuild/SPECS/gcc-4.4.5.spec index cc4bed3c4..99e7bfe68 100644 --- a/ThirdParty/rpmBuild/SPECS/gcc-4.4.5.spec +++ b/ThirdParty/rpmBuild/SPECS/gcc-4.4.5.spec @@ -72,7 +72,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: ftp://ftp.gnu.org/gnu/gcc/gcc-4.4.5 +URL: http://ftpmirror.gnu.org/gcc/gcc-4.4.5 Source: %url/%{name}-%{version}.tar.gz Prefix: %{_prefix} Group: Development/Tools diff --git a/ThirdParty/rpmBuild/SPECS/gcc-4.5.1.spec b/ThirdParty/rpmBuild/SPECS/gcc-4.5.1.spec index f71f01972..945ab3546 100644 --- a/ThirdParty/rpmBuild/SPECS/gcc-4.5.1.spec +++ b/ThirdParty/rpmBuild/SPECS/gcc-4.5.1.spec @@ -72,7 +72,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: ftp://ftp.gnu.org/gnu/gcc/gcc-4.5.1 +URL: http://ftpmirror.gnu.org/gcc/gcc-4.5.1 Source: %url/%{name}-%{version}.tar.gz Prefix: %{_prefix} Group: Development/Tools diff --git a/ThirdParty/rpmBuild/SPECS/gcc-4.6.4.spec b/ThirdParty/rpmBuild/SPECS/gcc-4.6.4.spec index ed07dd568..45dbaf1ea 100644 --- a/ThirdParty/rpmBuild/SPECS/gcc-4.6.4.spec +++ b/ThirdParty/rpmBuild/SPECS/gcc-4.6.4.spec @@ -72,7 +72,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: ftp://ftp.gnu.org/gnu/gcc/gcc-4.6.4 +URL: http://ftpmirror.gnu.org/gcc/gcc-4.6.4 Source: %url/%{name}-%{version}.tar.gz Prefix: %{_prefix} Group: Development/Tools diff --git a/ThirdParty/rpmBuild/SPECS/gcc-4.7.4.spec b/ThirdParty/rpmBuild/SPECS/gcc-4.7.4.spec index d4bed42c5..9619e4ed7 100644 --- a/ThirdParty/rpmBuild/SPECS/gcc-4.7.4.spec +++ b/ThirdParty/rpmBuild/SPECS/gcc-4.7.4.spec @@ -72,7 +72,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: ftp://ftp.gnu.org/gnu/gcc/gcc-4.7.4 +URL: http://ftpmirror.gnu.org/gcc/gcc-4.7.4 Source: %url/%{name}-%{version}.tar.gz Prefix: %{_prefix} Group: Development/Tools diff --git a/ThirdParty/rpmBuild/SPECS/gcc-4.8.4.spec b/ThirdParty/rpmBuild/SPECS/gcc-4.8.4.spec index 8acb8c111..c84d870eb 100644 --- a/ThirdParty/rpmBuild/SPECS/gcc-4.8.4.spec +++ b/ThirdParty/rpmBuild/SPECS/gcc-4.8.4.spec @@ -72,7 +72,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.4 +URL: http://ftpmirror.gnu.org/gcc/gcc-4.8.4 Source: %url/%{name}-%{version}.tar.gz Prefix: %{_prefix} Group: Development/Tools diff --git a/ThirdParty/rpmBuild/SPECS/gcc-4.9.2.spec b/ThirdParty/rpmBuild/SPECS/gcc-4.9.2.spec index d134a7d2b..7d96bd5e0 100644 --- a/ThirdParty/rpmBuild/SPECS/gcc-4.9.2.spec +++ b/ThirdParty/rpmBuild/SPECS/gcc-4.9.2.spec @@ -72,7 +72,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: ftp://ftp.gnu.org/gnu/gcc/gcc-4.9.2 +URL: http://ftpmirror.gnu.org/gcc/gcc-4.9.2 Source: %url/%{name}-%{version}.tar.gz Prefix: %{_prefix} Group: Development/Tools diff --git a/ThirdParty/rpmBuild/SPECS/gmp-4.3.2.spec b/ThirdParty/rpmBuild/SPECS/gmp-4.3.2.spec index f0e5d6733..329dae5b9 100644 --- a/ThirdParty/rpmBuild/SPECS/gmp-4.3.2.spec +++ b/ThirdParty/rpmBuild/SPECS/gmp-4.3.2.spec @@ -72,7 +72,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: ftp://ftp.gnu.org/gnu/gmp +URL: http://ftpmirror.gnu.org/gmp Source: %url/%{name}-%{version}.tar.bz2 Prefix: %{_prefix} Group: Development/Tools diff --git a/ThirdParty/rpmBuild/SPECS/gmp-5.0.1.spec b/ThirdParty/rpmBuild/SPECS/gmp-5.0.1.spec index ed068b4ea..338787d71 100644 --- a/ThirdParty/rpmBuild/SPECS/gmp-5.0.1.spec +++ b/ThirdParty/rpmBuild/SPECS/gmp-5.0.1.spec @@ -72,7 +72,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: ftp://ftp.gnu.org/gnu/gmp +URL: http://ftpmirror.gnu.org/gmp Source: %url/%{name}-%{version}.tar.gz Prefix: %{_prefix} Group: Development/Tools diff --git a/ThirdParty/rpmBuild/SPECS/gmp-5.1.2.spec b/ThirdParty/rpmBuild/SPECS/gmp-5.1.2.spec index 1c4ea1cec..9db50fed3 100644 --- a/ThirdParty/rpmBuild/SPECS/gmp-5.1.2.spec +++ b/ThirdParty/rpmBuild/SPECS/gmp-5.1.2.spec @@ -72,7 +72,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: ftp://ftp.gnu.org/gnu/gmp +URL: http://ftpmirror.gnu.org/gmp Source: %url/%{name}-%{version}.tar.bz2 Prefix: %{_prefix} Group: Development/Tools diff --git a/ThirdParty/rpmBuild/SPECS/m4-1.4.16.spec b/ThirdParty/rpmBuild/SPECS/m4-1.4.16.spec index 9fa83c6c7..a40698adf 100644 --- a/ThirdParty/rpmBuild/SPECS/m4-1.4.16.spec +++ b/ThirdParty/rpmBuild/SPECS/m4-1.4.16.spec @@ -72,7 +72,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: http://ftp.gnu.org/gnu/m4 +URL: http://ftpmirror.gnu.org/m4 Source: %url/%{name}-%{version}.tar.gz Prefix: %{_prefix} Group: Development/Tools diff --git a/ThirdParty/rpmBuild/SPECS/mpfr-3.0.0.spec b/ThirdParty/rpmBuild/SPECS/mpfr-3.0.0.spec index e0275547e..c7748461c 100644 --- a/ThirdParty/rpmBuild/SPECS/mpfr-3.0.0.spec +++ b/ThirdParty/rpmBuild/SPECS/mpfr-3.0.0.spec @@ -72,7 +72,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: ftp://ftp.gnu.org/gnu/mpfr +URL: http://ftpmirror.gnu.org/mpfr Source: %url/%{name}-%{version}.tar.gz Prefix: %{_prefix} Group: Development/Tools diff --git a/ThirdParty/rpmBuild/SPECS/mpfr-3.0.1.spec b/ThirdParty/rpmBuild/SPECS/mpfr-3.0.1.spec index 9008dda81..0d95e68d1 100644 --- a/ThirdParty/rpmBuild/SPECS/mpfr-3.0.1.spec +++ b/ThirdParty/rpmBuild/SPECS/mpfr-3.0.1.spec @@ -72,7 +72,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: ftp://ftp.gnu.org/gnu/mpfr +URL: http://ftpmirror.gnu.org/mpfr Source: %url/%{name}-%{version}.tar.gz Prefix: %{_prefix} Group: Development/Tools