hypre/test/TEST_sstruct/sstruct_struct.sh

92 lines
3.1 KiB
Bash
Raw Normal View History

#!/bin/sh
#BHEADER**********************************************************************
2008-07-18 09:34:48 +08:00
# Copyright (c) 2008, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
2008-07-18 09:34:48 +08:00
# This file is part of HYPRE. See file COPYRIGHT for details.
#
# HYPRE is free software; you can redistribute it and/or modify it under the
2008-07-18 09:34:48 +08:00
# terms of the GNU Lesser General Public License (as published by the Free
# Software Foundation) version 2.1 dated February 1999.
#
# $Revision$
#EHEADER**********************************************************************
TNAME=`basename $0 .sh`
#=============================================================================
# Compare the struct solvers called from sstruct & struct interfaces
#=============================================================================
tail -3 ${TNAME}.out.0 > ${TNAME}.testdata
tail -3 ${TNAME}.out.200 > ${TNAME}.testdata.temp
diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2
#=============================================================================
tail -3 ${TNAME}.out.1 > ${TNAME}.testdata
tail -3 ${TNAME}.out.201 > ${TNAME}.testdata.temp
diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2
#=============================================================================
# Compare 19pt, 7pt, positive, and negative definite
#=============================================================================
tail -3 ${TNAME}.out.10 > ${TNAME}.testdata
tail -3 ${TNAME}.out.11 > ${TNAME}.testdata.temp
diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2
tail -3 ${TNAME}.out.12 > ${TNAME}.testdata.temp
diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2
tail -3 ${TNAME}.out.13 > ${TNAME}.testdata.temp
diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2
tail -3 ${TNAME}.out.15 > ${TNAME}.testdata
tail -3 ${TNAME}.out.16 > ${TNAME}.testdata.temp
diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2
tail -3 ${TNAME}.out.17 > ${TNAME}.testdata.temp
diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2
tail -3 ${TNAME}.out.18 > ${TNAME}.testdata.temp
diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2
#=============================================================================
# compare with baseline case
#=============================================================================
FILES="\
${TNAME}.out.0\
${TNAME}.out.1\
${TNAME}.out.200\
${TNAME}.out.201\
${TNAME}.out.10\
${TNAME}.out.11\
${TNAME}.out.12\
${TNAME}.out.13\
${TNAME}.out.15\
${TNAME}.out.16\
${TNAME}.out.17\
${TNAME}.out.18\
"
for i in $FILES
do
echo "# Output file: $i"
tail -3 $i
done > ${TNAME}.out
# Make sure that the output files are reasonable
CHECK_LINE="Iterations"
OUT_COUNT=`grep "$CHECK_LINE" ${TNAME}.out | wc -l`
SAVED_COUNT=`grep "$CHECK_LINE" ${TNAME}.saved | wc -l`
if [ "$OUT_COUNT" != "$SAVED_COUNT" ]; then
echo "Incorrect number of \"$CHECK_LINE\" lines in ${TNAME}.out" >&2
fi
if [ -z $HYPRE_NO_SAVED ]; then
diff -U3 -bI"time" ${TNAME}.saved ${TNAME}.out >&2
fi
#=============================================================================
# remove temporary files
#=============================================================================
rm -f ${TNAME}.testdata*