openfoam/tutorials/mesh/parallel/cavity/Allrun
Mark Olesen 61aaacd088 ENH: adjust renumbering methods, extend renumberMesh options
- renumberMesh now has -dry-run, -write-maps, -no-fields,
  -renumber-method, -renumber-coeffs options.

  * Use -dry-run with -write-maps to visualize the before/after
    effects of renumbering (creates a VTK file).

  * -no-fields to renumber the mesh only.
    This is useful and faster when the input fields are uniform
    and the -overwrite option is specified.

  * -renumber-method allows a quick means of specifying a different
    default renumber method (instead of Cuthill-McKee).

    The -renumber-coeffs option allows passing of dictionary content
    for the method.

    Examples,

       // Different ways to specify reverse Cuthill-McKee

       *  -renumber-method RCM
       *  -renumber-coeffs 'reverse true;'
       *  -renumber-method CuthillMcKee
       *  -renumber-coeffs 'reverse true;'
       *  -renumber-coeffs 'method CuthillMcKee; reverse true;'

       // Other (without dictionary coefficients)
       *  renumberMesh -renumber-method random

       // Other (with dictionary coefficients)
       renumberMesh \
           -renumber-method spring \
           -renumber-coeffs 'maxCo 0.1; maxIter 1000; freezeFraction 0.99;'

       // Other (with additional libraries)
       renumberMesh -renumber-method zoltan -lib zoltanRenumber

COMP: build zoltan renumbering to MPI-specific location

- zoltan and Sloan renumbering are now longer automatically linked to
  the renumberMesh utility but must be separately loaded by a
  command-line option or through a dictionary "libs" entry.

ENH: add output cellID for decomposePar -dry-run -cellDist
2024-03-06 17:58:47 +01:00

51 lines
1.7 KiB
Bash
Executable File

#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
runApplication blockMesh
decompDict5="-decomposeParDict system/decomposeParDict.5"
fileHandler="-fileHandler uncollated"
# redistributePar to do decomposition
runParallel -s decompose redistributePar -decompose $fileHandler
# Bit of renumbering and running
runParallel -s CuthillMcKee renumberMesh -overwrite $fileHandler
runParallel -s CuthillMcKee icoFoam $fileHandler
# Bit of bad renumbering and running
runParallel -s random renumberMesh -renumber-method random -overwrite $fileHandler
runParallel -s random icoFoam $fileHandler
# Pick up last result
cp system/controlDict-latestTime system/controlDict
# Redistribute to 5 processors.
# Note that new processors only get written with a mesh at the current time.
# Use -overwrite instead to write the mesh to constant
runParallel -s 5 $decompDict5 redistributePar -cellDist $fileHandler
latestTime=$(foamListTimes -processor -latestTime)
echo "New mesh distribution. Time = $latestTime"
# Run a bit more
runParallel -s 5 $decompDict5 icoFoam $fileHandler
# Reconstruct mesh and results.
# The time argument to make sure we only pick up the new decomposition
if [ -n "$latestTime" ]
then
runParallel -s reconstruct -np 5 redistributePar -reconstruct \
-time "${latestTime}:" $fileHandler
else
runParallel -s reconstruct -np 5 redistributePar -reconstruct \
-latestTime $fileHandler
fi
#------------------------------------------------------------------------------