Skip to content

Commit

Permalink
Final editor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
danshapero committed Nov 6, 2024
1 parent 65f2b86 commit 472b7c8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
5 changes: 4 additions & 1 deletion demos/convergence-tests/make_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
args = parser.parse_args()

model_types = ["Ice shelf", "Ice stream"]
panel_letters = ["a", "b"]
fig, axes = plt.subplots(nrows=1, ncols=2, sharex=True, sharey=True)
axes[0].set_xlabel("Mesh spacing (m)")
axes[0].set_ylabel("$L^2$-norm relative error")
axes[1].get_yaxis().set_visible(False)

for ax, model_type in zip(axes, model_types):
for ax, model_type, panel_letter in zip(axes, model_types, panel_letters):
filename = model_type.lower().replace(" ", "_") + "_results.json"
with open(filename, "r") as input_file:
data = json.load(input_file)
Expand All @@ -23,6 +24,8 @@
ax.set_xscale("log")
ax.set_xticks([2.5e2, 5e2, 1e3], labels=["$250$", "$500$", "$1000$"])
ax.set_yscale("log")
kw = {"xy": (0.05, 0.92), "xycoords": "axes fraction", "fontsize": 16}
ax.annotate(panel_letter, **kw)

colors = list(matplotlib.colors.TABLEAU_COLORS.keys())
for name, results in data.items():
Expand Down
4 changes: 2 additions & 2 deletions demos/gibbous-ice-shelf/make_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
axes[0, 1].set_title("Velocity")
axes[0, 1].annotate("b", **kw)
colors = streamplot(u_steady, resolution=10e3, seed=1729, axes=axes[0, 1])
fig.colorbar(colors, label="m/yr", orientation="horizontal", pad=0.04, ax=axes[0, 1])
fig.colorbar(colors, label="m yr${}^{-1}$", orientation="horizontal", pad=0.04, ax=axes[0, 1])

axes[0, 2].set_title("Membrane stress")
axes[0, 2].annotate("c", **kw)
Expand All @@ -82,7 +82,7 @@
V = us[0].function_space()
δu = firedrake.Function(V).interpolate(us[index] - us[0])
colors = firedrake.tripcolor(δu, axes=axes[1, 1])
fig.colorbar(colors, label="m/yr", orientation="horizontal", pad=0.04, ax=axes[1, 1])
fig.colorbar(colors, label="m yr${}^{-1}$", orientation="horizontal", pad=0.04, ax=axes[1, 1])

axes[1, 2].set_title("Stress change")
axes[1, 2].annotate("f", **kw)
Expand Down
4 changes: 2 additions & 2 deletions demos/singularity/singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

fig, ax = plt.subplots(constrained_layout=True)
ax.set_title("Primal form", fontsize=fontsize)
ax.set_xlabel("strain rate $\dot\\varepsilon$", fontsize=fontsize)
ax.set_xlabel("Strain rate $\dot\\varepsilon$", fontsize=fontsize)
ax.get_xaxis().set_ticks([])
ax.get_yaxis().set_visible(False)
ax.set_xlim((-1.0, 1.0))
Expand All @@ -31,7 +31,7 @@

fig, ax = plt.subplots(constrained_layout=True)
ax.set_title("Dual form", fontsize=fontsize)
ax.set_xlabel("stress $\\tau$", fontsize=fontsize)
ax.set_xlabel("Stress $\\tau$", fontsize=fontsize)
ax.get_xaxis().set_ticks([])
ax.get_yaxis().set_visible(False)
ax.set_xlim((-1.0, 1.0))
Expand Down
2 changes: 2 additions & 0 deletions dual-problems.bib
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ @article{schoof2007mis
journal = {Journal of Geophysical Research: Earth Surface},
volume = {112},
number = {F3},
pages = {F03S28},
year = {2007},
doi = {10.1029/2006JF000664}
}
Expand All @@ -358,6 +359,7 @@ @article{durand2009mis
journal = {Journal of Geophysical Research: Earth Surface},
volume = {114},
number = {F3},
pages = {F03009},
year = {2009},
doi = {10.1029/2008JF001170}
}
Expand Down
2 changes: 1 addition & 1 deletion dual-problems.tex
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ \subsection{Verification on solvable test cases} \label{sec:linear-ice-shelf}
\begin{center}
\includegraphics[width=0.75\linewidth]{demos/convergence-tests/results.pdf}
\end{center}
\caption{Relative $L^2$-norm errors for approximate solutions to the analytical ice shelf (left) and ice stream (right) test cases using our newly-developed solver for the dual form of SSA.
\caption{Relative $L^2$-norm errors for approximate solutions to the analytical ice shelf (a) and ice stream (b) test cases using our newly-developed solver for the dual form of SSA.
The points show the error values from each experiment, the lines show a log-log fit of the errors against mesh size.
The convergence rates were obtained from this log-log fit.}
\label{fig:linear-glacier-convergence-rate}
Expand Down

0 comments on commit 472b7c8

Please sign in to comment.