ENH: add -builtin option to paraFoam (VTK builtin OpenFOAM reader)

- Also adjusted formatting of usage to match what argList generates
This commit is contained in:
Mark Olesen
2010-02-05 08:36:44 +01:00
parent a562969196
commit 07283ff315
25 changed files with 69 additions and 59 deletions

View File

@ -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
usage: ${0##*/} [OPTION]
Usage: ${0##*/} [OPTION]
options:
-help

View File

@ -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
usage: ${0##*/} <file1> ... <fileN>
Usage: ${0##*/} <file1> ... <fileN>
* find all .dep files referring to any of <file1> ... <fileN>

View File

@ -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 <<USAGE 1>&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

View File

@ -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 <<USAGE 1>&2
usage: ${0##*/} [-case dir] [-region name]
Usage: ${0##*/} [OPTION]
options:
-case <dir> specify alternative case directory, default is the cwd
-region <name> 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

View File

@ -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
usage: ${0##*/} [OPTION] fileName
Usage: ${0##*/} [OPTION] fileName
${0##*/} -list
options:

View File

@ -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() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] <application> ...
Usage: ${0##*/} [OPTION] <application> ...
options:
-v ver specify OpenFOAM version

View File

@ -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
usage: ${0##*/} [OPTION] <application> ...
Usage: ${0##*/} [OPTION] <application> ...
options:
-case dir specify case directory
-case <dir> specify alternative case directory, default is the cwd
-s also sends output to screen
-p parallel run of processors
-v ver specify OpenFOAM version
-help this usage
-v <ver> specify OpenFOAM version
-help print the usage
* run an OpenFOAM job in background.
Redirects the output to 'log' in the case directory

View File

@ -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<<USAGE
usage: ${0##*/} <type> {args}
Usage: ${0##*/} <type> {args}
* create a new standard OpenFOAM source or template file

View File

@ -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
usage: ${0##*/} [OPTION] <file1> ... <fileN>
Usage: ${0##*/} [OPTION] <file1> ... <fileN>
options:
-v VER specifies the version to be written in the header

View File

@ -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
usage: ${0##*/} <turbulenceProperties>
Usage: ${0##*/} <turbulenceProperties>
Where <turbulenceProperties> is the full path to the
turbulenceProperties dictionary

View File

@ -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<<USAGE
usage: ${0##*/} [OPTION]
Usage: ${0##*/} [OPTION]
options:
-case dir specify alternative case directory
-region name specify mesh region name
-block use blockMesh reader (and .blockMesh file)
-touch only create the .OpenFOAM file
-block use blockMesh reader (uses .blockMesh extension)
-builtin use VTK builtin OpenFOAM reader (uses .foam extension)
-case <dir> specify alternative case directory, default is the cwd
-region <name> 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'"

View File

@ -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<<USAGE 1>&2
usage: ${0##*/} [file]
Usage: ${0##*/} [file]
Remove all .dep files or remove .dep files referring to <file>

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
usage: $Script <type> <class name>
Usage: $Script <type> <class name>
* create a new standard OpenFOAM source file

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<<USAGE
usage: $Script <type> <Class name> <Template arguments...>
Usage: $Script <type> <Class name> <Template arguments...>
* create a new standard OpenFOAM source file

View File

@ -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 @@ usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTIONS] file1 [.. fileN]
Usage: ${0##*/} [OPTIONS] file1 [.. fileN]
options:
-html create html (default)
-latex create LaTeX