ENH: draft version of paraFoam with -touchAll option
This commit is contained in:
parent
07d070b1fc
commit
ca7a624fec
38
bin/paraFoam
38
bin/paraFoam
@ -44,6 +44,7 @@ options:
|
|||||||
-case <dir> specify alternative case directory, default is the cwd
|
-case <dir> specify alternative case directory, default is the cwd
|
||||||
-region <name> specify alternative mesh region
|
-region <name> specify alternative mesh region
|
||||||
-touch only create the file (eg, .blockMesh, .OpenFOAM, etc)
|
-touch only create the file (eg, .blockMesh, .OpenFOAM, etc)
|
||||||
|
-touchAll create .blockMesh, .OpenFOAM files (and for all regions)
|
||||||
-help print the usage
|
-help print the usage
|
||||||
|
|
||||||
* start paraview $ParaView_VERSION with the OpenFOAM libraries
|
* start paraview $ParaView_VERSION with the OpenFOAM libraries
|
||||||
@ -52,7 +53,7 @@ USAGE
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
unset regionName touchOnly
|
unset regionName touchOpt
|
||||||
|
|
||||||
# reader extension
|
# reader extension
|
||||||
extension=OpenFOAM
|
extension=OpenFOAM
|
||||||
@ -83,7 +84,11 @@ do
|
|||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
-touch)
|
-touch)
|
||||||
touchOnly=true
|
touchOpt=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-touchAll)
|
||||||
|
touchOpt=all
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -103,12 +108,35 @@ then
|
|||||||
fvControls="$fvControls/$regionName"
|
fvControls="$fvControls/$regionName"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$touchOnly" ]
|
case "${touchOpt:-false}" in
|
||||||
then
|
all)
|
||||||
|
extension=OpenFOAM
|
||||||
|
if [ -f constant/polyMesh/blockMeshDict ]
|
||||||
|
then
|
||||||
|
touch "$caseName.blockMesh"
|
||||||
|
echo "created '$caseName.blockMesh'"
|
||||||
|
fi
|
||||||
|
touch "$caseName.$extension"
|
||||||
|
echo "created '$caseName.$extension'"
|
||||||
|
# discover probable regions
|
||||||
|
for region in constant/*
|
||||||
|
do
|
||||||
|
if [ -d $region -a -d $region/polyMesh ]
|
||||||
|
then
|
||||||
|
regionName=${region##*/}
|
||||||
|
touch "$caseName{$regionName}.$extension"
|
||||||
|
echo "created '$caseName{$regionName}.$extension'"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
true)
|
||||||
touch "$caseFile"
|
touch "$caseFile"
|
||||||
echo "created '$caseFile'"
|
echo "created '$caseFile'"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
# parent directory for normal or parallel results
|
# parent directory for normal or parallel results
|
||||||
case "$caseName" in
|
case "$caseName" in
|
||||||
|
Loading…
Reference in New Issue
Block a user