Skip to content
Snippets Groups Projects
Commit 1be5f699 authored by Henry Weller's avatar Henry Weller
Browse files

decomposePar: Added 'copyZero' option

Using

decomposePar -copyZero

The mesh is decomposed as usual but the '0' directory is recursively copied to
the 'processor.*' directories rather than decomposing the fields.  This is a
convenient option to handle cases where the initial field files are generic and
can be used for serial or parallel running.  See for example the
incompressible/simpleFoam/motorBike tutorial case.
parent 7a99465d
Branches
Tags
No related merge requests found
...@@ -135,8 +135,12 @@ void Foam::timeSelector::addOptions ...@@ -135,8 +135,12 @@ void Foam::timeSelector::addOptions
argList::addBoolOption argList::addBoolOption
( (
"noZero", "noZero",
"exclude the '0/' dir from the times list, " string("exclude the '0/' dir from the times list")
"has precedence over the -withZero option" + (
withZero
? ", has precedence over the -withZero option"
: ""
)
); );
argList::addBoolOption argList::addBoolOption
( (
......
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial clean functions # Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
# remove surface and features # Remove surface and features
rm -f constant/triSurface/motorBike.obj.gz > /dev/null 2>&1 rm -f constant/triSurface/motorBike.obj.gz > /dev/null 2>&1
rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1 rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1
rm -f constant/triSurface/motorBike.eMesh > /dev/null 2>&1 rm -f constant/triSurface/motorBike.eMesh > /dev/null 2>&1
...@@ -11,3 +12,5 @@ rm -f constant/triSurface/motorBike.eMesh > /dev/null 2>&1 ...@@ -11,3 +12,5 @@ rm -f constant/triSurface/motorBike.eMesh > /dev/null 2>&1
rm -rf 0 > /dev/null 2>&1 rm -rf 0 > /dev/null 2>&1
cleanCase cleanCase
#------------------------------------------------------------------------------
...@@ -4,21 +4,16 @@ cd ${0%/*} || exit 1 # Run from this directory ...@@ -4,21 +4,16 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# copy motorbike surface from resources directory # Copy motorbike surface from resources directory
cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/ cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/
runApplication surfaceFeatureExtract runApplication surfaceFeatureExtract
runApplication blockMesh runApplication blockMesh
runApplication decomposePar [ ! -d 0 ] && cp -r 0.orig 0
runParallel snappyHexMesh -overwrite
#- For non-parallel running
#cp -r 0.orig 0 > /dev/null 2>&1
#- For parallel running runApplication decomposePar -copyZero
ls -d processor* | xargs -I {} rm -rf ./{}/0 runParallel snappyHexMesh -overwrite
ls -d processor* | xargs -I {} cp -r 0.orig ./{}/0
runParallel patchSummary runParallel patchSummary
runParallel potentialFoam runParallel potentialFoam
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment