From a5b19972d949a51e4f2a59698c2319d6bc42ab24 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 6 Apr 2011 14:55:23 +0100 Subject: [PATCH 1/6] STYLE: Corrected coding style --- .../radiationModel/viewFactor/viewFactor.C | 47 +++++++++---------- .../radiationModel/viewFactor/viewFactorI.H | 3 +- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/src/thermophysicalModels/radiationModels/radiationModel/viewFactor/viewFactor.C b/src/thermophysicalModels/radiationModels/radiationModel/viewFactor/viewFactor.C index a8d736e4c4..759f50297b 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/viewFactor/viewFactor.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/viewFactor/viewFactor.C @@ -102,7 +102,6 @@ Foam::radiation::viewFactor::viewFactor(const volScalarField& T) iterCounter_(0), pivotIndices_(0) { - const polyBoundaryMesh& coarsePatches = coarseMesh_.boundaryMesh(); const volScalarField::GeometricBoundaryField& Qrp = Qr_.boundaryField(); @@ -116,7 +115,7 @@ Foam::radiation::viewFactor::viewFactor(const volScalarField& T) { selectedPatches_[count] = QrPatchI.patch().index(); nLocalCoarseFaces_ += coarsePatches[patchI].size(); - count ++; + count++; } } @@ -124,8 +123,8 @@ Foam::radiation::viewFactor::viewFactor(const volScalarField& T) if (debug) { - Pout << "SelectedPatches:" << selectedPatches_ << endl; - Pout << "Number of coarse faces:" << nLocalCoarseFaces_ << endl; + Pout<< "Selected patches:" << selectedPatches_ << endl; + Pout<< "Number of coarse faces:" << nLocalCoarseFaces_ << endl; } totalNCoarseFaces_ = nLocalCoarseFaces_; @@ -133,7 +132,7 @@ Foam::radiation::viewFactor::viewFactor(const volScalarField& T) if (Pstream::master()) { - Info << "Total number of clusters : " << totalNCoarseFaces_ << endl; + Info<< "Total number of clusters : " << totalNCoarseFaces_ << endl; } labelListIOList subMap @@ -228,7 +227,7 @@ Foam::radiation::viewFactor::viewFactor(const volScalarField& T) new scalarSquareMatrix(totalNCoarseFaces_, totalNCoarseFaces_, 0.0) ); - Info << "Insert elemets in the matrix.." << endl; + Info<< "Insert elements in the matrix..." << endl; for (label procI = 0; procI < Pstream::nProcs(); procI++) { @@ -244,19 +243,19 @@ Foam::radiation::viewFactor::viewFactor(const volScalarField& T) bool smoothing = readBool(coeffs_.lookup("smoothing")); - if(smoothing) + if (smoothing) { - Info << "Smoothing the matrix..." << endl; + Info<< "Smoothing the matrix..." << endl; - for(label i=0; i localCoarseEave(nLocalCoarseFaces_); DynamicList localCoarseHoave(nLocalCoarseFaces_); - forAll (selectedPatches_, i) + forAll(selectedPatches_, i) { label patchID = selectedPatches_[i]; @@ -364,7 +363,7 @@ void Foam::radiation::viewFactor::calculate() const labelList& coarsePatchFace = coarseMesh_.patchFaceMap()[patchID]; const labelList& agglom = finalAgglom_[patchID]; - label nAgglom = max(agglom)+1; + label nAgglom = max(agglom) + 1; labelListList coarseToFine(invertOneToMany(nAgglom, agglom)); @@ -413,7 +412,7 @@ void Foam::radiation::viewFactor::calculate() labelList localGlobalIds(nLocalCoarseFaces_); - for (label k = 0; k < nLocalCoarseFaces_; k++) + for(label k = 0; k < nLocalCoarseFaces_; k++) { localGlobalIds[k] = globalNumbering.toGlobal(Pstream::myProcNo(), k); } @@ -479,14 +478,14 @@ void Foam::radiation::viewFactor::calculate() } } - Info<< "\nSolving view factor equations.." << endl; + Info<< "\nSolving view factor equations..." << endl; // Negative coming into the fluid LUsolve(C, q); } else //Constant emissivity { // Initial iter calculates CLU and chaches it - if(iterCounter_ == 0) + if (iterCounter_ == 0) { for (label i=0; i Foam::radiation::viewFactor::Rp() const Foam::tmp > Foam::radiation::viewFactor::Ru() const { - tmp > tRu + return tmp > ( new DimensionedField ( IOobject ( - "tRu", + "Ru", mesh_.time().timeName(), mesh_, IOobject::NO_READ, @@ -633,8 +632,6 @@ Foam::radiation::viewFactor::Ru() const dimensionedScalar("zero", dimMass/dimLength/pow3(dimTime), 0.0) ) ); - - return tRu; } diff --git a/src/thermophysicalModels/radiationModels/radiationModel/viewFactor/viewFactorI.H b/src/thermophysicalModels/radiationModels/radiationModel/viewFactor/viewFactorI.H index 5e903d5ed5..48138ae404 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/viewFactor/viewFactorI.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/viewFactor/viewFactorI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,7 +23,6 @@ License \*---------------------------------------------------------------------------*/ - inline const Foam::volScalarField& Foam::radiation::viewFactor::Qr() const { return Qr_; From f0554905a1a641fc5da5f3af2bd586a2c4d95299 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 6 Apr 2011 15:14:25 +0100 Subject: [PATCH 2/6] ENH: Removed OpenCFD-specific behaviour out of hooks --- bin/tools/pre-commit-hook | 42 ++------------------------------------ bin/tools/pre-receive-hook | 42 ++------------------------------------ 2 files changed, 4 insertions(+), 80 deletions(-) diff --git a/bin/tools/pre-commit-hook b/bin/tools/pre-commit-hook index 44518f0837..94018f90b7 100755 --- a/bin/tools/pre-commit-hook +++ b/bin/tools/pre-commit-hook @@ -39,7 +39,6 @@ # # Checks for # - illegal code, e.g. -# - copyright is current, e.g. if present, contains XXX- # - columns greater than 80 for *.[CH] files # # Note @@ -138,8 +137,8 @@ checkIllegalCode() { echo "$hookName: check bad strings/characters etc ..." 1>&2 - reBad="(N""abla|"$'\t'")" - msgBad="N""abla or " + reBad="("$'\t'")" + msgBad="" scope=$(gitScope $@) @@ -167,40 +166,6 @@ checkIllegalCode() } -# -# check that OpenCFD copyright is current -# -checkCopyright() -{ - year=$(date +%Y) - echo "$hookName: check copyright ..." 1>&2 - - scope=$(gitScope $@) - - badFiles=$( - for f in $fileList - do - # NB: need to have OpenCFD on a separate line to prevent - # this check being caught by itself! - # - # parse line numbers from grep output: - # : contents - # - lines=$(git grep -F -hn -e Copyright \ - --and -e OpenCFD \ - --and --not -e "$year" \ - $scope"$f" | - sed -e 's@:.*@@' | - tr '\n' ' ' - ) - [ -n "$lines" ] && echo "$Indent$f -- lines: $lines" - done - ) - - dieOnBadFiles "Update copyright year, e.g. XXXX-$year" -} - - # # limit line length to 80-columns # @@ -308,9 +273,6 @@ bad=$(git diff-index --cached --check $against --) || die "$bad" # check for illegal code, e.g. , etc checkIllegalCode -# ensure OpenCFD copyright contains correct year -checkCopyright - # ensure code conforms to 80 columns max checkLineLengthNonDirective diff --git a/bin/tools/pre-receive-hook b/bin/tools/pre-receive-hook index 641185cf13..efae65d5f1 100755 --- a/bin/tools/pre-receive-hook +++ b/bin/tools/pre-receive-hook @@ -39,7 +39,6 @@ # # Checks for # - illegal code, e.g. -# - copyright is current, e.g. if present, contains XXX- # - columns greater than 80 for *.[CH] files # #------------------------------------------------------------------------------ @@ -101,8 +100,8 @@ checkIllegalCode() { echo "$hookName: check bad strings/characters etc ..." 1>&2 - reBad="(N""abla|"$'\t'"|"$'\r\n'")" - msgBad="N""abla, or DOS-line-endings" + reBad="("$'\t'"|"$'\r\n'")" + msgBad=" or DOS-line-endings" scope=$(gitScope $@) @@ -130,40 +129,6 @@ checkIllegalCode() } -# -# check that OpenCFD copyright is current -# -checkCopyright() -{ - year=$(date +%Y) - echo "$hookName: check copyright ..." 1>&2 - - scope=$(gitScope $@) - - badFiles=$( - for f in $fileList - do - # NB: need to have OpenCFD on a separate line to prevent - # this check being caught by itself! - # - # parse line numbers from grep output: - # : contents - # - lines=$(git grep -F -hn -e Copyright \ - --and -e OpenCFD \ - --and --not -e "$year" \ - $scope"$f" | - sed -e 's@:.*@@' | - tr '\n' ' ' - ) - [ -n "$lines" ] && echo "$Indent$f -- lines: $lines" - done - ) - - dieOnBadFiles "Update copyright year, e.g. XXXX-$year" -} - - # # limit line length to 80-columns # @@ -297,9 +262,6 @@ do # check for illegal code, e.g. , etc checkIllegalCode $newSHA1 - # ensure OpenCFD copyright contains correct year - checkCopyright $newSHA1 - # ensure code conforms to 80 columns max checkLineLengthNonDirective $newSHA1 From 96b171adfe7f57e425abc470023817f1ba8f5cc4 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 6 Apr 2011 16:07:33 +0100 Subject: [PATCH 3/6] GIT: testing --- COPYING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COPYING b/COPYING index 2101277c18..9ee050eeb3 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ - GNU GENERAL PUBLIC LICENSE +XXX GNU GENERAL PUBLIC LICENSE OpenFOAM(R) is Copyright (C) 2004-2011 OpenCFD Ltd. Contact: OpenCFD (enquiries@OpenCFD.co.uk) From 765d659faace6ecd32be2baa69559deace86e283 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 6 Apr 2011 16:08:47 +0100 Subject: [PATCH 4/6] GIT: testing --- COPYING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COPYING b/COPYING index 9ee050eeb3..2101277c18 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -XXX GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE OpenFOAM(R) is Copyright (C) 2004-2011 OpenCFD Ltd. Contact: OpenCFD (enquiries@OpenCFD.co.uk) From f0e2fd049ed341529b621c2ba05f9a91c776c1ec Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 6 Apr 2011 16:11:01 +0100 Subject: [PATCH 5/6] GIT: testing --- COPYING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COPYING b/COPYING index 2101277c18..9ee050eeb3 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ - GNU GENERAL PUBLIC LICENSE +XXX GNU GENERAL PUBLIC LICENSE OpenFOAM(R) is Copyright (C) 2004-2011 OpenCFD Ltd. Contact: OpenCFD (enquiries@OpenCFD.co.uk) From be3d8be65a5269777a4ca56592b45059734cf005 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 6 Apr 2011 16:11:30 +0100 Subject: [PATCH 6/6] GIT: testing --- COPYING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COPYING b/COPYING index 9ee050eeb3..2101277c18 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -XXX GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE OpenFOAM(R) is Copyright (C) 2004-2011 OpenCFD Ltd. Contact: OpenCFD (enquiries@OpenCFD.co.uk)