diff options
author | Erich Eckner <git@eckner.net> | 2015-08-04 15:55:25 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2015-08-04 15:55:25 +0200 |
commit | 9a20545e798a68ebd73f92ca0f19a2cfbebf5983 (patch) | |
tree | 5dae20a84b7c2127d0f182f99a2f79c554304517 /rktopas | |
parent | e425856940fd5237241d315c26d61b5f41e23ad4 (diff) | |
download | Plasmapropagation-9a20545e798a68ebd73f92ca0f19a2cfbebf5983.tar.xz |
alle Runge-Kuttas in .inc ausgelagert,
minimales dT auf dX gesetzt (sonst Bug z.B. in AY)
Diffstat (limited to 'rktopas')
-rwxr-xr-x | rktopas | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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 |