mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: improve handling of finiteArea mesh with distributed roots
- in makeFaMesh, the serial fields are now only read on the master process and broadcast to the other ranks. The read+distribute is almost identical to that used in redistributePar, except that in this case entire fields are sent and not a zero-sized subset. - improved internal faMesh checking for files so that the TryNew method works with distributed roots.
This commit is contained in:
90
tutorials/incompressible/pimpleFoam/laminar/filmPanel0/Allrun-distributed
Executable file
90
tutorials/incompressible/pimpleFoam/laminar/filmPanel0/Allrun-distributed
Executable file
@ -0,0 +1,90 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
## ./Allclean
|
||||
|
||||
rootDir="test-distributed"
|
||||
caseName="${PWD##*/}"
|
||||
|
||||
#not yet: fileHandler="-fileHandler collated"
|
||||
unset fileHandler
|
||||
|
||||
restore0Dir
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
if [ -d "$rootDir" ]
|
||||
then
|
||||
echo "Directory already exists: $rootDir"
|
||||
fi
|
||||
|
||||
masterDecompParDict="$rootDir/machineA/$caseName/system/decomposeParDict"
|
||||
caseOption="-case $rootDir/machineA/$caseName"
|
||||
|
||||
for subdir in machineA machineB machineC machineD
|
||||
do
|
||||
mkdir -p "$rootDir/$subdir/$caseName"
|
||||
done
|
||||
|
||||
# Master
|
||||
masterCase="$rootDir/machineA/$caseName"
|
||||
|
||||
for instance in 0 constant system
|
||||
do
|
||||
if [ -d "$masterCase/$instance" ]
|
||||
then
|
||||
echo " Directory exists: $targetDir/$instance"
|
||||
else
|
||||
echo "Copy $instance/ to master root: $masterCase"
|
||||
cp -R "$instance" "$masterCase"
|
||||
fi
|
||||
done
|
||||
|
||||
# others (nothing to copy)
|
||||
|
||||
|
||||
# Add distributed roots
|
||||
# - seems to be fine with relative root
|
||||
## rootDir="$PWD/$rootDir"
|
||||
|
||||
cat<< CASE_ROOTS >> "$masterCase/system/decomposeParDict"
|
||||
|
||||
distributed true;
|
||||
|
||||
roots
|
||||
(
|
||||
//master: "$rootDir/machineA"
|
||||
"$rootDir/machineA"
|
||||
"$rootDir/machineA"
|
||||
|
||||
"$rootDir/machineB"
|
||||
"$rootDir/machineB"
|
||||
"$rootDir/machineB"
|
||||
|
||||
"$rootDir/machineC"
|
||||
"$rootDir/machineC"
|
||||
"$rootDir/machineC"
|
||||
|
||||
"$rootDir/machineD"
|
||||
"$rootDir/machineD"
|
||||
"$rootDir/machineD"
|
||||
);
|
||||
CASE_ROOTS
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
#export FOAM_ABORT=true
|
||||
|
||||
runParallel -s decompose redistributePar -decompose -overwrite \
|
||||
-no-finite-area $caseOption $fileHandler
|
||||
|
||||
runParallel checkMesh $caseOption $fileHandler
|
||||
|
||||
runParallel makeFaMesh $caseOption $fileHandler
|
||||
|
||||
runParallel $(getApplication) $caseOption $fileHandler
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -1,58 +0,0 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
## ./Allclean
|
||||
|
||||
restore0Dir
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
rm -rf test-distribute
|
||||
masterDecompParDict="test-distribute/machineA/testcase/system/decomposeParDict"
|
||||
|
||||
for subdir in machineA machineB machineC machineD
|
||||
do
|
||||
mkdir -p test-distribute/"$subdir"/testcase
|
||||
done
|
||||
|
||||
# master
|
||||
cp -R 0 constant system test-distribute/machineA/testcase
|
||||
# others (nothing to copy)
|
||||
|
||||
|
||||
cat<< CASE_ROOTS >> "$masterDecompParDict"
|
||||
|
||||
distributed true;
|
||||
|
||||
roots
|
||||
(
|
||||
//master: "$PWD/test-distribute/machineA"
|
||||
"$PWD/test-distribute/machineA"
|
||||
"$PWD/test-distribute/machineA"
|
||||
|
||||
"$PWD/test-distribute/machineB"
|
||||
"$PWD/test-distribute/machineB"
|
||||
"$PWD/test-distribute/machineB"
|
||||
|
||||
"$PWD/test-distribute/machineC"
|
||||
"$PWD/test-distribute/machineC"
|
||||
"$PWD/test-distribute/machineC"
|
||||
|
||||
"$PWD/test-distribute/machineD"
|
||||
"$PWD/test-distribute/machineD"
|
||||
"$PWD/test-distribute/machineD"
|
||||
);
|
||||
CASE_ROOTS
|
||||
|
||||
#export FOAM_ABORT=true
|
||||
|
||||
runParallel -s decompose redistributePar -decompose -case test-distribute/machineA/testcase
|
||||
|
||||
# Currently fails (OpenFOAM-v2206)
|
||||
runParallel checkFaMesh -case test-distribute/machineA/testcase
|
||||
|
||||
exit 0
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user