Skip to content
Snippets Groups Projects
Commit 9d26b25c authored by Mark OLESEN's avatar Mark OLESEN
Browse files

TUT: multi-world tutorial setup with circular connectivity

parent 2bb91e35
Branches
Tags
1 merge request!480improve handling of multiple world communication
Showing
with 56 additions and 29 deletions
-np 2 laplacianFoam -case left -world LEFT -parallel
-np 2 laplacianFoam -case right -world RIGHT -parallel
-np 1 xterm -font fixed -title left -geometry 200x15+0+0 -e ./run_world.sh left
-np 1 xterm -font fixed -title right -geometry 200x15+0+200 -e ./run_world.sh right
../../left/constant/transportProperties
\ No newline at end of file
-np 2 laplacianFoam -case left -world LEFT -parallel
-np 2 laplacianFoam -case right -world RIGHT -parallel
../../left/constant/transportProperties
\ No newline at end of file
...@@ -3,12 +3,14 @@ cd "${0%/*}" || exit # Run from this directory ...@@ -3,12 +3,14 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions . ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
for subcase in left right for subcase in $(./list-worlds)
do do
( (
cd "$subcase" && cleanCase cd "$subcase" || exit
cleanCase0
rm -f *_mapped.obj 2>/dev/null
) )
done done
rm -f log.* rm -rf log.* 2>/dev/null
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
...@@ -5,25 +5,19 @@ cd "${0%/*}" || exit # Run from this directory ...@@ -5,25 +5,19 @@ cd "${0%/*}" || exit # Run from this directory
# Run serial # Run serial
./Allrun.pre ./Allrun.pre
mpirun -app ./mpirun_left_right.schema echo "Begin run"
mpirun -app ./mpirun_worlds.schema
# Run with database # Run with database
mv -f log.run_left* log.run_right* ./Allrun.addDatabase
mv -f log.run_* 2>/dev/null
for subcase in left right echo "Begin run with database"
do mpirun -app ./mpirun_worlds.schema
(
cd "$subcase" || exit
foamListTimes -rm
restore0Dir
foamDictionary 0/T -entry boundaryField.coupled.sampleDatabase -add true
)
done
mpirun -app ./mpirun_left_right.schema
## Run parallel ## Run parallel
## ./Allrun.pre-parallel ## ./Allrun.pre-parallel
## mpirun -app ./mpirun.schema ## mpirun -app ./mpirun.schema
echo "End"
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
# Running with database
for subcase in $(./list-worlds)
do
(
cd "$subcase" || exit
foamListTimes -rm
restore0Dir
dictFile="0/T"
for patch in $(foamDictionary "$dictFile" -keywords -entry boundaryField)
do
patchType="$(foamDictionary "$dictFile" -value -entry boundaryField/"$patch"/type)"
case "$patchType" in
(mapped*)
foamDictionary "$dictFile" -entry boundaryField/"$patch"/sampleDatabase -add true >/dev/null
echo "Use sampleDatabase: $subcase/$dictFile patch=$patch"
;;
esac
done
)
done
#------------------------------------------------------------------------------
...@@ -4,11 +4,19 @@ cd "${0%/*}" || exit # Run from this directory ...@@ -4,11 +4,19 @@ cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Create meshes and initial fields # Create meshes and initial fields
for subcase in left right for subcase in $(./list-worlds)
do do
( (
cd "$subcase" || exit cd "$subcase" || exit
runApplication blockMesh && restore0Dir echo "case=$subcase"
if [ -x ./Allrun.pre ]
then
./Allrun.pre
else
runApplication blockMesh
fi
restore0Dir
echo
) )
done done
......
...@@ -4,7 +4,7 @@ cd "${0%/*}" || exit # Run from this directory ...@@ -4,7 +4,7 @@ cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Create meshes and initial fields # Create meshes and initial fields
for subcase in left right for subcase in $(./list-worlds)
do do
( (
cd "$subcase" || exit cd "$subcase" || exit
......
...@@ -29,7 +29,7 @@ boundaryField ...@@ -29,7 +29,7 @@ boundaryField
sampleMode nearestPatchFaceAMI; sampleMode nearestPatchFaceAMI;
// Simulation world to sample // Simulation world to sample
sampleWorld RIGHT; sampleWorld right;
// Region to sample // Region to sample
sampleRegion region0; sampleRegion region0;
......
../../common/constant/transportProperties
\ No newline at end of file
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