#!/bin/csh -f
#
# Transportation Cask Shape Optimization
# Input Filter
# Mike Eldred, 2/95
#
# Usage: cask_ifilter input_temp_file_name dummystring1
#        where   input_temp_file_name is a file to be read that
#                contains the deign variables in the Dakota format
#        and     dummystring1 is a dummy specifier in dakota.in
#
#
echo "Input Filter" > ifilter.out
# ---------------------------------------------------------------------
# create dim.dat from temp file (temp file name passed on command line)
createdim.exe $argv[1] >> ifilter.out
#
# ---------------------------------------------------------------------
# Dakota Input Filter Portion -- END-ON STRUCTURAL
#
# create pat_end.i from pat_end.inp template
aprepro --nowarning pat_end_inp.app pat_end.i
aprepro --nowarning pat_end_fsq.app pat_end.fsq
#
# create genesis file pat_end.g using fastq 
# The fastq input template file pat_end.fsq is preprocessed with aprepro
fastq -m pat_end.g pat_end.fsq >>& ifilter.out
# ---------------------------------------------------------------------
# Dakota Input Filter Portion -- SIDE-ON STRUCTURAL
#
# create pat_side.i & pat_side.fsq from pat_side.inp & pat_side_fsq.app 
# templates using aprepro
aprepro --nowarning pat_side_inp.app pat_side.i
aprepro --nowarning pat_side_fsq.app pat_side.fsq
#
# create genesis file pat_side.g using fastq 
fastq -m pat_side.g pat_side.fsq >>& ifilter.out
# ---------------------------------------------------------------------
# Dakota Input Filter Portion -- THERMAL
#
aprepro --nowarning cask6_fastq.app cask6.fsq
aprepro --nowarning cask6_input.app cask6.inp
fastq -m cask6.gen cask6.fsq >>& ifilter.out
# ---------------------------------------------------------------------
# Dakota Output Filter Portion -- WEIGHT CALCULATION
#
weight.exe $argv[1] > weight.dat
# ---------------------------------------------------------------------
#rm -f ifilter.out
