v0.14.0
nitsche_test_get_data.sh
Go to the documentation of this file.
1 !/bin/bash
2 
3 #1 - input file
4 #2 - row
5 #3 - column
6 #4 - reference stress
7 
8 
9 awk '
10  /ORDER=/ { order=$2 }
11  /GAMMA=/ { gamma=$2 }
12  /PHI=/ {phi=$2}
13  /F=/ {file=$2}
14  /partition_problem: rank = 0 FEs row/ { nbdofs=$25 }
15  /stress '$2'/ { print order,gamma,phi,file,$'$3',nbdofs }
16 ' $1 \
17 | sed 's/ORDER=//' | sed 's/GAMMA=//' | sed 's/PHI=//' | sed 's/F=//' \
18 | sed 's/.h5m//' | sed 's/hole_//' \
19 | tee tmp1.txt
20 
21 ORDERLIST=`
22  awk '
23  {print $1}
24  ' tmp1.txt | sort | uniq
25 `
26 echo ORDERLIST $ORDERLIST
27 
28 GAMMALIST=`
29  awk '
30  {print $2}
31  ' tmp1.txt | sort | uniq
32 `
33 echo GAMMALIST $GAMMALIST
34 
35 PHILIST=`
36  awk '
37  {print $3}
38  ' tmp1.txt | sort | uniq
39 `
40 echo PHILIST $PHILIST
41 
42 
43 FILELIST=`
44  awk '
45  {print $4}
46  ' tmp1.txt | sort | uniq
47 `
48 echo FILELIST $FILELIST
49 
50 #h- ceneter
51 for GAMMA in $GAMMALIST; do
52  for PHI in $PHILIST; do
53  for ORDER in $ORDERLIST; do
54  awk '
55  $1~/'$ORDER'/ && $2~/'$GAMMA'/ && ($3=='$PHI') && $4!~/'off'/ { a=$5-'$4'; a=sqrt(a*a)/'$4'; print $6,a }
56  ' tmp1.txt | sort -n -k1 | tee tmp2_h_$ORDER\_$GAMMA\_$PHI.txt
57  done
58  done
59 done
60 
61 #h- off ceneter
62 for GAMMA in $GAMMALIST; do
63  for PHI in $PHILIST; do
64  for ORDER in $ORDERLIST; do
65  awk '
66  $1~/'$ORDER'/ && $2~/'$GAMMA'/ && ($3=='$PHI') && $4~/'off'/ { a=$5-'$4'; a=sqrt(a*a)/'$4'; print $6,a }
67  ' tmp1.txt | sort -n -k1 | tee tmp2_off_h_$ORDER\_$GAMMA\_$PHI.txt
68  done
69  done
70 done
71 
72 #gnuplot
73 # gnuplot -persist << EOF
74 # set log x
75 # set log y
76 # set title "Convergence Nitsche's method ({/Symbol \146}=-1 and {/Symbol \170}=10^{-4})"
77 # set xlabel 'Log(Nb. of dofs)'
78 # set ylabel 'Log(|{/Symbol \163}-{/Symbol \163}^{ref}|/{/Symbol \163}^{ref})'
79 # plot [:] \
80 # './tmp2_h_1_1e-6_-1.txt' w lp title 'P_1 {/Symbol \147}=10^{-6} (c)' lw 3 lt 1 pt 1,\
81 # './tmp2_h_1_1e-5_-1.txt' w lp title 'P_1 {/Symbol \147}=10^{-5} (c)' lw 3 lt 1 pt 2,\
82 # './tmp2_h_1_1e-4_-1.txt' w lp title 'P_1 {/Symbol \147}=10^{-4} (c)' lw 3 lt 1 pt 3,\
83 # './tmp2_off_h_1_1e-6_-1.txt' w lp title 'P_1 {/Symbol \147}=10^{-6} (o)' lw 3 lt 2 pt 1,\
84 # './tmp2_off_h_1_1e-5_-1.txt' w lp title 'P_1 {/Symbol \147}=10^{-5} (o)' lw 3 lt 2 pt 2,\
85 # './tmp2_off_h_1_1e-4_-1.txt' w lp title 'P_1 {/Symbol \147}=10^{-4} (o)' lw 3 lt 2 pt 3,\
86 # './tmp2_h_2_1e-6_-1.txt' w lp title 'P_2 {/Symbol \147}=10^{-6} (c)' lw 3 lt 3 pt 1,\
87 # './tmp2_h_2_1e-5_-1.txt' w lp title 'P_2 {/Symbol \147}=10^{-5} (c)' lw 3 lt 3 pt 2,\
88 # './tmp2_off_h_2_1e-6_-1.txt' w lp title 'P_2 {/Symbol \147}=10^{-6} (c)' lw 3 lt 4 pt 1,\
89 # './tmp2_off_h_2_1e-5_-1.txt' w lp title 'P_2 {/Symbol \147}=10^{-5} (c)' lw 3 lt 4 pt 2
90 # set terminal postscript eps enhanced color font 'Helvetica,10'
91 # set output "my-plot1.ps"
92 # replot
93 # EOF