summaryrefslogtreecommitdiff
path: root/rktopas
diff options
context:
space:
mode:
Diffstat (limited to 'rktopas')
-rwxr-xr-xrktopas18
1 files changed, 9 insertions, 9 deletions
diff --git a/rktopas b/rktopas
index f0900c8..589f8d3 100755
--- a/rktopas
+++ b/rktopas
@@ -4,7 +4,7 @@ for inputFile in $*
do
outputFile="$(echo ${inputFile} | sed "s/\.txt$/.inc/")"
- lines=$(grep --text "^ *[0-9]\+ \+[0-9]\+ \+[-0-9.^*]\+.$" ${inputFile} | sed "s/^ \+//" | sed "s/[^0-9]$//" | grep -v "^[0-9]\+ \+[0-9]\+ \+0\(\.0\+\)\?$" | sed "s/0\+$//" | awk '{print $1+1" "$2+1" "$3}')
+ lines=$(grep --text "^ *[0-9]\+ \+[0-9]\+ \+[-0-9.^*/]\+.\?$" ${inputFile} | sed "s/^ \+//" | sed "s/[^0-9]$//" | grep -v "^[0-9]\+ \+[0-9]\+ \+0\(\.0\+\)\?$" | sed "s/0\+$//" | awk '{print $1+1" "$2+1" "$3}')
[ -e ${outputFile} ] && rm ${outputFile}
touch ${outputFile}
@@ -12,22 +12,22 @@ do
for i in $(echo -ne "${lines}" | cut -d " " -f 1 | sort -nu)
do
echo -ne " felders[${i}].liKo(\n felders[aktuelleFelder]" >> ${outputFile}
- echo -ne "${lines}" | grep "^${i} \+" | sed "s/^[0-9]\+ \+\([0-9]\+\) \+[-0-9.*^]\+$/,\n felders[\1]/" | tr "\n" ";" | sed "s/;,/,/g" | sed "s/;$//" | tr ";" "\n" | sed "s/felders\[1\]/felders[aktuelleFelder]/g" >> ${outputFile}
- echo -ne "${lines}" | grep "^${i} \+" | sed "s/^[0-9]\+ \+[0-9]\+ \+\([-0-9.*^]\+\)$/,\n \1 * dT/" | tr "\n" ";" | sed "s/,;/,\n/g" | sed "s/;,/,/g" | tr ";" " " | sed "s/ $//" | sed "s/\*10^/E/g" >> ${outputFile}
+ echo -ne "${lines}" | grep "^${i} \+" | sed "s/^[0-9]\+ \+\([0-9]\+\) \+[-0-9.*^/]\+$/,\n felders[\1]/" | tr "\n" ";" | sed "s/;,/,/g" | sed "s/;$//" | tr ";" "\n" | sed "s/felders\[1\]/felders[aktuelleFelder]/g" >> ${outputFile}
+ echo -ne "${lines}" | grep "^${i} \+" | sed "s/^[0-9]\+ \+[0-9]\+ \+\([-0-9.*^/]\+\)$/,\n \1 * dT/" | tr "\n" ";" | sed "s/,;/,\n/g" | sed "s/;,/,/g" | tr ";" " " | sed "s/ $//" | sed "s/\*10^/E/g" >> ${outputFile}
echo -e "\n );" >> ${outputFile}
- echo " felders[${i}].berechneAbleitungen(dT/2,dX,iDT,iDX,pDNMax);" >> ${outputFile}
+ echo " felders[${i}].berechneAbleitungen(dX,iDX,pDNMax);" >> ${outputFile}
echo >> ${outputFile}
- echo " if pruefeMaxDT(${i},mDT,dT,dTMin) then" >> ${outputFile}
+ echo " if pruefeMaxDT(${i},dTMax,dT,dTMin) then" >> ${outputFile}
echo " continue;" >> ${outputFile}
echo >> ${outputFile}
done
- rest=$[$(wc -l ${inputFile} | cut -d " " -f 1)-$(grep --text -n "^ *k\s\+c\[k].$" ${inputFile} | cut -d ":" -f 1)]
- lines=$(tail -n${rest} ${inputFile} | sed "s/^ \+//" | sed "s/[^0-9]$//" | grep --text "^[0-9]\+ \+[-0-9.^*]\+$" | grep -v "^[0-9]\+ \+0\(\.0\+\)\?$" | sed "s/0\+$//" | awk '{print $1+1" "$2}')
+ rest=$[$(wc -l ${inputFile} | cut -d " " -f 1)-$(grep --text -n "^ *k\s\+c\[k].\?$" ${inputFile} | cut -d ":" -f 1)]
+ lines=$(tail -n${rest} ${inputFile} | sed "s/^ \+//" | sed "s/[^0-9]$//" | grep --text "^[0-9]\+ \+[-0-9.^*/]\+$" | grep -v "^[0-9]\+ \+0\(\.0\+\)\?$" | sed "s/0\+$//" | awk '{print $1+1" "$2}')
echo -e " felders[1-aktuelleFelder].liKo(\n felders[aktuelleFelder]," >> ${outputFile}
- echo -e "${lines}" | sed "s/^\([0-9]\+\) \+[-0-9.*^]\+$/ felders[\1],/" | sed "s/felders\[1\]/felders[aktuelleFelder]/g" >> ${outputFile}
- echo -ne "${lines}" | sed "s/^[0-9]\+ \+\([-0-9.*^]\+\)$/ \1 * dT,/" | tr "\n" "," | sed "s/\([^,]\),$/\1\n );\n/" | sed "s/,,/,\n/g" | sed "s/\*10^/E/g" >> ${outputFile}
+ echo -e "${lines}" | sed "s/^\([0-9]\+\) \+[-0-9.*^/]\+$/ felders[\1],/" | sed "s/felders\[1\]/felders[aktuelleFelder]/g" >> ${outputFile}
+ echo -ne "${lines}" | sed "s/^[0-9]\+ \+\([-0-9.*^/]\+\)$/ \1 * dT,/" | tr "\n" "," | sed "s/\([^,]\),$/\1\n );\n/" | sed "s/,,/,\n/g" | sed "s/\*10^/E/g" >> ${outputFile}
done