Skip to content
Snippets Groups Projects
Allrun 1.67 KiB
Newer Older
  • Learn to ignore specific revisions
  • cd "${0%/*}" || exit                                # Run from this directory
    
    . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
    #------------------------------------------------------------------------------
    
    runApplication blockMesh
    
    
    decompDict5="-decomposeParDict system/decomposeParDict.5"
    
    Andrew Heather's avatar
    Andrew Heather committed
    # redistributePar to do decomposition
    
    runParallel -s decompose redistributePar -decompose $fileHandler
    
    Andrew Heather's avatar
    Andrew Heather committed
    # Bit of renumbering and running
    
    runParallel -s CuthillMcKee renumberMesh -overwrite $fileHandler
    runParallel -s CuthillMcKee icoFoam $fileHandler
    
    Andrew Heather's avatar
    Andrew Heather committed
    # Bit of bad renumbering and running
    
    runParallel -s random renumberMesh -renumber-method random -overwrite $fileHandler
    
    runParallel -s random icoFoam $fileHandler
    
    Andrew Heather's avatar
    Andrew Heather committed
    # 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"
    
    
    Andrew Heather's avatar
    Andrew Heather committed
    # 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
    
    #------------------------------------------------------------------------------