Skip to content

Commit d65646c

Browse files
committed
Use modules in notebook
1 parent 8af6379 commit d65646c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

notebooks/rainier-monolithic.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"metadata": {},
88
"outputs": [],
99
"source": [
10-
"import tqdm\n",
10+
"from tqdm.notebook import trange\n",
1111
"import numpy as np\n",
1212
"from numpy import pi as π\n",
1313
"import matplotlib.pyplot as plt\n",
@@ -381,9 +381,9 @@
381381
"v, N, σ = firedrake.TestFunctions(Z)\n",
382382
"\n",
383383
"fns = [\n",
384-
" (model.VariationalForm.flow_law, N),\n",
385-
" (model.VariationalForm.friction_law, σ),\n",
386-
" (model.VariationalForm.momentum_balance, v),\n",
384+
" (model.variational.flow_law, N),\n",
385+
" (model.variational.friction_law, σ),\n",
386+
" (model.variational.momentum_balance, v),\n",
387387
"]"
388388
]
389389
},
@@ -550,7 +550,7 @@
550550
"w.sub(0).assign(u_init)\n",
551551
"w.sub(1).assign(M_init)\n",
552552
"w.sub(2).assign(τ_init)\n",
553-
"w.sub(3).assign(h)"
553+
"w.sub(3).assign(h);"
554554
]
555555
},
556556
{
@@ -572,9 +572,9 @@
572572
"v, N, σ, η = firedrake.TestFunctions(W)\n",
573573
"\n",
574574
"fns = [\n",
575-
" (model.VariationalForm.flow_law, N),\n",
576-
" (model.VariationalForm.friction_law, σ),\n",
577-
" (model.VariationalForm.momentum_balance, v),\n",
575+
" (model.variational.flow_law, N),\n",
576+
" (model.variational.friction_law, σ),\n",
577+
" (model.variational.momentum_balance, v),\n",
578578
"]\n",
579579
"\n",
580580
"fields = {\n",
@@ -588,7 +588,7 @@
588588
"terms = [fn(**fields, **rheology, test_function=ϕ) for fn, ϕ in fns]\n",
589589
"terms[0] = firedrake.replace(terms[0], {h: H})\n",
590590
"F_momentum = sum(terms)\n",
591-
"F_mass = model.VariationalForm.mass_balance(thickness=h, velocity=u, accumulation=a, test_function=η)\n",
591+
"F_mass = model.mass_balance(thickness=h, velocity=u, accumulation=a, test_function=η)\n",
592592
"\n",
593593
"F = F_momentum + F_mass"
594594
]
@@ -626,7 +626,7 @@
626626
"\n",
627627
"final_time = 500.0\n",
628628
"num_steps = int(final_time / float(dt))\n",
629-
"for step in tqdm.trange(num_steps):\n",
629+
"for step in trange(num_steps):\n",
630630
" solver.advance()\n",
631631
" h = w.subfunctions[3]\n",
632632
" w.subfunctions[3].interpolate(max_value(0, h))\n",

0 commit comments

Comments
 (0)