From b4a2f37f1b99d135bc37219999d10879e10c199a Mon Sep 17 00:00:00 2001 From: sergio Date: Mon, 8 Dec 2008 13:51:31 +0000 Subject: [PATCH 01/23] PDRFoam documentation completion --- .../XiEqModels/basicXiSubXiEq/basicXiSubXiEq.H | 2 +- .../PDRModels/XiGModels/basicXiSubG/basicXiSubG.H | 2 +- .../PDRModels/dragModels/PDRDragModel/PDRDragModel.H | 5 +++-- .../PDRFoam/PDRModels/dragModels/basic/basic.H | 4 ++-- .../PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C | 2 +- .../PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H | 6 +++--- .../PDRFoam/XiModels/XiEqModels/Gulder/Gulder.H | 2 +- .../XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.H | 8 ++++++-- .../XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.H | 4 +++- .../XiModels/XiEqModels/XiEqModel/XiEqModel.H | 8 +++++++- .../XiEqModels/instabilityXiEq/instabilityXiEq.H | 8 ++++++-- .../combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.H | 5 +++-- .../PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.H | 5 ++++- .../XiModels/XiGModels/instabilityG/instabilityG.H | 7 +++++-- .../combustion/PDRFoam/XiModels/XiModel/XiModel.H | 12 +++++++----- .../PDRFoam/XiModels/algebraic/algebraic.H | 4 +++- .../combustion/PDRFoam/XiModels/fixed/fixed.H | 5 +++-- .../PDRFoam/XiModels/transport/transport.H | 4 +++- .../laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.H | 2 +- 19 files changed, 63 insertions(+), 32 deletions(-) diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.H b/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.H index 04cc2a83ca..335012c868 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.H +++ b/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - basicSubGrid + Foam::XiEqModels::basicSubGrid Description Basic sub-grid obstacle flame-wrinking enhancement factor model. diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.H b/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.H index a455fd28b4..d844dca34e 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.H +++ b/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - basicSubGrid + Foam::XiGModel::basicSubGrid Description diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.H b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.H index 3448d1166c..9844a4cf35 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.H +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.H @@ -23,10 +23,11 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - PDRDragModel + Foam::PDRDragModel Description - Base-class for sub-grid obstacle drag models. + Base-class for sub-grid obstacle drag models. The available drag model is at + \link basic.H \endlink. SourceFiles PDRDragModel.C diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.H b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.H index 05ec433919..f021b6829e 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.H +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - basic + Foam::PDRDragModels::basic Description Basic sub-grid obstacle drag model. @@ -70,7 +70,7 @@ Description \f$ T \f$ is a tensor in the file CT. The term \f$ G_{R} \f$ is treated explicitly in the \f$ \kappa-\epsilon - \f$ Eqs in the PDRkEpsilon.C file. + \f$ Eqs in the \link PDRkEpsilon.C \endlink file. SourceFiles diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C index a0e4bcfdb0..463acf2448 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C @@ -50,7 +50,7 @@ PDRkEpsilon::PDRkEpsilon const volScalarField& rho, const volVectorField& U, const surfaceScalarField& phi, - const basicThermo& thermophysicalModel + basicThermo& thermophysicalModel ) : RASModel(typeName, rho, U, phi, thermophysicalModel), diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H index b35ef9151e..8fa9d2dfcc 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H +++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H @@ -23,11 +23,11 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - PDRkEpsilon + Foam::compressible::RASModels::PDRkEpsilon Description Standard k-epsilon turbulence model with additional source terms - corresponding to PDR basic drag model (basic.H) + corresponding to PDR basic drag model (\link basic.H \endlink) The turbulence source term \f$ G_{R} \f$ appears in the \f$ \kappa-\epsilon \f$ equation for the generation of turbulence due to @@ -93,7 +93,7 @@ public: const volScalarField& rho, const volVectorField& U, const surfaceScalarField& phi, - const basicThermo& thermophysicalModel + basicThermo& thermophysicalModel ); diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.H b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.H index d8bc58b170..c361e81946 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.H +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Gulder + Foam::XiEqModels::Gulder Description Simple Gulder model for XiEq based on Gulders correlation diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.H b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.H index b9a45ffb63..0747fec865 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.H +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.H @@ -23,10 +23,14 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - SCOPEBlend + Foam::XiEqModels::SCOPEBlend Description - + Simple SCOPEBlendXiEq model for XiEq based on SCOPEXiEqs correlation + with a linear correction function to give a plausible profile for XiEq. + See \link SCOPELaminarFlameSpeed.H \endlink for details on the SCOPE laminar + flame speed model. + SourceFiles SCOPEBlend.C diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.H b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.H index b2b2b35edf..a10b07e35e 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.H +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.H @@ -23,11 +23,13 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - SCOPEXiEq + Foam::XiEqModel::SCOPEXiEq Description Simple SCOPEXiEq model for XiEq based on SCOPEXiEqs correlation with a linear correction function to give a plausible profile for XiEq. + See \link SCOPELaminarFlameSpeed.H \endlink for details on the SCOPE laminar + flame speed model. SourceFiles SCOPEXiEq.C diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.H b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.H index 2c35877f5e..150ff09782 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.H +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.H @@ -23,10 +23,16 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - XiEqModel + Foam::XiEqModel Description Base-class for all XiEq models used by the b-XiEq combustion model. + The available models are : + \link basicXiSubXiEq.H \endlink + \link Gulder.H \endlink + \link instabilityXiEq.H \endlink + \link SCOPEBlendXiEq.H \endlink + \link SCOPEXiEq.H \endlink SourceFiles XiEqModel.C diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.H b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.H index 455635dc08..8c8aa51e04 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.H +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.H @@ -23,10 +23,14 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - instability + Foam::XiEqModels::instability Description - + + This is the equilibrium level of the flame wrinkling generated by + inestability. It is a constant (default 2.5). It is used in + \link XiModel.H \endlink. + SourceFiles instability.C diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.H b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.H index 8884c00deb..ab77cf1c9d 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.H +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.H @@ -23,10 +23,11 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - KTS + Foam::XiGModels::KTS Description - Simple Kolmogorov time-scale model for the flame-wrinling generation rate. + Simple Kolmogorov time-scale (KTS) model for the flame-wrinling generation + rate. SourceFiles KTS.C diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.H b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.H index 908dc3a623..0e3dd00db1 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.H +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.H @@ -23,10 +23,13 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - XiGModel + Foam::XiGModel Description Base-class for all Xi generation models used by the b-Xi combustion model. + See Technical Report SH/RE/01R for details on the PDR modelling. For details + on the use of XiGModel see \link XiModel.H \endlink. The model available is + \link instabilityG.H \endlink SourceFiles XiGModel.C diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.H b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.H index 596e86229b..2b92efdac9 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.H +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.H @@ -23,10 +23,13 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - instabilityG + Foam::XiGModels::instabilityG Description - Flame-surface instabilityG flame-wrinking generation rate coefficient model. + Flame-surface instabilityG flame-wrinking generation rate coefficient model + used in \link XiModel.H \endlink. + + See Technical Report SH/RE/01R for details on the PDR modelling. SourceFiles instabilityG.C diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.H b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.H index 2b76f9bc92..dc1936b8cd 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.H +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.H @@ -23,14 +23,16 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - XiModel + Foam::XiModel Description Base-class for all Xi models used by the b-Xi combustion model. See Technical Report SH/RE/01R for details on the PDR modelling. - Xi is given through an algebraic expression (algebraic.H), - by solving a transport equation (transport.H) or a fixed value (fixed.H). + Xi is given through an algebraic expression (\link algebraic.H \endlink), + by solving a transport equation (\link transport.H \endlink) or a + fixed value (\link fixed.H \endlink). + See report TR/HGW/10 for details on the Weller two equations model. In the algebraic and transport methods \f$\Xi_{eq}\f$ is calculated in @@ -45,6 +47,8 @@ Description \f$ \dwea{b} \f$ is the regress variable. + \f$ \Xi_{coeff} \f$ is a model constant. + \f$ \Xi^* \f$ is the total equilibrium wrinkling combining the effects of the flame inestability and turbulence interaction and is given by @@ -102,8 +106,6 @@ namespace Foam Class XiModel Declaration \*---------------------------------------------------------------------------*/ - - class XiModel { diff --git a/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.H b/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.H index 9da38cf00d..9feb1d713a 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.H +++ b/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.H @@ -23,11 +23,13 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - algebraic + Foam::XiModels::algebraic Description Simple algebraic model for Xi based on Gulders correlation with a linear correction function to give a plausible profile for Xi. + See report TR/HGW/10 for details on the Weller two equations model. + See \link XiModel.H \endlink for more details on flame wrinkling modelling. SourceFiles algebraic.C diff --git a/applications/solvers/combustion/PDRFoam/XiModels/fixed/fixed.H b/applications/solvers/combustion/PDRFoam/XiModels/fixed/fixed.H index 64c44fdff4..230ff204a1 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/fixed/fixed.H +++ b/applications/solvers/combustion/PDRFoam/XiModels/fixed/fixed.H @@ -23,10 +23,11 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - fixed + Foam::XiModels::fixed Description - Fixed value model for Xi. + Fixed value model for Xi. See \link XiModel.H \endlink for more details + on flame wrinkling modelling. SourceFiles fixed.C diff --git a/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.H b/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.H index db2a7255aa..8e6ebe45d3 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.H +++ b/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.H @@ -23,11 +23,13 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - transport + Foam::XiModels::transport Description Simple transport model for Xi based on Gulders correlation with a linear correction function to give a plausible profile for Xi. + See report TR/HGW/10 for details on the Weller two equations model. + See \link XiModel.H \endlink for more details on flame wrinkling modelling. SourceFiles transport.C diff --git a/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.H b/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.H index 8c65453b94..029d31f25d 100644 --- a/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.H +++ b/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - SCOPE + Foam::laminarFlameSpeedModels::SCOPE Description Laminar flame speed obtained from the SCOPE correlation. From 1cd18ce0b5b8893eb093f2db5ad219b24475ef71 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 7 Jan 2009 21:06:08 +0100 Subject: [PATCH 02/23] added wmakeLnIncludeAll - can be quite useful after a wcleanLnIncludeAll --- wmake/rules/SiCortex64Gcc/mplib | 6 +-- wmake/rules/SiCortex64Gcc/mplibMPI | 2 +- wmake/wcleanLnIncludeAll | 1 + wmake/wmakeLnIncludeAll | 69 ++++++++++++++++++++++++++++++ wmake/wmkdir | 22 +++++----- 5 files changed, 85 insertions(+), 15 deletions(-) create mode 100755 wmake/wmakeLnIncludeAll diff --git a/wmake/rules/SiCortex64Gcc/mplib b/wmake/rules/SiCortex64Gcc/mplib index 8a84b40146..294bd86150 100644 --- a/wmake/rules/SiCortex64Gcc/mplib +++ b/wmake/rules/SiCortex64Gcc/mplib @@ -1,3 +1,3 @@ -PFLAGS = -PINC = -PLIBS = +PFLAGS = +PINC = +PLIBS = diff --git a/wmake/rules/SiCortex64Gcc/mplibMPI b/wmake/rules/SiCortex64Gcc/mplibMPI index 4b284e2439..1fb55dd946 100644 --- a/wmake/rules/SiCortex64Gcc/mplibMPI +++ b/wmake/rules/SiCortex64Gcc/mplibMPI @@ -1,3 +1,3 @@ PFLAGS = -DMPICH_SKIP_MPICXX -PINC = +PINC = PLIBS = -lscmpi diff --git a/wmake/wcleanLnIncludeAll b/wmake/wcleanLnIncludeAll index 8e032fa17c..0ca7561c6a 100755 --- a/wmake/wcleanLnIncludeAll +++ b/wmake/wcleanLnIncludeAll @@ -40,6 +40,7 @@ then echo "Usage: ${0##*/} [dir1] .. [dirN]" echo echo " Delete all the lnInclude directories in the tree" + echo exit 1 fi diff --git a/wmake/wmakeLnIncludeAll b/wmake/wmakeLnIncludeAll new file mode 100755 index 0000000000..1eb5544d08 --- /dev/null +++ b/wmake/wmakeLnIncludeAll @@ -0,0 +1,69 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\/ 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 +# +# Script +# wmakeLnIncludeAll +# +# Description +# Find directories containing a Make/ directory and execute +# 'wmakeLnInclude -f' for each one +# +#------------------------------------------------------------------------------ +# default is pwd +if [ "$#" -eq 0 ] +then + set -- . +elif [ "$1" = "-h" -o "$1" = "-help" ] +then + echo "Usage: ${0##*/} [dir1] .. [dirN]" + echo + echo " Find directories containing a Make/ directory and" + echo " execute 'wmakeLnInclude -f' for each one" + echo + exit 1 +fi + + +for checkDir +do + if [ -d $checkDir ] + then + echo "searching: $checkDir for 'Make' directories" + else + echo "skipping non-dir: $checkDir" + continue + fi + + find $checkDir -depth -type d -name Make -print | while read dir + do + dir=${dir%Make} + if [ -d "$dir" ] + then + wmakeLnInclude -f $dir + fi + done +done + +#------------------------------------------------------------------------------ diff --git a/wmake/wmkdir b/wmake/wmkdir index 51e8a134e3..441eedb52d 100755 --- a/wmake/wmkdir +++ b/wmake/wmkdir @@ -27,22 +27,22 @@ # wmkdir # # Description -# Script that makes a directory is not already constructed. -# Usage : wmkdir +# Script to make a directory that does not already exist +# Usage : wmkdir # #------------------------------------------------------------------------------ if [ $# -eq 1 ] then - # provide help - if [ "$1" = "-h" -o "$1" = "-help" ] - then - echo "usage: ${0##*/} " - echo " mkdir if directory does not already exist" - else - [ -d "$1" ] || mkdir -p "$1" - fi + # provide help + if [ "$1" = "-h" -o "$1" = "-help" ] + then + echo "usage: ${0##*/} " + echo " mkdir if directory does not already exist" + echo + else + [ -d "$1" ] || mkdir -p "$1" + fi fi - #------------------------------------------------------------------------------ From 7ae9a0d0d999e476622d0aecac84228708abbb96 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 8 Jan 2009 14:48:48 +0100 Subject: [PATCH 03/23] added tiny applications/test/foamVersion/foamVersionString.C --- applications/test/foamVersion/Make/files | 3 ++ applications/test/foamVersion/Make/options | 2 + .../test/foamVersion/foamVersionString.C | 44 +++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 applications/test/foamVersion/Make/files create mode 100644 applications/test/foamVersion/Make/options create mode 100644 applications/test/foamVersion/foamVersionString.C diff --git a/applications/test/foamVersion/Make/files b/applications/test/foamVersion/Make/files new file mode 100644 index 0000000000..eb39f3ac88 --- /dev/null +++ b/applications/test/foamVersion/Make/files @@ -0,0 +1,3 @@ +foamVersionString.C + +EXE = $(FOAM_USER_APPBIN)/foamVersionString diff --git a/applications/test/foamVersion/Make/options b/applications/test/foamVersion/Make/options new file mode 100644 index 0000000000..6a9e9810b3 --- /dev/null +++ b/applications/test/foamVersion/Make/options @@ -0,0 +1,2 @@ +/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */ +/* EXE_LIBS = -lfiniteVolume */ diff --git a/applications/test/foamVersion/foamVersionString.C b/applications/test/foamVersion/foamVersionString.C new file mode 100644 index 0000000000..05b3db51b5 --- /dev/null +++ b/applications/test/foamVersion/foamVersionString.C @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 + foamVersionString.C + +Description + Print the FOAMversion string. + Simultaneously the smallest possible program to use a minimal bit of + the OpenFOAM library + +\*---------------------------------------------------------------------------*/ + +#include +#include "foamVersion.H" + +int main() +{ + std::cerr<< "FOAMversion " << Foam::FOAMversion << "\n"; + return 0; +} + +// ************************************************************************* // From fcdcf55610c46b3dd1fd4a4c38eb3208bfffd2ce Mon Sep 17 00:00:00 2001 From: henry Date: Thu, 8 Jan 2009 20:05:46 +0000 Subject: [PATCH 04/23] Added support for "pFinal". --- .../solvers/incompressible/pisoFoam/pisoFoam.C | 14 +++++++++++++- src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C | 2 +- .../constraint/processor/processorPolyPatch.C | 8 ++++---- src/OpenFOAM/primitives/uint/uintIO.C | 2 +- src/OpenFOAM/primitives/ulong/ulongIO.C | 3 +-- .../SpalartAllmarasIDDES/SpalartAllmarasIDDES.C | 6 +++--- ...SpalartAllmarasWallFunctionFvPatchScalarField.C | 2 +- 7 files changed, 24 insertions(+), 13 deletions(-) diff --git a/applications/solvers/incompressible/pisoFoam/pisoFoam.C b/applications/solvers/incompressible/pisoFoam/pisoFoam.C index b2722a466c..132f8dbb1a 100644 --- a/applications/solvers/incompressible/pisoFoam/pisoFoam.C +++ b/applications/solvers/incompressible/pisoFoam/pisoFoam.C @@ -100,7 +100,19 @@ int main(int argc, char *argv[]) ); pEqn.setReference(pRefCell, pRefValue); - pEqn.solve(); + + if + ( + corr == nCorr-1 + && nonOrth == nNonOrthCorr + ) + { + pEqn.solve(mesh.solver("pFinal")); + } + else + { + pEqn.solve(); + } if (nonOrth == nNonOrthCorr) { diff --git a/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C b/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C index 13ef29ed9b..23490b1547 100644 --- a/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C +++ b/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C @@ -308,7 +308,7 @@ Foam::SVD::SVD(const scalarRectangularMatrix& A, const scalar minCondition) g = rv1[nm]; scalar h = rv1[k]; scalar f = ((y - z)*(y + z) + (g - h)*(g + h))/(2.0*h*y); - g = sqrtSumSqr(f, 1.0); + g = sqrtSumSqr(f, scalar(1)); f = ((x - z)*(x + z) + h*((y/(f + sign(g, f))) - h))/x; scalar c = 1.0; s = 1.0; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C index a8138828fd..b2c04cd24f 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C @@ -143,7 +143,7 @@ void Foam::processorPolyPatch::initGeometry() ( Pstream::blocking, neighbProcNo(), - + 3*(sizeof(label) + size()*sizeof(vector)) + 3*(sizeof(label) + size()*sizeof(vector) + sizeof(float)) ); toNeighbProc @@ -163,7 +163,7 @@ void Foam::processorPolyPatch::calcGeometry() ( Pstream::blocking, neighbProcNo(), - 3*(sizeof(label) + size()*sizeof(vector)) + 3*(sizeof(label) + size()*sizeof(vector) + sizeof(float)) ); fromNeighbProc >> neighbFaceCentres_ @@ -582,7 +582,7 @@ bool Foam::processorPolyPatch::order transformedCtrs = masterCtrs-v[0]; } else - { + { transformedCtrs = masterCtrs-v; } matchedAll = matchPoints @@ -605,7 +605,7 @@ bool Foam::processorPolyPatch::order masterAnchors -= v[0]; } else - { + { masterAnchors -= v; } } diff --git a/src/OpenFOAM/primitives/uint/uintIO.C b/src/OpenFOAM/primitives/uint/uintIO.C index a40d4b7f5f..d63f1eced3 100644 --- a/src/OpenFOAM/primitives/uint/uintIO.C +++ b/src/OpenFOAM/primitives/uint/uintIO.C @@ -65,7 +65,7 @@ Istream& operator>>(Istream& is, unsigned int& i) if (t.isLabel()) { - i = unsigned(t.labelToken()); + i = static_cast(t.labelToken()); } else { diff --git a/src/OpenFOAM/primitives/ulong/ulongIO.C b/src/OpenFOAM/primitives/ulong/ulongIO.C index 9311bf0c82..251d36919e 100644 --- a/src/OpenFOAM/primitives/ulong/ulongIO.C +++ b/src/OpenFOAM/primitives/ulong/ulongIO.C @@ -44,7 +44,6 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Return a string representation of an ulong word name(const unsigned long i) { std::ostringstream osBuffer; @@ -66,7 +65,7 @@ Istream& operator>>(Istream& is, unsigned long& i) if (t.isLabel()) { - i = ulong(t.labelToken()); + i = static_cast(t.labelToken()); } else { diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C index b58c9557d4..6912872c9b 100644 --- a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C @@ -119,12 +119,12 @@ void SpalartAllmarasIDDES::dTildaUpdate(const volScalarField& S) 2.0*(pos(alpha)*pow(expTerm, -11.09) + neg(alpha)*pow(expTerm, -9.0)); - volScalarField fStep = min(2.0*pow(expTerm, -9.0), 1.0); + volScalarField fStep = min(2.0*pow(expTerm, -9.0), scalar(1)); volScalarField fHyb = max(1.0 - fd(S), fStep); volScalarField fAmp = 1.0 - max(ft(S), fl(S)); - volScalarField fRestore = max(fHill - 1.0, 0.0)*fAmp; + volScalarField fRestore = max(fHill - 1.0, scalar(0))*fAmp; // volScalarField ft2 = IGNORING ft2 terms @@ -132,7 +132,7 @@ void SpalartAllmarasIDDES::dTildaUpdate(const volScalarField& S) ( min ( - 100.0, + scalar(100), (1.0 - Cb1_/(Cw1_*sqr(kappa_)*fwStar_)*fv2())/max(SMALL, fv1()) ) ); diff --git a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.C index ab02061c5d..5ce0d72532 100644 --- a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.C @@ -139,7 +139,7 @@ void nuSgsSpalartAllmarasWallFunctionFvPatchScalarField::evaluate do { - scalar kUu = min(kappa*magUpara/utau, 100); + scalar kUu = min(kappa*magUpara/utau, 50); scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); scalar f = From 7f8e6e6077875a32e641c133a452b45ae83e95f5 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 8 Jan 2009 22:34:54 +0100 Subject: [PATCH 05/23] etc/bashrc tweak to cleanse env vars, even from a different WM_PROJECT_INST_DIR - Problem: changing between OpenFOAM versions with different WM_PROJECT_INST_DIR paths would leave the old paths in the env vars. - TODO: etc/cshrc is rougned out, but needs work on the corresponding if-statement --- etc/bashrc | 54 +++++++++++++++++++++++++++++++++--------------------- etc/cshrc | 43 +++++++++++++++++++++++++------------------ 2 files changed, 58 insertions(+), 39 deletions(-) diff --git a/etc/bashrc b/etc/bashrc index 28028384c6..6defae6dae 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -36,9 +36,10 @@ export WM_PROJECT=OpenFOAM # export WM_PROJECT_VERSION=1.5.x : ${WM_PROJECT_VERSION:=dev}; export WM_PROJECT_VERSION - -#!!User: -# either set $FOAM_INST_DIR before sourcing this file or set +################################################################################ +# USER EDITABLE PART +# +# either set $FOAM_INST_DIR before sourcing this file or set # $foamInstall below to where OpenFOAM is installed # # Location of FOAM installation @@ -47,9 +48,22 @@ foamInstall=$HOME/$WM_PROJECT # foamInstall=~$WM_PROJECT # foamInstall=/usr/local/$WM_PROJECT # foamInstall=/opt/$WM_PROJECT +# +# END OF (NORMAL) USER EDITABLE PART +################################################################################ +# note the location for later use (eg, in job scripts) : ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR +# The old dirs to be cleaned from the various environment variables +# - remove anything under top-level directory. +# NB: the WM_PROJECT_INST_DIR might not be identical between versions +foamOldDirs="$FOAM_INST_DIR $HOME/$WM_PROJECT/$USER" +if [ "$WM_PROJECT_INST_DIR" != "$FOAM_INST_DIR" ] +then + foamOldDirs="$WM_PROJECT_INST_DIR $foamOldPaths" +fi + # Location of site/user files # ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -169,21 +183,18 @@ USAGE esac -# Clean standard environment variables (PATH, MANPATH, LD_LIBRARY_PATH) -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH) +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cleanProg=$WM_PROJECT_DIR/bin/foamCleanPath -# Remove anything under top-level foam directory -wildCards="$WM_PROJECT_INST_DIR $HOME/$WM_PROJECT/$USER" - -#- Clean path/PATH -cleanPath=`$cleanProg "$PATH" "$wildCards"` && PATH="$cleanPath" +#- Clean PATH +cleanEnv=`$cleanProg "$PATH" "$foamOldDirs"` && PATH="$cleanEnv" #- Clean LD_LIBRARY_PATH -cleanPath=`$cleanProg "$LD_LIBRARY_PATH" "$wildCards"` && LD_LIBRARY_PATH="$cleanPath" +cleanEnv=`$cleanProg "$LD_LIBRARY_PATH" "$foamOldDirs"` && LD_LIBRARY_PATH="$cleanEnv" #- Clean MANPATH -cleanPath=`$cleanProg "$MANPATH" "$wildCards"` && MANPATH="$cleanPath" +cleanEnv=`$cleanProg "$MANPATH" "$foamCleanDirs"` && MANPATH="$cleanEnv" export PATH LD_LIBRARY_PATH MANPATH @@ -212,29 +223,30 @@ _foamSource $WM_PROJECT_DIR/etc/apps/ensight/bashrc _foamSource $WM_PROJECT_DIR/etc/apps/cint/bashrc -# Again clean environment (path, PATH, MANPATH, LD_LIBRARY_PATH) -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#- Clean path/PATH. Only remove duplicates -cleanPath=`$cleanProg "$PATH"` && PATH="$cleanPath" +# Clean environment paths again. Only remove duplicates +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +#- Clean PATH +cleanEnv=`$cleanProg "$PATH"` && PATH="$cleanEnv" #- Clean LD_LIBRARY_PATH -cleanPath=`$cleanProg "$LD_LIBRARY_PATH"` && LD_LIBRARY_PATH="$cleanPath" +cleanEnv=`$cleanProg "$LD_LIBRARY_PATH"` && LD_LIBRARY_PATH="$cleanEnv" #- Clean MANPATH -cleanPath=`$cleanProg "$MANPATH"` && MANPATH="$cleanPath" +cleanEnv=`$cleanProg "$MANPATH"` && MANPATH="$cleanEnv" export PATH LD_LIBRARY_PATH MANPATH #- Clean LD_PRELOAD -if [ "$LD_PRELOAD" != "" ]; then - cleanPath=`$cleanProg "$LD_PRELOAD"` && LD_PRELOAD="$cleanPath" +if [ "$LD_PRELOAD" != "" ] +then + cleanEnv=`$cleanProg "$LD_PRELOAD"` && LD_PRELOAD="$cleanEnv" export LD_PRELOAD fi # cleanup environment: # ~~~~~~~~~~~~~~~~~~~~ -unset cleanPath cleanProg foamInstall +unset cleanEnv cleanProg foamInstall foamOldDirs unset _foamSource # ----------------------------------------------------------------------------- diff --git a/etc/cshrc b/etc/cshrc index c12ff2e6ba..b1dfd9ec34 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -35,7 +35,9 @@ setenv WM_PROJECT OpenFOAM # setenv WM_PROJECT_VERSION 1.5.x if ( ! $?WM_PROJECT_VERSION ) setenv WM_PROJECT_VERSION dev -#!!User: +################################################################################ +# USER EDITABLE PART +# # either setenv FOAM_INST_DIR before sourcing this file or set # foamInstall below to where OpenFOAM is installed # @@ -45,9 +47,17 @@ set foamInstall = $HOME/$WM_PROJECT # set foamInstall = ~$WM_PROJECT # set foamInstall = /usr/local/$WM_PROJECT # set foamInstall = /opt/$WM_PROJECT +# +# END OF (NORMAL) USER EDITABLE PART +################################################################################ +# note the location for later use (eg, in job scripts) if ( ! $?FOAM_INST_DIR ) setenv FOAM_INST_DIR $foamInstall +# The old dirs to be cleaned from the various environment variables +# - remove anything under top-level directory. +# NB: the WM_PROJECT_INST_DIR might not be identical between versions +set foamOldDirs="$FOAM_INST_DIR $HOME/$WM_PROJECT/$LOGNAME" # Location of site/user files # ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -165,8 +175,8 @@ default: endsw -# Clean standard environment variables (path, PATH, MANPATH, LD_LIBRARY_PATH) -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Clean standard environment variables (path/PATH, LD_LIBRARY_PATH, MANPATH) +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ set cleanProg=$WM_PROJECT_DIR/bin/foamCleanPath if (! $?LD_LIBRARY_PATH ) then @@ -176,21 +186,18 @@ if (! $?MANPATH) then setenv MANPATH '' endif -# Remove anything under top-level foam directory -set wildCards="$WM_PROJECT_INST_DIR $HOME/$WM_PROJECT/$LOGNAME" - #- Clean path/PATH set colonPath=`echo "$path" | sed -e 's/ /:/g'` -set PATH=`$cleanProg "$colonPath" "$wildCards"` +set cleanEnv=`$cleanProg "$colonPath" "$foamOldDirs"` if ( $status == 0 ) then - set path=`echo "$PATH" | sed -e 's/:/ /g'` + set path=`echo "$cleanEnv" | sed -e 's/:/ /g'` endif #- Clean LD_LIBRARY_PATH -setenv LD_LIBRARY_PATH `$cleanProg "$LD_LIBRARY_PATH" "$wildCards"` +setenv LD_LIBRARY_PATH `$cleanProg "$LD_LIBRARY_PATH" "$foamOldDirs"` #- Clean MANPATH -setenv MANPATH `$cleanProg "$MANPATH" "$wildCards"` +setenv MANPATH `$cleanProg "$MANPATH" "$foamOldDirs"` # Source project setup files @@ -205,15 +212,16 @@ _foamSource $WM_PROJECT_DIR/etc/aliases.csh # _foamSource $WM_PROJECT_DIR/etc/apps/paraview/cshrc _foamSource $WM_PROJECT_DIR/etc/apps/paraview3/cshrc # _foamSource $WM_PROJECT_DIR/etc/apps/ensight/cshrc +# _foamSource $WM_PROJECT_DIR/etc/apps/cint/cshrc -# Again clean environment (path, PATH, MANPATH, LD_LIBRARY_PATH) -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#- Clean path/PATH. Only remove duplicates +# Clean environment paths again. Only remove duplicates +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +#- Clean path/PATH set colonPath=`echo "$path" | sed -e 's/ /:/g'` -set PATH=`$cleanProg "$colonPath"` +set cleanEnv=`$cleanProg "$colonPath"` if ( $status == 0 ) then - set path=`echo "$PATH" | sed -e 's/:/ /g'` + set path=`echo "$cleanEnv" | sed -e 's/:/ /g'` endif #- Clean LD_LIBRARY_PATH @@ -229,8 +237,7 @@ endif # cleanup environment: # ~~~~~~~~~~~~~~~~~~~~ -unset cleanProg -unset wildCards -unset colonPath +unset cleanEnv cleanProg colonPath foamInstall foamOldDirs unalias _foamSource + # ----------------------------------------------------------------------------- From 0061e9ed031f1c552432f4c13d6a1b7a68ed5c0a Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 9 Jan 2009 09:11:50 +0100 Subject: [PATCH 06/23] added Foam::FOAMbuild to Foam::FOAMversion - avoids problems with finding files based on FOAMversion (reported by Mattijs) --- applications/test/foamVersion/foamVersionString.C | 7 +++++-- src/Allwmake | 2 +- src/OpenFOAM/db/IOobject/IOobjectI.H | 4 ++-- src/OpenFOAM/global/foamVersion.H | 7 +++++++ src/OpenFOAM/global/global.Cver | 5 +++-- wmake/rules/General/version | 6 ++++-- wmake/wmakePrintBuild | 7 ++++++- 7 files changed, 28 insertions(+), 10 deletions(-) diff --git a/applications/test/foamVersion/foamVersionString.C b/applications/test/foamVersion/foamVersionString.C index 05b3db51b5..be63290a30 100644 --- a/applications/test/foamVersion/foamVersionString.C +++ b/applications/test/foamVersion/foamVersionString.C @@ -26,7 +26,7 @@ Application foamVersionString.C Description - Print the FOAMversion string. + Print the OpenFOAM version strings. Simultaneously the smallest possible program to use a minimal bit of the OpenFOAM library @@ -37,7 +37,10 @@ Description int main() { - std::cerr<< "FOAMversion " << Foam::FOAMversion << "\n"; + std::cerr + << "build " << Foam::FOAMbuild << "\n" + << "version " << Foam::FOAMversion << "\n"; + return 0; } diff --git a/src/Allwmake b/src/Allwmake index e0324141cd..39ce3f16f1 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -2,7 +2,7 @@ cd ${0%/*} || exit 1 # run from this directory set -x -# update Foam::FOAMversion string if required +# update OpenFOAM version strings if required wmakePrintBuild -check || /bin/rm -f OpenFOAM/Make/$WM_OPTIONS/global.? 2>/dev/null wmakeLnInclude -f OpenFOAM diff --git a/src/OpenFOAM/db/IOobject/IOobjectI.H b/src/OpenFOAM/db/IOobject/IOobjectI.H index 2407507c86..8e8a05f04b 100644 --- a/src/OpenFOAM/db/IOobject/IOobjectI.H +++ b/src/OpenFOAM/db/IOobject/IOobjectI.H @@ -38,7 +38,7 @@ inline void Foam::IOobject::writeBanner(Stream& os, bool noHint) { memset(spaces, ' ', 40); - size_t len = strlen(Foam::FOAMversion); + size_t len = strlen(Foam::FOAMbuild); if (len < 38) { spaces[38 - len] = '\0'; @@ -64,7 +64,7 @@ inline void Foam::IOobject::writeBanner(Stream& os, bool noHint) os << "| ========= | |\n" "| \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |\n" - "| \\\\ / O peration | Version: " << FOAMversion << spaces << "|\n" + "| \\\\ / O peration | Version: " << FOAMbuild << spaces << "|\n" "| \\\\ / A nd | Web: www.OpenFOAM.org |\n" "| \\\\/ M anipulation | |\n" "\\*---------------------------------------------------------------------------*/\n"; diff --git a/src/OpenFOAM/global/foamVersion.H b/src/OpenFOAM/global/foamVersion.H index fbebf86bc4..f6f8a7c6de 100644 --- a/src/OpenFOAM/global/foamVersion.H +++ b/src/OpenFOAM/global/foamVersion.H @@ -35,6 +35,12 @@ Global Description OpenFOAM version number static string. +Global + Foam::FOAMbuild + +Description + OpenFOAM version number static string with build information + SourceFiles global.Cver @@ -48,6 +54,7 @@ SourceFiles namespace Foam { extern const char* const FOAMversion; + extern const char* const FOAMbuild; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/global/global.Cver b/src/OpenFOAM/global/global.Cver index 8bcd7e7728..677c30ecc7 100644 --- a/src/OpenFOAM/global/global.Cver +++ b/src/OpenFOAM/global/global.Cver @@ -28,14 +28,15 @@ Description avoid the use of unconstructed data in the global namespace. This file has the extension .Cver to trigger a Makefile rule that converts - WM_PROJECT_VERSION into the appropriate version string. + 'VERSION\_STRING' and 'BUILD\_STRING' into the appropriate strings. \*---------------------------------------------------------------------------*/ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "foamVersion.H" -const char* const Foam::FOAMversion = "WM_PROJECT_VERSION"; +const char* const Foam::FOAMversion = "VERSION_STRING"; +const char* const Foam::FOAMbuild = "BUILD_STRING"; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Static initializers for string::null, word::null and fileName::null diff --git a/wmake/rules/General/version b/wmake/rules/General/version index 64f272ed08..11f83c7b74 100644 --- a/wmake/rules/General/version +++ b/wmake/rules/General/version @@ -1,10 +1,12 @@ .SUFFIXES: .Cver # -# update version string in C++ file and in $WM_PROJECT_DIR/.build file +# update version strings in C++ file and in $WM_PROJECT_DIR/.build file # Cvertoo = \ - sed 's/WM_PROJECT_VERSION/$(shell wmakePrintBuild -update)/' $$SOURCE > $*.C; \ + sed -e 's/VERSION_STRING/$(shell wmakePrintBuild -major)/' \ + -e 's/BUILD_STRING/$(shell wmakePrintBuild -update)/' \ + $$SOURCE > $*.C; \ $(CC) $(c++FLAGS) -c $*.C -o $@ .Cver.dep: diff --git a/wmake/wmakePrintBuild b/wmake/wmakePrintBuild index 13009261da..d82c9ef92d 100755 --- a/wmake/wmakePrintBuild +++ b/wmake/wmakePrintBuild @@ -39,7 +39,8 @@ usage: $Script [OPTION] options: -check check the git head commit vs. \$WM_PROJECT_DIR/.build (exit code 0 for no changes) - -update update the \$WM_PROJECT_DIR/.build from the git information + -major report \$WM_PROJECT_VERSION only and exit + -update update \$WM_PROJECT_DIR/.build from the git information -version VER specify an alternative version Print the version used when building the project, in this order of precedence: @@ -65,6 +66,10 @@ do checkOnly=true shift ;; + -major) + echo ${WM_PROJECT_VERSION:-unknown} + exit 0 + ;; -u | -update) update=true shift From 92c88521c45ec430a39c30d0f161c1c057a9bb09 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 9 Jan 2009 09:32:33 +0100 Subject: [PATCH 07/23] bugfix Pstream::master used as a bool --- src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C index 84acff27a2..003515c7d4 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C @@ -128,7 +128,7 @@ bool Foam::sampledSurfaces::checkFieldTypes() nFields += grep(symmTensorFields_, fieldTypes); nFields += grep(tensorFields_, fieldTypes); - if (Pstream::master) + if (Pstream::master()) { if (debug) { From 990a9e7f573e064176c500ab1daf9191c1d6c019 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 9 Jan 2009 09:35:53 +0100 Subject: [PATCH 08/23] added HashTable::erase(const HashTable&) method --- applications/test/HashTable/hashTableTest.C | 24 ++++++++++++-- .../StaticHashTable/staticHashTableTest.C | 33 ++++++++++++++----- .../containers/HashTables/HashSet/HashSet.C | 1 + .../HashTables/HashTable/HashTable.C | 28 ++++++++++++++-- .../HashTables/HashTable/HashTable.H | 4 +++ .../StaticHashTable/StaticHashTable.C | 22 +++++++++++++ .../StaticHashTable/StaticHashTable.H | 4 +++ 7 files changed, 102 insertions(+), 14 deletions(-) diff --git a/applications/test/HashTable/hashTableTest.C b/applications/test/HashTable/hashTableTest.C index 633c0e1ba4..8e3db2c9d7 100644 --- a/applications/test/HashTable/hashTableTest.C +++ b/applications/test/HashTable/hashTableTest.C @@ -100,12 +100,12 @@ int main() << "\ntable2" << table1 << nl << "\ntable3" << table3 << nl; - Info<< "\ndelete table2" << nl; + Info<< "\nerase table2 by iterator" << nl; forAllIter(HASHTABLE_CLASS, table2, iter) { - Info<< "deleting " << iter.key() << " => " << iter() << " ... "; + Info<< "erasing " << iter.key() << " => " << iter() << " ... "; table2.erase(iter); - Info<< "deleted" << endl; + Info<< "erased" << endl; } Info<< "\ntable1" << table1 << nl @@ -134,6 +134,24 @@ int main() table1.erase(table1.begin()); Info<< "removed an element - test table1 != table3 : " << (table1 != table3) << nl; + + // insert a few things into table2 + table2.set("ada", 14.0); + table2.set("aeq", 15.0); + table2.set("aaw", 16.0); + table2.set("abs", 17.0); + table2.set("adx", 20.0); + + Info<< "\ntable1" << table1 << nl + << "\ntable2" << table2 << nl; + + label nErased = table1.erase(table2); + + Info<< "\nerase table2 keys from table1 (removed " + << nErased << " elements)" << nl + << "\ntable1" << table1 << nl + << "\ntable2" << table2 << nl; + Info<< "\nclearStorage table3 ... "; table3.clearStorage(); diff --git a/applications/test/StaticHashTable/staticHashTableTest.C b/applications/test/StaticHashTable/staticHashTableTest.C index da879d4d5e..2060ec582c 100644 --- a/applications/test/StaticHashTable/staticHashTableTest.C +++ b/applications/test/StaticHashTable/staticHashTableTest.C @@ -100,13 +100,13 @@ int main() << "\ntable2" << table1 << nl << "\ntable3" << table3 << nl; - Info<< "\ndelete table2" << nl; - forAllIter(HASHTABLE_CLASS, table2, iter) - { - Info<< "deleting " << iter.key() << " => " << iter() << " ... "; - table2.erase(iter); - Info<< "deleted" << endl; - } + Info<< "\nerase table2 by iterator" << nl; + forAllIter(HASHTABLE_CLASS, table2, iter) + { + Info<< "erasing " << iter.key() << " => " << iter() << " ... "; + table2.erase(iter); + Info<< "erased" << endl; + } Info<< "\ntable1" << table1 << nl << "\ntable2" << table2 << nl @@ -134,6 +134,24 @@ int main() table1.erase(table1.begin()); Info<< "removed an element - test table1 != table3 : " << (table1 != table3) << nl; + + // insert a few things into table2 + table2.set("ada", 14.0); + table2.set("aeq", 15.0); + table2.set("aaw", 16.0); + table2.set("abs", 17.0); + table2.set("adx", 20.0); + + Info<< "\ntable1" << table1 << nl + << "\ntable2" << table2 << nl; + + label nErased = table1.erase(table2); + + Info<< "\nerase table2 keys from table1 (removed " + << nErased << " elements)" << nl + << "\ntable1" << table1 << nl + << "\ntable2" << table2 << nl; + Info<< "\nclearStorage table3 ... "; table3.clearStorage(); @@ -144,5 +162,4 @@ int main() return 0; } - // ************************************************************************* // diff --git a/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C b/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C index acb603bebd..3e4123ae4f 100644 --- a/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C +++ b/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C @@ -126,6 +126,7 @@ void Foam::HashSet::operator^=(const HashSet& rhs) } +// same as HashTable::erase() template void Foam::HashSet::operator-=(const HashSet& rhs) { diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C index 5daf0eb6fe..d6f6a57502 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C @@ -388,11 +388,11 @@ bool Foam::HashTable::erase(const iterator& cit) template bool Foam::HashTable::erase(const Key& key) { - iterator it = find(key); + iterator fnd = find(key); - if (it != end()) + if (fnd != end()) { - return erase(it); + return erase(fnd); } else { @@ -401,6 +401,28 @@ bool Foam::HashTable::erase(const Key& key) } +template +Foam::label Foam::HashTable::erase +( + const HashTable& rhs +) +{ + label count = 0; + + // Remove rhs elements from this table + // NOTE: could optimize depending on which hash is smaller + for (iterator iter = this->begin(); iter != this->end(); ++iter) + { + if (rhs.found(iter.key()) && erase(iter)) + { + count++; + } + } + + return count; +} + + template void Foam::HashTable::resize(const label newSize) { diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H index a7319c833f..0ecc044222 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H @@ -200,6 +200,10 @@ public: //- Erase an hashedEntry specified by given key if in table bool erase(const Key&); + //- Remove entries in the given HashTable from this HashTable + // Return the number of elements removed + label erase(const HashTable&); + //- Resize the hash table for efficiency void resize(const label newSize); diff --git a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.C b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.C index 50d8ff5763..992205afaf 100644 --- a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.C +++ b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.C @@ -346,6 +346,28 @@ bool Foam::StaticHashTable::erase(const Key& key) } +template +Foam::label Foam::StaticHashTable::erase +( + const StaticHashTable& rhs +) +{ + label count = 0; + + // Remove rhs elements from this table + // NOTE: could optimize depending on which hash is smaller + for (iterator iter = this->begin(); iter != this->end(); ++iter) + { + if (rhs.found(iter.key()) && erase(iter)) + { + count++; + } + } + + return count; +} + + template void Foam::StaticHashTable::resize(const label newSize) { diff --git a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.H b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.H index 95df9befce..15044c33e2 100644 --- a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.H +++ b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.H @@ -196,6 +196,10 @@ public: //- Resize the hash table for efficiency void resize(const label newSize); + //- Remove entries in the given hash table from this hash table + // Return the number of elements removed + label erase(const StaticHashTable&); + //- Clear all entries from table void clear(); From 413f3fd903fb441504d56be59e10b0569f01bbe3 Mon Sep 17 00:00:00 2001 From: henry Date: Fri, 9 Jan 2009 08:46:26 +0000 Subject: [PATCH 09/23] Pstream::master fixed, see http://openfoam.cfd-online.com/cgi-bin/forum/show.cgi?126/10427 --- src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C index 84acff27a2..003515c7d4 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C @@ -128,7 +128,7 @@ bool Foam::sampledSurfaces::checkFieldTypes() nFields += grep(symmTensorFields_, fieldTypes); nFields += grep(tensorFields_, fieldTypes); - if (Pstream::master) + if (Pstream::master()) { if (debug) { From 036a1cd504ea7daa28da53d160fbcfb90d4ef04a Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 9 Jan 2009 11:28:08 +0100 Subject: [PATCH 10/23] output FOAMbuild info in argList, but only emit FOAMversion in writeBanner --- src/OpenFOAM/db/IOobject/IOobjectI.H | 4 ++-- src/OpenFOAM/global/argList/argList.C | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/OpenFOAM/db/IOobject/IOobjectI.H b/src/OpenFOAM/db/IOobject/IOobjectI.H index 8e8a05f04b..2407507c86 100644 --- a/src/OpenFOAM/db/IOobject/IOobjectI.H +++ b/src/OpenFOAM/db/IOobject/IOobjectI.H @@ -38,7 +38,7 @@ inline void Foam::IOobject::writeBanner(Stream& os, bool noHint) { memset(spaces, ' ', 40); - size_t len = strlen(Foam::FOAMbuild); + size_t len = strlen(Foam::FOAMversion); if (len < 38) { spaces[38 - len] = '\0'; @@ -64,7 +64,7 @@ inline void Foam::IOobject::writeBanner(Stream& os, bool noHint) os << "| ========= | |\n" "| \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |\n" - "| \\\\ / O peration | Version: " << FOAMbuild << spaces << "|\n" + "| \\\\ / O peration | Version: " << FOAMversion << spaces << "|\n" "| \\\\ / A nd | Web: www.OpenFOAM.org |\n" "| \\\\/ M anipulation | |\n" "\\*---------------------------------------------------------------------------*/\n"; diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index 23520fd087..a237c0256c 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -286,7 +286,8 @@ Foam::argList::argList if (Pstream::master() && bannerEnabled) { IOobject::writeBanner(Info, true); - Info<< "Exec : " << argListString.c_str() << nl + Info<< "Build : " << Foam::FOAMbuild << nl + << "Exec : " << argListString.c_str() << nl << "Date : " << dateString.c_str() << nl << "Time : " << timeString.c_str() << nl << "Host : " << hostName() << nl From f0341171ff7222c3b698c88ba8d3e75395ff0ff0 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 9 Jan 2009 13:10:10 +0100 Subject: [PATCH 11/23] renamed 'empty' class to 'nil', added missing empty() member to some containers --- applications/test/HashSet/hashSetTest.C | 10 +++--- .../containers/HashTables/HashSet/HashSet.C | 2 +- .../containers/HashTables/HashSet/HashSet.H | 28 ++++++++-------- .../HashTables/HashTable/HashTable.H | 3 ++ .../HashTables/HashTable/HashTableI.H | 7 ++++ .../StaticHashTable/StaticHashTable.H | 3 ++ .../StaticHashTable/StaticHashTableI.H | 7 ++++ .../linkTypes/DLListBase/DLListBase.H | 3 ++ .../linkTypes/DLListBase/DLListBaseI.H | 6 ++++ .../linkTypes/SLListBase/SLListBase.H | 3 ++ .../linkTypes/SLListBase/SLListBaseI.H | 6 ++++ .../containers/LinkedLists/user/FIFOStack.H | 9 ----- .../containers/LinkedLists/user/LIFOStack.H | 9 ----- .../Lists/BiIndirectList/BiIndirectList.H | 2 ++ .../Lists/BiIndirectList/BiIndirectListI.H | 7 ++++ .../Lists/CompactListList/CompactListList.H | 3 ++ .../Lists/CompactListList/CompactListListI.H | 7 ++++ .../Lists/IndirectList/IndirectList.H | 2 ++ .../Lists/IndirectList/IndirectListI.H | 7 ++++ .../containers/Lists/PackedList/PackedList.H | 3 ++ .../containers/Lists/PackedList/PackedListI.H | 7 ++++ .../containers/Lists/PtrList/PtrList.H | 3 ++ .../containers/Lists/PtrList/PtrListI.H | 7 ++++ .../primitives/{empty/empty.H => nil/nil.H} | 33 ++++++++----------- 24 files changed, 120 insertions(+), 57 deletions(-) rename src/OpenFOAM/primitives/{empty/empty.H => nil/nil.H} (80%) diff --git a/applications/test/HashSet/hashSetTest.C b/applications/test/HashSet/hashSetTest.C index a3527f7dd7..9625b2e0dc 100644 --- a/applications/test/HashSet/hashSetTest.C +++ b/applications/test/HashSet/hashSetTest.C @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) wordHashSet setA(0); HashTable tableA; - HashTable tableB; + HashTable tableB; Map