From 828b81f8096395c91e8ad6ddad2ebbb84c5a01d4 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Tue, 8 Dec 2020 12:42:44 +0000 Subject: [PATCH] coolingSphere, singleFluidCHT: Replaced text manipulations in Allclean with foamDictionary --- etc/templates/singleFluidCHT/Allclean | 6 +++--- .../chtMultiRegionFoam/coolingSphere/Allclean | 9 +++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/etc/templates/singleFluidCHT/Allclean b/etc/templates/singleFluidCHT/Allclean index c3646bf018..71af8a7086 100755 --- a/etc/templates/singleFluidCHT/Allclean +++ b/etc/templates/singleFluidCHT/Allclean @@ -4,9 +4,9 @@ cd "${0%/*}" || exit 1 # run from this directory # Source tutorial clean functions . "$WM_PROJECT_DIR/bin/tools/CleanFunctions" -removeRegionDirs () { - # HACK to get regionDirs from materialProperties - _regionDirs="$(grep -E "^[a-Z]" constant/materialProperties | tail -n +2)" +removeRegionDirs () +{ + _regionDirs="$(foamDictionary -keywords constant/materialProperties)" for d in system constant do diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/Allclean index 6966e9f417..ad61afc43a 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/Allclean +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/Allclean @@ -4,9 +4,9 @@ cd "${0%/*}" || exit 1 # Run from this directory # Source tutorial clean functions . "$WM_PROJECT_DIR/bin/tools/CleanFunctions" -removeRegionDirs () { - # HACK to get regionDirs from materialProperties - _regionDirs="$(grep "^[a-zA-Z]" constant/materialProperties | tail -n +2)" +removeRegionDirs () +{ + _regionDirs="$(foamDictionary -keywords constant/materialProperties)" for _d in system constant do @@ -16,14 +16,11 @@ removeRegionDirs () { [ -d "$_dir" ] && rm -rf "$_dir" done done - - find . -name "region*" -type d | xargs rm -rf } cleanCase removeRegionDirs rm -rf 0 > /dev/null 2>&1 rm -rf constant/regionProperties > /dev/null 2>&1 -# rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1 #------------------------------------------------------------------------------