#!/bin/csh -f
#
# Transportation Cask Shape Optimization
# Output Filter
# Mike Eldred, 2/95
#
# Usage: cask_ofilter dummystring2 output_temp_file_name
#        where   dummystring2 is a dummy specifier in dakota.in
#        and     output_temp_file_name is a file to be written that 
#                contains the objective fn. and constraints in the 
#                Dakota format.
#
echo "Output Filter" > ofilter.out
#
# Dakota Output Filter Portion -- WEIGHT "CALCULATION"
#
cat weight.dat > $argv[2]
rm -f weight.dat
# ---------------------------------------------------------------------
# Dakota Output Filter Portion -- END-ON STRUCTURAL
#
# Create stress history neutral file from pat_end.h using blotII-2 
# with the directives in sigblt_end.inp.  The '-dev met' option 
# prevents the opening of a graphics Xwindow.
blot -input sigblt_end.inp -dev met pat_end.h >>& ofilter.out
#
# Filter time history, capture max. stress, and output constraint value 
# to stdout.  The '>>' appends stdout to the temp file name that was 
# passed to the script on the command line.
fildata.exe >> $argv[2]
# ---------------------------------------------------------------------
# Dakota Output Filter Portion -- SIDE-ON STRUCTURAL
#
# Create stress history neutral file from pat_side.e using blotII-2 
# with the directives in sigblt_side.inp.  The '-dev met' option 
# prevents the opening of a graphics Xwindow.
blot -input sigblt_side.inp -dev met pat_side.h >>& ofilter.out
#
# Capture max. stress and output constraint value to stdout. The '>>' 
# appends stdout to the temp file name that was passed to the script on 
# the command line.
strip.exe >> $argv[2]
# ---------------------------------------------------------------------
# Dakota Output Filter Portion -- THERMAL
#
# Read coyote_opt.dat (generated by hardcoding in coyote_opt.x), 
# capture max. temp, and output constraint value to stdout. The '>>' 
# appends stdout to the temp file name that was passed to the script 
# on the command line.
getmaxtemp.exe >> $argv[2]
# ---------------------------------------------------------------------
# Echo temp output file (objective function & normalized constraints)
# to stdout:
echo " "
echo "Objective function and normalized constraint values:"
cat $argv[2]
