#!/bin/bash # makeRepSaefcalc2 vers. 0.9 local (in this folder) command script to # help user transform the outputfile into an html/pdf report. # Usage: ./makeRepSaefcalc2 saefcalc2outputfile # Programs also needed: gnuplopt, delete1arg, htmldoc # Copyright (C) 2013 Al Conle # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the license, or (at # your option) any later version. # This file is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTA- # BILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public # License for more details. # You should have received a copy of the GNU General PUblic License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place -Suite 330, Boston, MA 02111-1307, USA. Try also their # web site: http://www.gnu.org/copyleft/gpl.html HTML=tempHTML$$ TMP2=/tmp/temp222.$$ #dadn=temp.dadn # Start writing the html page............................... #echo Content-type: text/html >$HTML echo >$HTML echo "
" >>$HTML echo "" >>$HTML
grep \#version\= $1 >$TMP2
# expecting: #version= 1.9 saefcalc2.f
read <$TMP2 item1 item2 item3 LEFTOVER
echo "$item3 vers.= $item2
" >>$HTML
echo "Preparing input data summary for html page ..."
echo "
Simulation input data:
" >>$HTML
grep \#matfile\= $1 | head -1 >$TMP2
read <$TMP2 item1 materialFile LEFTOVER
echo "Material file= $materialFile
" >>$HTML
grep ^\#multfactor\= $1 >$TMP2
read <$TMP2 item1 item2 LEFTOVER
#echo "ri= $item2 mm
" >>$HTML
echo "Multiplication Factor= $item2
" >>$HTML
# Ok, we have a potential material file in matfile
echo "
" >>$HTML grep \#xcalc2 <$1 | ./delete1arg >>$HTML echo "" >>$HTML echo "Predicted History Repetitions to Initiation:" >>$HTML echo "
" >>$HTML grep \#xcalc3 <$1 | ./delete1arg >>$HTML echo "" >>$HTML # fetch the hysteresis loops for plotting echo "" >>$HTML echo "
" >>$HTML
#Fetch boxed cumulative cycle plot and damage plot data
echo "" >>$HTML
echo "
" >>$HTML
echo "
" >>$HTML
echo "(Rectangles are Rainflow Cycle Sets: Sorted by Range: largest on Left)" >>$HTML
echo "" >>$HTML
echo "
" >>$HTML grep \#Inputs\= $1 | ./delete1arg >>$HTML echo "" >>$HTML echo "
" >>$HTML cat $materialFile >>$HTML echo "" >>$HTML echo "