From 742fa759859918fdecf4620b2d640e2f32c8d64f Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 14 Jun 2011 12:53:43 +0100 Subject: [PATCH 01/10] ENH: Updated web address --- doc/codingStyleGuide.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/codingStyleGuide.org b/doc/codingStyleGuide.org index 5dbc934422..6b7f61f710 100644 --- a/doc/codingStyleGuide.org +++ b/doc/codingStyleGuide.org @@ -3,7 +3,7 @@ #+TITLE: OpenFOAM C++ style guide #+AUTHOR: OpenCFD Ltd. #+DATE: Feb 2011 -#+LINK: http://www.opencfd.co.uk +#+LINK: http://www.OpenFOAM.com #+OPTIONS: author:nil ^:{} #+STARTUP: hidestars #+STARTUP: odd From 135edbacddda70939eb252c280cc4bc5dd1eaf95 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 14 Jun 2011 12:54:21 +0100 Subject: [PATCH 02/10] ENH: Updated foamInstallationTest --- bin/foamInstallationTest | 64 ++++++++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 15 deletions(-) diff --git a/bin/foamInstallationTest b/bin/foamInstallationTest index f210685a73..5185e9c775 100755 --- a/bin/foamInstallationTest +++ b/bin/foamInstallationTest @@ -32,8 +32,6 @@ #------------------------------------------------------------------------------ # Base settings -FOAM_VERSION=1.6 -SUPPLIED_VERSION_GCC=4.4.3 MIN_VERSION_GCC=4.3.3 # General @@ -247,19 +245,54 @@ reportExecutable() VERSION=`$1 -case /dev/null 2>&1 \ | sed -ne 's/^.*Version: *\([^ ][^ ]*\).*/\1/p'` ;; + flex) + VERSION=`$1 --version /dev/null 2>&1 \ + | sed -ne 's/flex \([0-9][0-9.]*\).*/\1/p' ` + ;; gcc) - VERSION=`$1 -v 2>&1 \ + VERSION=`$1 -v 2>&1 \ | sed -ne 's/^gcc version \([0-9][0-9.]*\).*/\1/p' ` - if [ "$VERSION" != "$SUPPLIED_VERSION_GCC" ] - then - echo "WARNING: gcc version does not match gcc supplied" \ - "with this release of OpenFOAM" - echo " Supplied version: $SUPPLIED_VERSION_GCC" - echo " User version : $VERSION" - echo " Minimum required: $MIN_VERSION_GCC" - echo "" + MINV1=`echo $MIN_VERSION_GCC | cut -d. -f1` + MINV2=`echo $MIN_VERSION_GCC | cut -d. -f2` + MINV3=`echo $MIN_VERSION_GCC | cut -d. -f3` + + V1=`echo $VERSION | cut -d. -f1` + V2=`echo $VERSION | cut -d. -f2` + V3=`echo $VERSION | cut -d. -f3` + + + gccOK="" + pass="" + if [ $V1 -lt $MINV1 ]; then + gccOk="ERROR" + elif [ $V1 -gt $MINV1 ]; then + pass="yes" fi + + if [ "$pass" == "" ] && [ "$gccOk" == "" ]; then + if [ $V2 -lt $MINV2 ]; then + gccOk="ERROR" + elif [ $V2 -gt $MINV2 ]; then + pass="yes" + fi + fi + + if [ "$pass" == "" ] && [ "$gccOk" == "" ] && [ $V3 != "" ] && [ $MINV3 != "" ]; then + if [ $V3 -lt $MINV3 ]; then + gccOk="ERROR" + fi + fi + + if [ "$gccOk" != "" ]; then + echo "ERROR: gcc version is too old for this release of OpenFOAM" + echo " User version : $VERSION" + echo " Minimum required: $MIN_VERSION_GCC" + echo "" + fatalError=`expr $fatalError + 1` + fi + + ;; gtar) VERSION=`$APP_PATH --version | head -1` @@ -304,7 +337,7 @@ checkOpenFOAMEnvironment() echo "FATAL ERROR: OpenFOAM environment not configured." echo "" echo " Please refer to the installation section of the README file:" - echo " /OpenFOAM-${FOAM_VERSION}/README" + echo " /OpenFOAM-${WM_PROJECT_VERSION}/README" echo " to source the OpenFOAM environment." echo "" exit 1 @@ -320,7 +353,7 @@ checkUserShell() ;; *) echo "FATAL ERROR: Cannot identify the shell you are running." - echo " OpenFOAM ${FOAM_VERSION} is compatible with " + echo " OpenFOAM ${WM_PROJECT_VERSION} is compatible with " echo " csh, tcsh, ksh and bash." echo fatalError=`expr $fatalError + 1` @@ -336,7 +369,7 @@ checkHostName() then echo "FATAL ERROR: Cannot stat hostname." echo " Contact your system administrator, " - echo " OpenFOAM ${FOAM_VERSION} needs a valid " + echo " OpenFOAM ${WM_PROJECT_VERSION} needs a valid " echo " hostname to function." echo fatalError=`expr $fatalError + 1` @@ -352,7 +385,7 @@ checkOS() ;; *) echo "FATAL ERROR: Incompatible operating system \"$OSTYPE\"." - echo " OpenFOAM $FOAM_VERSION is currently " + echo " OpenFOAM ${FWM_PROJECT_VERSION} is currently " echo " available for Linux and SunOS only." echo fatalError=`expr $fatalError + 1` @@ -423,6 +456,7 @@ COL3=`fixlen Location 10` hline echo "$COL1 $COL2 $COL3" hline +reportExecutable flex reportExecutable gcc reportExecutable gzip if [ "$OSTYPE" = Linux ] From 2b1052a05455527c32b4c77d1733c6c760312fc3 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 14 Jun 2011 12:55:02 +0100 Subject: [PATCH 03/10] ENH: Updated foamSystemCheck --- bin/foamSystemCheck | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bin/foamSystemCheck b/bin/foamSystemCheck index 7a0a66c14e..e00c1584ee 100755 --- a/bin/foamSystemCheck +++ b/bin/foamSystemCheck @@ -33,8 +33,6 @@ # STATIC VARIABLES # ~~~~~~~~~~~~~~~~ -FOAM_VERSION=1.6 - HLINE="-----------------------------------------------------------------------" WIDTH=16 unset fatalError @@ -92,7 +90,7 @@ case "$SHELL" in ;; *) echo "ERROR: Cannot identify the current shell." - echo " OpenFOAM $FOAM_VERSION is compatible" + echo " OpenFOAM $WM_PROJECT_VERSION is compatible" echo " with csh, tcsh, ksh and bash." echo fatalError=true @@ -105,8 +103,8 @@ echo "$(fixlen Host: $WIDTH) $HOST" if [ $(length $HOST) -eq 0 ] then echo "ERROR: Cannot stat hostname." - echo " OpenFOAM $FOAM_VERSION needs a valid hostname to function." - echo " Contact your system administrator. " + echo " OpenFOAM $WM_PROJECT_VERSION needs a valid hostname to" + echo " function. Contact your system administrator." echo fatalError=true fi @@ -119,7 +117,7 @@ Linux | LinuxAMD64 | SunOS ) ;; *) echo "ERROR: Incompatible operating system \"$OSTYPE\"." - echo " OpenFOAM $FOAM_VERSION is currently available for " + echo " OpenFOAM $WM_PROJECT_VERSION is currently available for " echo " Linux, LinuxAMD64 and SunOS only." echo fatalError=true @@ -138,7 +136,7 @@ echo "$(fixlen User: $WIDTH) ${USER_NAME}" if [ $(length $USER_NAME) -eq 0 ] then echo "ERROR: Cannot stat user name $USER_NAME." - echo " OpenFOAM $FOAM_VERSION needs a valid user name." + echo " OpenFOAM $WM_PROJECT_VERSION needs a valid user name." echo " Contact your system administrator. " echo fatalError=true From 87722361b6f42cf37f7ebe60d2f8fabc2d36f1cd Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 14 Jun 2011 12:56:04 +0100 Subject: [PATCH 04/10] STYLE: Updated copyright dates --- bin/foamInstallationTest | 2 +- bin/foamSystemCheck | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/foamInstallationTest b/bin/foamInstallationTest index 5185e9c775..67a7edf6ed 100755 --- a/bin/foamInstallationTest +++ b/bin/foamInstallationTest @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License diff --git a/bin/foamSystemCheck b/bin/foamSystemCheck index e00c1584ee..003e60e1f3 100755 --- a/bin/foamSystemCheck +++ b/bin/foamSystemCheck @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License From 2d2ecac7e5a7e7a7e52f903b71f8619d555ad19b Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 14 Jun 2011 13:08:19 +0100 Subject: [PATCH 05/10] ENH: Updated foamLog.db gamma->alpha1 --- bin/tools/foamLog.db | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/tools/foamLog.db b/bin/tools/foamLog.db index 49d551f32c..f4c05bc010 100644 --- a/bin/tools/foamLog.db +++ b/bin/tools/foamLog.db @@ -48,6 +48,6 @@ epsMax/bounding epsilon,/max: epsAvg/bounding epsilon,/average: #- gamma bounding -gammaMin/Min\(gamma\) =/Min(gamma) = -gammaMax/Max\(gamma\) =/Max(gamma) = +alpha1Min/Min\(alpha1\) =/Min(alpha1) = +alpha1Max/Max\(alpha1\) =/Max(alpha1) = From cb684c42baed1e37e811333457274f2d58db5916 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 14 Jun 2011 13:23:45 +0100 Subject: [PATCH 06/10] STYLE: Code conformance tweaks --- .../viewFactorsGen/searchingEngine.H | 2 +- .../viewFactorsGen/viewFactorsGen.C | 104 +++++++++--------- 2 files changed, 50 insertions(+), 56 deletions(-) diff --git a/applications/utilities/preProcessing/viewFactorsGen/searchingEngine.H b/applications/utilities/preProcessing/viewFactorsGen/searchingEngine.H index 17de4fbf6c..fad039b3b2 100644 --- a/applications/utilities/preProcessing/viewFactorsGen/searchingEngine.H +++ b/applications/utilities/preProcessing/viewFactorsGen/searchingEngine.H @@ -24,7 +24,7 @@ dict.add dict.add("mergeDistance", SMALL); labelHashSet includePatches; -forAll(patches, patchI) // +forAll(patches, patchI) { if (!isA(patches[patchI])) { diff --git a/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C b/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C index cd852f59c3..1cbaf9ca43 100644 --- a/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C +++ b/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C @@ -125,7 +125,6 @@ scalar calculateViewFactorFij (cosThetaI*cosThetaJ*dAjMag*dAiMag) /(sqr(rMag)*constant::mathematical::pi) ); - } @@ -152,7 +151,7 @@ void insertMatrixElements } -// Main program: +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { @@ -161,7 +160,7 @@ int main(int argc, char *argv[]) #include "createTime.H" #include "createNamedMesh.H" - // Read view factor dictionary + // Read view factor dictionary IOdictionary viewFactorDict ( IOobject @@ -180,8 +179,6 @@ int main(int argc, char *argv[]) const bool dumpRays = viewFactorDict.lookupOrDefault("dumpRays", false); - // Debug - // ~~~~~ const label debug = viewFactorDict.lookupOrDefault