commit 2c9277c8dbc8721154be33abd2da1dbe5e53126e
parent 7f446a91978f5319c65410854e17cd3fa6548bc1
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 25 Jun 2019 16:51:31 +0200
Add preliminary figure 4 and fix directory listing in top makefile
Diffstat:
3 files changed, 86 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,6 +1,6 @@
REPO = 1d_fd_simple_shear
-FIGDIRS := $(sort $(dir $(wildcard fig*/)))
-FIGURES := $(FIGDIRS:/=).pdf
+FIGDIRS := $(filter-out ./, $(sort $(dir $(wildcard ./fig*/))))
+FIGURES := $(addsuffix .pdf,$(FIGDIRS:/=))
default: $(FIGURES)
@@ -15,6 +15,12 @@ $(REPO)/Makefile:
clean:
make -C $(REPO)/ clean
- $(RM) -r fig*.pdf
+ make -C fig1/ clean
+ make -C fig2/ clean
+ make -C fig3/ clean
+ make -C fig4/ clean
+ $(RM) fig*.pdf
+
+print-% : ; @echo $* = $($*)
.PHONY: default figures clean
diff --git a/fig4/Makefile b/fig4/Makefile
@@ -0,0 +1,24 @@
+BIN = ../1d_fd_simple_shear/1d_fd_simple_shear
+FIG = fig4
+
+default: ../$(FIG).pdf
+
+unnamed.output00000.txt: $(BIN) Makefile
+ /bin/sh -c '\
+ ./$< --resolution 50 --length 2.0 --normal-stress 150e3 \
+ --fluid --fluid-permeability 2e-17 --fluid-pressure-top 50e3 \
+ --fluid-pressure-ampl 50e3 \
+ --fluid-pressure-freq $$( echo "1.0/(3600*24)" | bc -l ) \
+ --time-step 1e-1 \
+ --file-interval $$( echo "3600" | bc -l ) \
+ --time-end $$( echo "3600*24*3 + 3600" | bc -l ) \
+ --normalize'
+
+../$(FIG).pdf: fig.gp unnamed.output00000.txt
+ gnuplot $< > $@
+
+clean:
+ $(RM) *.txt
+ $(RM) ../$(FIG).pdf
+
+.PHONY: default clean
diff --git a/fig4/fig.gp b/fig4/fig.gp
@@ -0,0 +1,53 @@
+#!/usr/bin/env gnuplot
+
+reset
+
+#set terminal pdfcairo color size 7.5 cm, 7.5 cm
+set terminal pdfcairo color size 15.0 cm, 5.0 cm
+set multiplot layout 1,4 \
+ margins 0.09,0.97,0.23,0.95 \
+ spacing 0.03,0.03
+
+set yrange [0.0:2.0]
+
+set key bottom right #samplen 0.9
+
+t0 = 47
+tend = 70
+
+filename(t) = sprintf('unnamed.output%05d.txt', t)
+
+set pm3d map
+set palette rgb 10,6,6
+
+unset colorbox
+set xlabel "Water pressure [kPa]"
+set ylabel "Vertical position, z [m]"
+set xrange [0:100]
+plot for [t = t0:tend] filename(t) u ($4/1e3):1:(t-t0) w l lc palette lw 1 t ""
+
+set xlabel "Eff. normal stress [kPa]"
+set ylabel ""
+set xrange [50:150]
+unset ytics
+plot for [t = t0:tend] filename(t) u ($3/1e3):1:(t-t0) w l lc palette lw 1 t ""
+
+set xlabel "Shear velocity [m/s]"
+set ylabel ""
+set xrange [0.0:0.023]
+set xtics (0,0.01,0.02)
+unset ytics
+plot for [t = t0:tend] filename(t) u 2:1:(t-t0) w l lc palette lw 1 t ""
+
+set xlabel "Shear strain rate [1/s]"
+set ylabel ""
+set xrange [0:3.1e-3]
+#set format x "%.0s*10^{%T}"
+set xtics (0,0.001,0.002,0.003)
+unset ytics
+prev1 = prev2 = 0
+shift(x) = (prev2 = prev1, prev1 = x)
+plot for [t = t0:tend] filename(t) u (shift($2), $0 < 1 ? 1/0 : $2 - prev2):1:(t-t0) w l lc palette lw 1 t ""
+unset format x
+
+unset multiplot