From 1cd18ce0b5b8893eb093f2db5ad219b24475ef71 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 7 Jan 2009 21:06:08 +0100 Subject: [PATCH 01/26] 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 822b5168520744f97e25b96194d89194cf44ec54 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 8 Jan 2009 13:40:00 +0000 Subject: [PATCH 02/26] csh syntax --- etc/apps/paraview3/cshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc index 875d0d1655..8f1b6a77f5 100644 --- a/etc/apps/paraview3/cshrc +++ b/etc/apps/paraview3/cshrc @@ -54,9 +54,9 @@ setenv ParaView_DIR $ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping if ( -r $paraviewPython ) then if ($?PYTHONPATH) then - setenv PYTHONPATH ${PYTHONPATH}:$paraviewPython:$ParaView_DIR/lib/${paraviewMajor} + setenv PYTHONPATH ${PYTHONPATH}:${paraviewPython}:$ParaView_DIR/lib/${paraviewMajor} else - setenv PYTHONPATH $paraviewPython:$ParaView_DIR/lib/${paraviewMajor} + setenv PYTHONPATH ${paraviewPython}:$ParaView_DIR/lib/${paraviewMajor} endif endif From 7ae9a0d0d999e476622d0aecac84228708abbb96 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 8 Jan 2009 14:48:48 +0100 Subject: [PATCH 03/26] 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 ef42bea66f2d5b20bb5ac6c97ef2d6c00054ae14 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 8 Jan 2009 18:13:04 +0000 Subject: [PATCH 04/26] added region --- .../utilities/miscellaneous/patchSummary/patchSummary.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/utilities/miscellaneous/patchSummary/patchSummary.C b/applications/utilities/miscellaneous/patchSummary/patchSummary.C index b64a72ad91..17eba36311 100644 --- a/applications/utilities/miscellaneous/patchSummary/patchSummary.C +++ b/applications/utilities/miscellaneous/patchSummary/patchSummary.C @@ -42,6 +42,7 @@ int main(int argc, char *argv[]) { # include "addTimeOptions.H" +# include "addRegionOption.H" # include "setRootCase.H" # include "createTime.H" @@ -53,7 +54,7 @@ int main(int argc, char *argv[]) runTime.setTime(Times[startTime], startTime); -# include "createMesh.H" +# include "createNamedMesh.H" for (label i=startTime; i Date: Thu, 8 Jan 2009 18:13:43 +0000 Subject: [PATCH 05/26] added unsigned label uLabel --- src/OpenFOAM/Make/files | 1 + src/OpenFOAM/primitives/uLabel/uLabel.C | 56 ++++++++ src/OpenFOAM/primitives/uLabel/uLabel.H | 169 ++++++++++++++++++++++++ 3 files changed, 226 insertions(+) create mode 100644 src/OpenFOAM/primitives/uLabel/uLabel.C create mode 100644 src/OpenFOAM/primitives/uLabel/uLabel.H diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 7c9655e958..8fe778aa16 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -14,6 +14,7 @@ primitives/long/longIO.C primitives/longLong/longLongIO.C primitives/ulong/ulongIO.C primitives/label/label.C +primitives/uLabel/uLabel.C primitives/Scalar/doubleScalar/doubleScalar.C primitives/Scalar/floatScalar/floatScalar.C primitives/Scalar/scalar/scalar.C diff --git a/src/OpenFOAM/primitives/uLabel/uLabel.C b/src/OpenFOAM/primitives/uLabel/uLabel.C new file mode 100644 index 0000000000..b4e72c18a6 --- /dev/null +++ b/src/OpenFOAM/primitives/uLabel/uLabel.C @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + +\*---------------------------------------------------------------------------*/ + +#include "uLabel.H" +#include "error.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +const char* const pTraits::typeName = "uLabel"; +const uLabel pTraits::zero = 0; +const uLabel pTraits::one = 1; + +const char* pTraits::componentNames[] = { "x" }; + +pTraits::pTraits(Istream& is) +{ + is >> p_; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/uLabel/uLabel.H b/src/OpenFOAM/primitives/uLabel/uLabel.H new file mode 100644 index 0000000000..7b99b79eb1 --- /dev/null +++ b/src/OpenFOAM/primitives/uLabel/uLabel.H @@ -0,0 +1,169 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + +Typedef + Foam::uLabel + +Description + A uLabel is an unsigned label. See label.H. + +\*---------------------------------------------------------------------------*/ + +#ifndef uLabel_H +#define uLabel_H + +#include +#include + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +#if FOAM_LABEL64 +# define WANTEDURANGE 18000000000000000000 +#else +# define WANTEDURANGE 4000000000 +#endif + + +#if UINT_MAX > WANTEDURANGE + +// Define uLabel as an unsigned int + +#include "uint.H" + +namespace Foam +{ + typedef unsigned int uLabel; + + static const uLabel uLabelMax = UINT_MAX; + + inline uLabel readULabel(Istream& is) + { + return readUint(is); + } + +} // End namespace Foam + + +#elif ULONG_MAX > WANTEDURANGE + +// Define uLabel as an unsigned long + +#include "uint.H" +#include "ulong.H" + +namespace Foam +{ + typedef unsigned long uLabel; + + static const uLabel uLabelMax = LONG_MAX; + + inline uLabel readULabel(Istream& is) + { + return readUlong(is); + } + +} // End namespace Foam + + +#elif ULLONG_MAX > WANTEDURANGE + +// Define uLabel as an unsigned long long + +#error "Not implemented yet" + +#endif + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "pTraits.H" +#include "direction.H" + +namespace Foam +{ + +// template specialisation for pTraits