From 07283ff31528a3a5da5e01fb415a34910c07381a Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 5 Feb 2010 08:36:44 +0100 Subject: [PATCH] ENH: add -builtin option to paraFoam (VTK builtin OpenFOAM reader) - Also adjusted formatting of usage to match what argList generates --- bin/engridFoam | 4 +-- bin/finddep | 4 +-- bin/foamCleanPath | 4 +-- bin/foamClearPolyMesh | 12 ++++--- bin/foamEtcFile | 4 +-- bin/foamExec | 4 +-- bin/foamJob | 15 ++++----- bin/foamNew | 4 +-- bin/foamUpdateCaseFileHeader | 4 +-- bin/foamUpgradeTurbulenceProperties | 4 +-- bin/paraFoam | 33 +++++++++++-------- bin/rmdepall | 4 +-- bin/templates/foamScript | 2 +- bin/templates/source/_Template.C | 2 +- bin/templates/source/_Template.H | 2 +- bin/templates/source/_TemplateApp.C | 2 +- bin/templates/source/_TemplateI.H | 2 +- bin/templates/source/_TemplateIO.C | 2 +- bin/templates/source/foamNewSource | 4 +-- .../sourceTemplate/_TemplateTemplate.C | 2 +- .../sourceTemplate/_TemplateTemplate.H | 2 +- .../sourceTemplate/_TemplateTemplateI.H | 2 +- .../sourceTemplate/_TemplateTemplateIO.C | 2 +- bin/templates/sourceTemplate/foamNewTemplate | 4 +-- bin/tools/org-batch | 4 +-- 25 files changed, 69 insertions(+), 59 deletions(-) diff --git a/bin/engridFoam b/bin/engridFoam index 37e61b0569..b017d23cb6 100755 --- a/bin/engridFoam +++ b/bin/engridFoam @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -34,7 +34,7 @@ usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< ... +Usage: ${0##*/} ... * find all .dep files referring to any of ... diff --git a/bin/foamCleanPath b/bin/foamCleanPath index 225aa0e943..fcb5b7068c 100755 --- a/bin/foamCleanPath +++ b/bin/foamCleanPath @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -41,7 +41,7 @@ #------------------------------------------------------------------------------ usage() { cat <&2 -usage: ${0##*/} [-strip] path [wildcard] .. [wildcard] +Usage: ${0##*/} [-strip] path [wildcard] .. [wildcard] Prints its argument (which should be a ':' separated list) cleansed from - duplicate elements diff --git a/bin/foamClearPolyMesh b/bin/foamClearPolyMesh index ce3e563d31..40689539ab 100755 --- a/bin/foamClearPolyMesh +++ b/bin/foamClearPolyMesh @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -35,10 +35,14 @@ usage() { while [ "$#" -ge 1 ]; do echo "$1" 1>&2; shift; done cat <&2 -usage: ${0##*/} [-case dir] [-region name] +Usage: ${0##*/} [OPTION] +options: + -case specify alternative case directory, default is the cwd + -region specify alternative mesh region + -help print the usage - Remove the contents of the constant/polyMesh directory - as per the Foam::polyMesh::removeFiles() method. +Remove the contents of the constant/polyMesh directory as per the +Foam::polyMesh::removeFiles() method. USAGE exit 1 diff --git a/bin/foamEtcFile b/bin/foamEtcFile index e3faab4121..851ef739b4 100755 --- a/bin/foamEtcFile +++ b/bin/foamEtcFile @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -40,7 +40,7 @@ usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< ... +Usage: ${0##*/} [OPTION] ... options: -v ver specify OpenFOAM version diff --git a/bin/foamJob b/bin/foamJob index 289d430d83..ca51fb6074 100755 --- a/bin/foamJob +++ b/bin/foamJob @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -33,14 +33,13 @@ usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< ... - +Usage: ${0##*/} [OPTION] ... options: - -case dir specify case directory - -s also sends output to screen - -p parallel run of processors - -v ver specify OpenFOAM version - -help this usage + -case specify alternative case directory, default is the cwd + -s also sends output to screen + -p parallel run of processors + -v specify OpenFOAM version + -help print the usage * run an OpenFOAM job in background. Redirects the output to 'log' in the case directory diff --git a/bin/foamNew b/bin/foamNew index d1b31693b9..fde1aa1979 100755 --- a/bin/foamNew +++ b/bin/foamNew @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -33,7 +33,7 @@ usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< {args} +Usage: ${0##*/} {args} * create a new standard OpenFOAM source or template file diff --git a/bin/foamUpdateCaseFileHeader b/bin/foamUpdateCaseFileHeader index cfe611ac81..f72035b134 100755 --- a/bin/foamUpdateCaseFileHeader +++ b/bin/foamUpdateCaseFileHeader @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -38,7 +38,7 @@ foamVersion=$WM_PROJECT_VERSION usage() { cat< ... +Usage: ${0##*/} [OPTION] ... options: -v VER specifies the version to be written in the header diff --git a/bin/foamUpgradeTurbulenceProperties b/bin/foamUpgradeTurbulenceProperties index 846d8d6cda..517aada23a 100755 --- a/bin/foamUpgradeTurbulenceProperties +++ b/bin/foamUpgradeTurbulenceProperties @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -39,7 +39,7 @@ usage() { cat< +Usage: ${0##*/} Where is the full path to the turbulenceProperties dictionary diff --git a/bin/paraFoam b/bin/paraFoam index 79bf6506d4..623030e167 100755 --- a/bin/paraFoam +++ b/bin/paraFoam @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -30,18 +30,21 @@ # start paraview with the OpenFOAM libraries # # Note -# combining -block and -region options yields undefined behaviour +# combining -block or -builtin options with the -region option yields +# undefined behaviour #------------------------------------------------------------------------------ usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< specify alternative case directory, default is the cwd + -region specify alternative mesh region + -touch only create the file (eg, .blockMesh, .OpenFOAM, etc) + -help print the usage * start paraview $ParaView_VERSION with the OpenFOAM libraries @@ -52,7 +55,7 @@ USAGE unset regionName touchOnly # reader extension -reader=OpenFOAM +extension=OpenFOAM # parse options while [ "$#" -gt 0 ] @@ -62,7 +65,11 @@ do usage ;; -block | -blockMesh) - reader=blockMesh + extension=blockMesh + shift + ;; + -builtin) + extension=foam shift ;; -case) @@ -87,12 +94,12 @@ done # get a sensible caseName from the directory name caseName=${PWD##*/} -caseFile="$caseName.$reader" +caseFile="$caseName.$extension" fvControls="system" if [ -n "$regionName" ] then - caseFile="$caseName{$regionName}.$reader" + caseFile="$caseName{$regionName}.$extension" fvControls="$fvControls/$regionName" fi @@ -113,7 +120,7 @@ esac # # check existence of essential files # -case $reader in +case $extension in blockMesh) for check in system/controlDict constant/polyMesh/blockMeshDict do @@ -121,7 +128,7 @@ blockMesh) done ;; -OpenFOAM) +builtin | OpenFOAM) for check in system/controlDict $fvControls/fvSchemes $fvControls/fvSolution do [ -s "$parentDir/$check" ] || usage "file does not exist: '$parentDir/$check'" diff --git a/bin/rmdepall b/bin/rmdepall index 5850692d22..f70b76adff 100755 --- a/bin/rmdepall +++ b/bin/rmdepall @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -32,7 +32,7 @@ usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<&2 -usage: ${0##*/} [file] +Usage: ${0##*/} [file] Remove all .dep files or remove .dep files referring to diff --git a/bin/templates/foamScript b/bin/templates/foamScript index e8a160860c..a7fe586512 100644 --- a/bin/templates/foamScript +++ b/bin/templates/foamScript @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License diff --git a/bin/templates/source/_Template.C b/bin/templates/source/_Template.C index a45d3ff6ac..5431e02d99 100644 --- a/bin/templates/source/_Template.C +++ b/bin/templates/source/_Template.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/templates/source/_Template.H b/bin/templates/source/_Template.H index b86edcbde9..1c04fa543d 100644 --- a/bin/templates/source/_Template.H +++ b/bin/templates/source/_Template.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/templates/source/_TemplateApp.C b/bin/templates/source/_TemplateApp.C index 42f2df0db8..50cd2827ab 100644 --- a/bin/templates/source/_TemplateApp.C +++ b/bin/templates/source/_TemplateApp.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/templates/source/_TemplateI.H b/bin/templates/source/_TemplateI.H index 10e8e4fec8..cfc30ed48a 100644 --- a/bin/templates/source/_TemplateI.H +++ b/bin/templates/source/_TemplateI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/templates/source/_TemplateIO.C b/bin/templates/source/_TemplateIO.C index c6d595100a..8282a55f49 100644 --- a/bin/templates/source/_TemplateIO.C +++ b/bin/templates/source/_TemplateIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/templates/source/foamNewSource b/bin/templates/source/foamNewSource index ec1ad7b2e1..8924b09448 100755 --- a/bin/templates/source/foamNewSource +++ b/bin/templates/source/foamNewSource @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -36,7 +36,7 @@ Template="$WM_PROJECT_DIR/bin/templates/source/_Template" usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< +Usage: $Script * create a new standard OpenFOAM source file diff --git a/bin/templates/sourceTemplate/_TemplateTemplate.C b/bin/templates/sourceTemplate/_TemplateTemplate.C index c73d5043a1..21ce4f1b36 100644 --- a/bin/templates/sourceTemplate/_TemplateTemplate.C +++ b/bin/templates/sourceTemplate/_TemplateTemplate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/templates/sourceTemplate/_TemplateTemplate.H b/bin/templates/sourceTemplate/_TemplateTemplate.H index 6e24ddda2a..6ee6474936 100644 --- a/bin/templates/sourceTemplate/_TemplateTemplate.H +++ b/bin/templates/sourceTemplate/_TemplateTemplate.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/templates/sourceTemplate/_TemplateTemplateI.H b/bin/templates/sourceTemplate/_TemplateTemplateI.H index 10e8e4fec8..cfc30ed48a 100644 --- a/bin/templates/sourceTemplate/_TemplateTemplateI.H +++ b/bin/templates/sourceTemplate/_TemplateTemplateI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/templates/sourceTemplate/_TemplateTemplateIO.C b/bin/templates/sourceTemplate/_TemplateTemplateIO.C index 9453630b68..d874b91170 100644 --- a/bin/templates/sourceTemplate/_TemplateTemplateIO.C +++ b/bin/templates/sourceTemplate/_TemplateTemplateIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/templates/sourceTemplate/foamNewTemplate b/bin/templates/sourceTemplate/foamNewTemplate index edf4fd3bce..8045a5cac6 100755 --- a/bin/templates/sourceTemplate/foamNewTemplate +++ b/bin/templates/sourceTemplate/foamNewTemplate @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -37,7 +37,7 @@ usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<