Skip to content
Snippets Groups Projects
Allrun 1.09 KiB
Newer Older
#!/bin/sh
cd ${0%/*} || exit 1    # run from this directory

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

eulerianCase=../eulerianInjection

copyLagrangianData()
{
    dir=$1
    latestTime=$(\cd $dir && foamListTimes -latestTime)
    if [ -z $latestTime ]
        if [ -d $dir/processor0 ]
            # Try a processor directory
            latestTime=$(\cd $dir && foamListTimes -latestTime -processor)
            if [ -n $latestTime ]
            then
                dir="${dir}/processor0"
            fi
    if [ -z $latestTime ]
    then
        echo "Error: unable to find Lagrangian data in case $eulerianCase"
        exit 1
    fi

    dir=$dir/${latestTime}/lagrangian

    if [ -d $dir ]
    then
        echo "Copying lagrangian data from $dir to 0 directory"
        \cp -r $dir 0
    else
        echo "Error: unable to find Lagrangian data in case $dir"
    fi
}


restore0Dir;

copyLagrangianData ${eulerianCase}

runApplication blockMesh

runApplication decomposePar

runParallel $(getApplication)

runApplication reconstructPar