mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Tutorial script update
This commit is contained in:
@ -6,28 +6,24 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
eulerianCase=../eulerianInjection
|
||||
|
||||
checkPrecursorCase() {
|
||||
if [ ! -f ${1}/system/controlDict ]
|
||||
then
|
||||
echo "Error: unable to find precursor Eulerian case $eulerianCase"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
copyLagrangianData() {
|
||||
copyLagrangianData()
|
||||
{
|
||||
dir=$1
|
||||
latestTime=$(\cd $dir && foamListTimes -latestTime)
|
||||
if [ ! "$latestTime" ]
|
||||
if [ -z $latestTime ]
|
||||
then
|
||||
if [ -d $dir/processor0 ]
|
||||
then
|
||||
# Try a processor directory
|
||||
latestTime=$(\cd $dir && foamListTimes -latestTime -processor)
|
||||
if [ "$latestTime" ]
|
||||
if [ -n $latestTime ]
|
||||
then
|
||||
dir="${dir}/processor0"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! "$latestTime" ]
|
||||
if [ -z $latestTime ]
|
||||
then
|
||||
echo "Error: unable to find Lagrangian data in case $eulerianCase"
|
||||
exit 1
|
||||
@ -35,13 +31,16 @@ copyLagrangianData() {
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
checkPrecursorCase ${eulerianCase}
|
||||
|
||||
restore0Dir;
|
||||
|
||||
copyLagrangianData ${eulerianCase}
|
||||
|
||||
@ -6,28 +6,24 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
eulerianCase=../eulerianInjection
|
||||
|
||||
checkPrecursorCase() {
|
||||
if [ ! -f ${1}/system/controlDict ]
|
||||
then
|
||||
echo "Error: unable to find precursor Eulerian case $eulerianCase"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
copyLagrangianData() {
|
||||
copyLagrangianData()
|
||||
{
|
||||
dir=$1
|
||||
latestTime=$(\cd $dir && foamListTimes -latestTime)
|
||||
if [ ! "$latestTime" ]
|
||||
if [ -z $latestTime ]
|
||||
then
|
||||
if [ -d $dir/processor0 ]
|
||||
then
|
||||
# Try a processor directory
|
||||
latestTime=$(\cd $dir && foamListTimes -latestTime -processor)
|
||||
if [ "$latestTime" ]
|
||||
if [ -n $latestTime ]
|
||||
then
|
||||
dir="${dir}/processor0"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! "$latestTime" ]
|
||||
if [ -z $latestTime ]
|
||||
then
|
||||
echo "Error: unable to find Lagrangian data in case $eulerianCase"
|
||||
exit 1
|
||||
@ -35,13 +31,16 @@ copyLagrangianData() {
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
checkPrecursorCase ${eulerianCase}
|
||||
|
||||
restore0Dir;
|
||||
|
||||
copyLagrangianData ${eulerianCase}
|
||||
|
||||
Reference in New Issue
Block a user