From 65245da0162a89acfe3a3643f02edd89ed6e6989 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 11 Dec 2015 13:11:54 +0000 Subject: [PATCH 01/13] foamSequenceVTKFiles, mpirunDebug: Correct call to "usage" Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1946 --- bin/foamSequenceVTKFiles | 2 +- bin/mpirunDebug | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/foamSequenceVTKFiles b/bin/foamSequenceVTKFiles index fbbfc6014..b106933ff 100755 --- a/bin/foamSequenceVTKFiles +++ b/bin/foamSequenceVTKFiles @@ -72,7 +72,7 @@ do shift 2 ;; -h | -help) - printUsage + usage ;; -o | -out) [ "$#" -ge 2 ] || usage "'$1' option requires an argument" diff --git a/bin/mpirunDebug b/bin/mpirunDebug index b9a284d61..469a285b2 100755 --- a/bin/mpirunDebug +++ b/bin/mpirunDebug @@ -250,7 +250,7 @@ MPICH) *) echo echo "Unsupported WM_MPLIB setting : $WM_MPLIB" - printUsage + usage exit 1 esac From 5c658dbfa21226370c74f3a5d2acc681de87a43c Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 11 Dec 2015 13:12:19 +0000 Subject: [PATCH 02/13] Updated header --- bin/mpirunDebug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mpirunDebug b/bin/mpirunDebug index 469a285b2..3be74baa2 100755 --- a/bin/mpirunDebug +++ b/bin/mpirunDebug @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License From 71f13ec9dd9f547b09498d31b089eaca192edb06 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 11 Dec 2015 14:21:02 +0000 Subject: [PATCH 03/13] foamSequenceVTKFiles: Avoid the -s and -a options for basename Only recent GNU/Linux distributions support this functionality Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1947 --- bin/foamSequenceVTKFiles | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/foamSequenceVTKFiles b/bin/foamSequenceVTKFiles index b106933ff..86e512228 100755 --- a/bin/foamSequenceVTKFiles +++ b/bin/foamSequenceVTKFiles @@ -94,7 +94,7 @@ if [ ! -d $DIR ]; then fi FILES=$(find $DIR -type f -name *vtk) -NAMES=$(basename -s .vtk -a $FILES | sort -u) +NAMES=$(for f in $FILES; do basename $f .vtk; done | sort -u) if [ -d $OUT ]; then echo "$OUT directory already exists. Deleting links within it..." From 35439753ef974131328ace4fcc1a39aa0bd331eb Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sat, 12 Dec 2015 09:00:42 +0000 Subject: [PATCH 04/13] PairCollision: stabilize normalization of the force direction for low force Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1948 --- .../Kinematic/CollisionModel/PairCollision/PairCollision.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C index 185bfb2f5..54131aa82 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C @@ -246,7 +246,7 @@ void Foam::PairCollision::wallInteraction() vector pW = nearPt - pos; - scalar normalAlignment = normal & pW/mag(pW); + scalar normalAlignment = normal & pW/(mag(pW) + ROOTSMALL); // Find the patchIndex and wallData for WallSiteData object label patchI = patchID[realFaceI - mesh.nInternalFaces()]; From 72bc2ac4a901616d60fd5fe99f3965175838f9f8 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sun, 13 Dec 2015 18:33:01 +0000 Subject: [PATCH 05/13] OSspecific/POSIX: Dynamically resize the path buffer in cwd Starting from an initial buffer size of 256 it is incremented in steps of 256 upto the maximum of 4096 as required. Based on patch provided by Bruno Santos Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1944 --- src/OSspecific/POSIX/POSIX.C | 76 +++++++++++++++++++++++++----------- src/OSspecific/POSIX/POSIX.H | 5 ++- 2 files changed, 57 insertions(+), 24 deletions(-) diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C index 44ee3c708..9188b7e24 100644 --- a/src/OSspecific/POSIX/POSIX.C +++ b/src/OSspecific/POSIX/POSIX.C @@ -246,19 +246,44 @@ Foam::fileName Foam::home(const string& userName) Foam::fileName Foam::cwd() { - char buf[256]; - if (::getcwd(buf, sizeof(buf))) - { - return buf; - } - else - { - FatalErrorInFunction - << "Couldn't get the current working directory" - << exit(FatalError); + label pathLengthLimit = POSIX::pathLengthChunk; + List path(pathLengthLimit); - return fileName::null; + // Resize path if getcwd fails with an ERANGE error + while(pathLengthLimit == path.size()) + { + if (::getcwd(path.data(), path.size())) + { + return path.data(); + } + else if(errno == ERANGE) + { + // Increment path length upto the pathLengthMax limit + if + ( + (pathLengthLimit += POSIX::pathLengthChunk) + >= POSIX::pathLengthMax + ) + { + FatalErrorInFunction + << "Attempt to increase path length beyond limit of " + << POSIX::pathLengthMax + << exit(FatalError); + } + + path.setSize(pathLengthLimit); + } + else + { + break; + } } + + FatalErrorInFunction + << "Couldn't get the current working directory" + << exit(FatalError); + + return fileName::null; } @@ -670,8 +695,8 @@ Foam::fileNameList Foam::readDir if (POSIX::debug) { - Info<< "readDir(const fileName&, const fileType, const bool filtergz)" - << " : reading directory " << directory << endl; + InfoInFunction + << "reading directory " << directory << endl; } // Setup empty string list MAXTVALUES long @@ -691,9 +716,8 @@ Foam::fileNameList Foam::readDir if (POSIX::debug) { - Info<< "readDir(const fileName&, const fileType, " - "const bool filtergz) : cannot open directory " - << directory << endl; + InfoInFunction + << "cannot open directory " << directory << endl; } } else @@ -824,7 +848,8 @@ bool Foam::cp(const fileName& src, const fileName& dest) { if (POSIX::debug) { - Info<< "Copying : " << src/contents[i] + InfoInFunction + << "Copying : " << src/contents[i] << " to " << destFile/contents[i] << endl; } @@ -838,7 +863,8 @@ bool Foam::cp(const fileName& src, const fileName& dest) { if (POSIX::debug) { - Info<< "Copying : " << src/subdirs[i] + InfoInFunction + << "Copying : " << src/subdirs[i] << " to " << destFile << endl; } @@ -856,7 +882,8 @@ bool Foam::ln(const fileName& src, const fileName& dst) { if (POSIX::debug) { - Info<< "Create softlink from : " << src << " to " << dst + InfoInFunction + << "Create softlink from : " << src << " to " << dst << endl; } @@ -893,7 +920,8 @@ bool Foam::mv(const fileName& src, const fileName& dst) { if (POSIX::debug) { - Info<< "Move : " << src << " to " << dst << endl; + InfoInFunction + << "Move : " << src << " to " << dst << endl; } if @@ -919,7 +947,8 @@ bool Foam::mvBak(const fileName& src, const std::string& ext) { if (POSIX::debug) { - Info<< "mvBak : " << src << " to extension " << ext << endl; + InfoInFunction + << "mvBak : " << src << " to extension " << ext << endl; } if (exists(src, false)) @@ -956,7 +985,8 @@ bool Foam::rm(const fileName& file) { if (POSIX::debug) { - Info<< "Removing : " << file << endl; + InfoInFunction + << "Removing : " << file << endl; } // Try returning plain file name; if not there, try with .gz @@ -976,7 +1006,7 @@ bool Foam::rmDir(const fileName& directory) { if (POSIX::debug) { - Info<< "rmDir(const fileName&) : " + InfoInFunction << "removing directory " << directory << endl; } diff --git a/src/OSspecific/POSIX/POSIX.H b/src/OSspecific/POSIX/POSIX.H index 9947f3de7..0b17af732 100644 --- a/src/OSspecific/POSIX/POSIX.H +++ b/src/OSspecific/POSIX/POSIX.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,6 +48,9 @@ namespace POSIX { //- Declare name of the class and its debug switch NamespaceName("POSIX"); + + const label pathLengthChunk = 256; + const label pathLengthMax = 4096; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // From 21cf5fbe1062042e39d0eb14bab9e6ca52a5a084 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sun, 13 Dec 2015 20:55:24 +0000 Subject: [PATCH 06/13] wclean: Added the target "empty", which removes empty directories It will exit after removing the empty folders and it will not do the other standard "wclean" operations. This replaces the functionality provided by "wrmdepold". Patch provided by Bruno Santos --- wmake/wclean | 45 +++++++++++----- wmake/wrmdepold | 133 ------------------------------------------------ 2 files changed, 32 insertions(+), 146 deletions(-) delete mode 100755 wmake/wrmdepold diff --git a/wmake/wclean b/wmake/wclean index 28e2621bc..373b76c70 100755 --- a/wmake/wclean +++ b/wmake/wclean @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -40,17 +40,18 @@ Usage: $Script [OPTION] [dir] $Script [OPTION] target [dir [MakeDir]] options: - -s | -silent ignored - for compatibility with wmake - -help print the usage + -s | -silent Ignored - for compatibility with wmake + -help Print the usage Clean up the wmake control directory Make/\$WM_OPTIONS and remove the lnInclude directories generated for libraries. The targets correspond to a subset of the 'wmake' special targets: - all all subdirectories, uses any Allwclean or Allclean + all All subdirectories, uses any Allwclean or Allclean files if they exist exe | lib | libo | libso - clean Make, any *.dep files and lnInclude directories + Clean Make, any *.dep files and lnInclude directories + empty Remove empty sub-directories for the requested dir USAGE exit 1 @@ -67,7 +68,7 @@ do -h | -help) usage ;; - -s | -silent) # ignored - for compatibility with wmake + -s | -silent) # Ignored - for compatibility with wmake shift ;; -*) @@ -81,7 +82,7 @@ done #------------------------------------------------------------------------------ -# check arguments and change to the directory in which to run wclean +# Check arguments and change to the directory in which to run wclean #------------------------------------------------------------------------------ unset dir targetType @@ -97,10 +98,10 @@ then targetType=$1 fi - # specified directory name: + # Specified directory name: [ $# -ge 2 ] && dir=$2 - # specified alternative name for the Make sub-directory: + # Specified alternative name for the Make sub-directory: [ $# -ge 3 ] && MakeDir=$3 if [ "$dir" ] @@ -111,22 +112,40 @@ then } fi - # provide some feedback + # Provide some feedback echo "$Script ${dir:-./}" fi +#------------------------------------------------------------------------------ +# Remove empty sub-directories and exit +#------------------------------------------------------------------------------ + +if [ "$targetType" = empty ] +then + # Get sub-directories avoiding particular directories + for dir in $(find . -mindepth 1 -maxdepth 1 \ + -type d \( -name .git -prune -o -print \) ) + do + echo "check dir: $dir" + find $dir -depth -type d -empty -exec rmdir {} \; -print + done + + exit 0 +fi + + #------------------------------------------------------------------------------ # Recurse the directories tree #------------------------------------------------------------------------------ if [ "$targetType" = all ] then - if [ -e Allwclean ] # consistent with Allwmake + if [ -e Allwclean ] # Consistent with Allwmake then ./Allwclean exit $? - elif [ -e Allclean ] # often used for tutorial cases + elif [ -e Allclean ] # Often used for tutorial cases then ./Allclean exit $? @@ -135,7 +154,7 @@ then for dir in `find . \( -type d -a -name Make \)` do echo $dir - $0 ${dir%/Make} # parent directory - trim /Make from the end + $0 ${dir%/Make} # Parent directory - trim /Make from the end done fi fi diff --git a/wmake/wrmdepold b/wmake/wrmdepold deleted file mode 100755 index 61cdc92bc..000000000 --- a/wmake/wrmdepold +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# ========= | -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox -# \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation -# \\/ 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 3 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, see . -# -# Script -# wrmdepold -# -# Description -# Usage: wrmdepold [dir1 .. dirN] -# -# Remove *.dep files that are without a corresponding .C or .L source file. -# This often occurs when a directory has been moved. -# - print questionable directory and the *.dep file -# - optionally remove empty directories -#------------------------------------------------------------------------------ -Script=${0##*/} - -# Source the wmake functions -. ${0%/*}/scripts/wmakeFunctions - -usage() { - exec 1>&2 - while [ "$#" -ge 1 ]; do echo "$1"; shift; done - cat</dev/null - fi - done - - # Remove empty dirs - if [ "$optRmdir" ] - then - # get subdirs ourselves so we can avoid particular directories - for dir in $(find $objectsDir -mindepth 1 -maxdepth 1 -type d \( -name .git -prune -o -print \) ) - do - echo "check dir: $dir" - find $dir -depth -type d -empty -exec rmdir {} \; -print - done - fi -done - - -# ----------------------------------------------------------------------------- From 1185daf9b76b5059770ad1355853c38111bc3856 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sun, 13 Dec 2015 20:57:25 +0000 Subject: [PATCH 07/13] wrmdep: Added "update" option Searches all the "src" and "application" directories of the project for broken symbolic links for source code files and then remove all .dep files that relate to the files that no longer exist. Must be executed in main project source code folder: $WM_PROJECT_DIR Patch provided by Bruno Santos Resolves feature-request http://www.openfoam.org/mantisbt/view.php?id=1941 --- wmake/wrmdep | 151 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 129 insertions(+), 22 deletions(-) diff --git a/wmake/wrmdep b/wmake/wrmdep index 32c14546c..d3ae40937 100755 --- a/wmake/wrmdep +++ b/wmake/wrmdep @@ -24,13 +24,29 @@ # # Script # wrmdep [-a | -all | all] [file] +# wrmdep [-o | -old] [dir1 .. dirN] +# wrmdep -update # # Description +# This is a catch-all script for pruning .dep files, depending on the +# provided arguments. +# +# [-a | -all | all] [file]: # Remove all .dep files from the object directory tree corresponding to the # current source derectory or remove only the .dep files referring to the # optionally specified [file]. With the -a/-all/all option the .dep files # are removed for all platforms rather than just the current platform. # +# [-o | -old] [dir1 .. dirN]: +# Remove *.dep files that are without a corresponding .C or .L source file. +# This often occurs when a directory has been moved. +# - print questionable directory and the *.dep file +# +# -update: +# Search all the "src" and "application" directories of the project for +# broken symbolic links for source code files and then remove all .dep +# files that relate to files that no longer exist. +# #------------------------------------------------------------------------------ Script=${0##*/} @@ -41,11 +57,28 @@ usage() { exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< -With the -a/-all/all option the .dep files are removed for all platform -rather than just the current platform. + $Script [-a | -all | all] [file] + + Remove all .dep files or remove .dep files referring to + With the -a/-all/all option the .dep files are removed for all + platform rather than just the current platform. + + $Script [-o | -old] [dir1 .. dirN] + + Remove *.dep files that are without a corresponding .C or .L file. + This often occurs when a directory has been moved. + - print questionable directory and file + + Note: For removing empty source code folders, run: wclean rmdir + + $Script -update + + Search all the "src" and "application" directories of the project for + broken symbolic links for source code files and then remove all .dep + files that relate to files that no longer exist. + Must be executed in main project source code folder: $WM_PROJECT_DIR USAGE exit 1 @@ -56,6 +89,9 @@ USAGE # Parse arguments and options #------------------------------------------------------------------------------ +# Default is for removing all .dep files in the current directory +rmdepMode="files" + # Default to processing only the current platform all= @@ -71,6 +107,14 @@ do all="all" shift ;; + -o | -old) + rmdepMode="oldFolders" + shift + ;; + -update) + rmdepMode="updateMode" + shift + ;; -*) usage "unknown option: '$*'" ;; @@ -84,33 +128,96 @@ done checkEnv -#------------------------------------------------------------------------------ -# Remove the selected .dep files from the object tree -#------------------------------------------------------------------------------ +case "$rmdepMode" in +files) -findObjectDir . + #------------------------------------------------------------------------- + # Remove the selected .dep files from the object tree + #------------------------------------------------------------------------- -# With the -a/-all option replace the current platform with a wildcard -if [ "$all" = "all" ] -then - objectsDir=$(echo $objectsDir | sed s%$WM_OPTIONS%*% ) -fi + findObjectDir . -if [ "$#" -eq 0 ] -then - echo "removing all .dep files ..." - find $objectsDir -name '*.dep' -print | xargs -t rm 2>/dev/null -else - echo "removing .dep files referring to $1 ..." - find $objectsDir -name '*.dep' -exec grep "$1" '{}' \; -exec rm '{}' \; -fi + # With the -a/-all option replace the current platform with a wildcard + if [ "$all" = "all" ] + then + objectsDir=$(echo $objectsDir | sed s%$WM_OPTIONS%*% ) + fi + + if [ "$#" -eq 0 ] + then + echo "removing all .dep files ..." + find $objectsDir -name '*.dep' -print | xargs -t rm 2>/dev/null + else + echo "removing .dep files referring to $1 ..." + find $objectsDir -name '*.dep' -exec grep "$1" '{}' \; \ + -exec rm '{}' \; + fi + + ;; + +oldFolders) + + # Default is the current directory + [ "$#" -gt 0 ] || set -- . + + for checkDir + do + findObjectDir $checkDir + + if [ -d $objectsDir ] + then + echo "Searching: $objectsDir" + else + echo "Skipping non-dir: $objectsDir" + continue + fi + + find $objectsDir -name '*.dep' -print | while read depFile + do + depToSource $depFile + + # Check C++ or Flex source file exists + if [ ! -r "$sourceFile" ]; + then + echo "rm $depFile" + rm -f $depFile 2>/dev/null + fi + done + done + + ;; + +updateMode) + + [ -d bin -a -d src ] || usage "not in the project top level directory" + + echo "Purging all dep files that relate to files that no longer exist..." + fileNameList=$(find -L src applications -name '*.[CHL]' -type l \ + -exec basename {} \;) + + for fileName in $fileNameList + do + echo "Purging from 'src': $fileName" + cd src + $Script -a $fileName + + echo "Purging from 'applications': $fileName" + cd ../applications + $Script -a $fileName + + cd .. + done + + ;; + +esac #------------------------------------------------------------------------------ # Cleanup local variables and functions #------------------------------------------------------------------------------ -unset Script usage +unset Script usage rmdepMode all #------------------------------------------------------------------------------ From dbe56f646070970f4841f1fbf7341c5be51473b9 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sun, 13 Dec 2015 21:23:04 +0000 Subject: [PATCH 08/13] wrmdep: Update documentation --- wmake/wrmdep | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/wmake/wrmdep b/wmake/wrmdep index d3ae40937..cea58c901 100755 --- a/wmake/wrmdep +++ b/wmake/wrmdep @@ -39,13 +39,14 @@ # # [-o | -old] [dir1 .. dirN]: # Remove *.dep files that are without a corresponding .C or .L source file. -# This often occurs when a directory has been moved. -# - print questionable directory and the *.dep file +# This occurs when a directory has been moved. +# - prints the questionable directory and *.dep file # # -update: # Search all the "src" and "application" directories of the project for # broken symbolic links for source code files and then remove all .dep # files that relate to files that no longer exist. +# Must be executed in the project top-level directory: $WM_PROJECT_DIR. # #------------------------------------------------------------------------------ Script=${0##*/} @@ -68,17 +69,17 @@ Usage: $Script [-o | -old] [dir1 .. dirN] Remove *.dep files that are without a corresponding .C or .L file. - This often occurs when a directory has been moved. - - print questionable directory and file + This occurs when a directory has been moved. + - prints the questionable directory and *.dep file - Note: For removing empty source code folders, run: wclean rmdir + Note: to remove empty directories, run: wclean empty $Script -update Search all the "src" and "application" directories of the project for broken symbolic links for source code files and then remove all .dep files that relate to files that no longer exist. - Must be executed in main project source code folder: $WM_PROJECT_DIR + Must be executed in the project top-level directory: $WM_PROJECT_DIR USAGE exit 1 @@ -189,7 +190,7 @@ oldFolders) updateMode) - [ -d bin -a -d src ] || usage "not in the project top level directory" + [ -d bin -a -d src ] || usage "Not in the project top-level directory" echo "Purging all dep files that relate to files that no longer exist..." fileNameList=$(find -L src applications -name '*.[CHL]' -type l \ From 5d8757d6bb2dbb42cee409f4e333f228823a4c1e Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 14 Dec 2015 10:21:22 +0000 Subject: [PATCH 09/13] PairCollision: Reduce division stabilization to SMALL --- .../Kinematic/CollisionModel/PairCollision/PairCollision.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C index 54131aa82..6800360b4 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C @@ -246,7 +246,7 @@ void Foam::PairCollision::wallInteraction() vector pW = nearPt - pos; - scalar normalAlignment = normal & pW/(mag(pW) + ROOTSMALL); + scalar normalAlignment = normal & pW/(mag(pW) + SMALL); // Find the patchIndex and wallData for WallSiteData object label patchI = patchID[realFaceI - mesh.nInternalFaces()]; From 9977d77d91b0bbba28d0e68dd12d0ae3ea0e94c7 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 14 Dec 2015 10:22:06 +0000 Subject: [PATCH 10/13] tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun: Updated to handle missing polyMesh dir --- tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun b/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun index 196a72a1d..60c6459cf 100755 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun @@ -19,7 +19,7 @@ runApplication simpleFoam # Copy the mesh from the steady state case and map the results to a # mesh motion case, then solve transient. cd ../wingMotion2D_pimpleDyMFoam -cp -r ../wingMotion2D_simpleFoam/constant/polyMesh/* constant/polyMesh/ +cp -r ../wingMotion2D_simpleFoam/constant/polyMesh constant cp -r 0.org 0 runApplication mapFields ../wingMotion2D_simpleFoam -sourceTime latestTime -consistent mv 0/pointDisplacement.unmapped 0/pointDisplacement From 436c3b92e447c5b83c063f852d7656fc8c6efd88 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 14 Dec 2015 11:03:16 +0000 Subject: [PATCH 11/13] AllwmakeParseArguments: Added "-update" option Updates lnInclude directories and dep files before compilation. This is useful to apply following a "git pull" to ensure consistency between the source files, dep files and links. --- wmake/scripts/AllwmakeParseArguments | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wmake/scripts/AllwmakeParseArguments b/wmake/scripts/AllwmakeParseArguments index cbd5aa01e..5ed59576b 100644 --- a/wmake/scripts/AllwmakeParseArguments +++ b/wmake/scripts/AllwmakeParseArguments @@ -55,6 +55,7 @@ options: -j Compile using all local cores/hyperthreads -jN or -j N Compile using N cores/hyperthreads -no-scheduler Compile without wmakeScheduler + -update Update lnInclude directories and dep files USAGE # Print options for building code documentation @@ -122,6 +123,11 @@ do -no-scheduler) unset WM_SCHEDULER ;; + # Update lnInclude directories and dep files following a pull + -update) + wrmdep -update + wmakeLnIncludeAll + ;; # Generate documentation doc) test -n "$genDoc" || usage "invalid option '$1'" From 608dd321d18f2d9900dd615747a0f4d693bf96ac Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 14 Dec 2015 17:49:02 +0000 Subject: [PATCH 12/13] wcleanAll, wrmdep: Updated check for the WM_PROJECT_DIR --- wmake/wcleanAll | 3 ++- wmake/wrmdep | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wmake/wcleanAll b/wmake/wcleanAll index f4dfaf5f3..e26504b7e 100755 --- a/wmake/wcleanAll +++ b/wmake/wcleanAll @@ -61,7 +61,8 @@ do esac done -[ -d bin -a -d src ] || usage "not in the project top level directory" +[ "$PWD" = "$WM_PROJECT_DIR" ] \ + || usage "Not in the project top-level directory" echo "Removing platforms/sub-directories" diff --git a/wmake/wrmdep b/wmake/wrmdep index cea58c901..785327968 100755 --- a/wmake/wrmdep +++ b/wmake/wrmdep @@ -190,7 +190,8 @@ oldFolders) updateMode) - [ -d bin -a -d src ] || usage "Not in the project top-level directory" + [ "$PWD" = "$WM_PROJECT_DIR" ] \ + || usage "Not in the project top-level directory" echo "Purging all dep files that relate to files that no longer exist..." fileNameList=$(find -L src applications -name '*.[CHL]' -type l \ From d1992c7e99960ea72071293fac305813306be9a5 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 14 Dec 2015 18:23:50 +0000 Subject: [PATCH 13/13] wmake/makeWmake: Removed Legacy script which is no longer used --- wmake/makeWmake | 73 ------------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100755 wmake/makeWmake diff --git a/wmake/makeWmake b/wmake/makeWmake deleted file mode 100755 index 98b5b55e1..000000000 --- a/wmake/makeWmake +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# ========= | -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox -# \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation -# \\/ 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 3 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, see . -# -# Script -# makeWmake -# -# Description -# Build platform-specific parts of wmake -# -#------------------------------------------------------------------------------ -Script=${0##*/} - -usage() { - exec 1>&2 - while [ "$#" -ge 1 ]; do echo "$1"; shift; done - cat<