tMakefile - cngf-pf-exp1 - experiments for first paper with continuum granular … | |
git clone git://src.adamsgaard.dk/manus_continuum_granular1_exp | |
Log | |
Files | |
Refs | |
Submodules | |
README | |
LICENSE | |
--- | |
tMakefile (2077B) | |
--- | |
1 BIN = ../cngf-pf/cngf-pf | |
2 FIG != basename $(PWD) | |
3 | |
4 default: ../$(FIG).pdf | |
5 | |
6 sim.output00000.txt: $(BIN) | |
7 /bin/sh -c '\ | |
8 ./$(BIN) -L 8.0 \ | |
9 -n 200e3 \ | |
10 -s $$( echo "1000/(365*24*60*60)" | bc -l ) \ | |
11 -d 1e-3 \ | |
12 -F \ | |
13 -k 2e-17 \ | |
14 -O 100e3 \ | |
15 -a 80e3 \ | |
16 -q $$( echo "1.0/(3600*24)" | bc -l ) \ | |
17 -I $$( echo "60*10" | bc -l ) \ | |
18 -e $$( echo "3600*24*7" | bc -l ) sim' | |
19 | |
20 timeseries.txt: sim.output00000.txt | |
21 /bin/sh -c '\ | |
22 rm -f $@; \ | |
23 for f in sim.output*.txt; do \ | |
24 tail -n 1 "$$f" | cut -f2- >> $@; \ | |
25 done' | |
26 | |
27 max_strainrate_depth.txt: sim.output00000.txt | |
28 /bin/sh -c '\ | |
29 rm -f $@; \ | |
30 for f in sim.output*.txt; do \ | |
31 awk " \ | |
32 BEGIN{getline; depth=8.0; max=0.0} \ | |
33 NF{ \ | |
34 if (\$$6 >= max && \$$6+0 > 1e-300) \ | |
35 { \ | |
36 max=\$$6; \ | |
37 depth=\$$1; \ | |
38 } \ | |
39 } \ | |
40 END{ \ | |
41 print depth,\"\t\",max \ | |
42 }" \ | |
43 "$$f" >> $@; \ | |
44 done' | |
45 | |
46 # central finite differences | |
47 sediment_flux.txt: sim.output00000.txt | |
48 /bin/sh -c '\ | |
49 rm -f $@; \ | |
50 for f in sim.output*.txt; do \ | |
51 awk " \ | |
52 BEGIN{getline; integral=0.0} \ | |
53 NF{ \ | |
54 if (NR > 1) \ | |
55 { \ | |
56 integral+=(\$$2+v_prev)/2.0*(\$$… | |
57 } \ | |
58 z_prev=\$$1; \ | |
59 v_prev=\$$2; \ | |
60 } \ | |
61 END{ \ | |
62 print integral \ | |
63 }" \ | |
64 "$$f" >> $@; \ | |
65 done' | |
66 | |
67 ../$(FIG).pdf: fig.gp timeseries.txt max_strainrate_depth.txt sediment_f… | |
68 gnuplot fig.gp > $@ | |
69 | |
70 max_pressure_gradient.pdf: max_pressure_gradient.txt | |
71 gnuplot -e "set t pdfcairo; \ | |
72 set xlabel 'output file [-]'; \ | |
73 set ylabel 'max. norm. eff. stress gradient [kPa/m]'; \ | |
74 plot 'max_pressure_gradient.txt' u 0:(\$$1/1e3) w l t ''… | |
75 > $@ | |
76 | |
77 max_pressure_gradient.txt: sim.output00000.txt | |
78 > "$@" | |
79 for f in sim.output*.txt; do \ | |
80 awk ' \ | |
81 function abs(x) \ | |
82 { \ | |
83 return (x >= 0.0) ? x : -x; \ | |
84 } \ | |
85 { \ | |
86 if (NR > 1) { \ | |
87 dN_norm = abs(($$3 - N_prev)/($$… | |
88 if (dN_norm > dN_dx_norm_max) { \ | |
89 dN_dx_norm_max = dN_norm… | |
90 } \ | |
91 } \ | |
92 z_prev = $$1; \ | |
93 N_prev = $$3; \ | |
94 } \ | |
95 END { \ | |
96 print dN_dx_norm_max \ | |
97 }' "$$f" >> "$@"; done | |
98 | |
99 clean: | |
100 rm -f *.txt | |
101 rm -f ../$(FIG).pdf | |
102 | |
103 .PHONY: default clean |