Skip to content

Commit

Permalink
examples - update plots
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylt committed Jan 25, 2021
1 parent 316c700 commit 2ab2a6b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
13 changes: 9 additions & 4 deletions examples/jupyter/demo1_diffusion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@
"# -- 2D --\n",
"elseif dimension == 2\n",
" # compute\n",
" θ_plotting_x = zeros(numberruns)\n",
" θ_plotting_y = zeros(numberruns)\n",
" maxeigenvalues = zeros(numberruns, numberruns)\n",
"\n",
" for i in 1:numberruns, j in 1:numberruns\n",
Expand All @@ -107,14 +105,21 @@
"\n",
" # plot\n",
" println(\"max eigenvalue: \", maxeigenvalue)\n",
" xrange = θ_min/π:(θ_max - θ_min)/π/(numberruns-1):θ_max/π\n",
" heatmap(\n",
" xrange,\n",
" xlabel=\"θ/π\",\n",
" xtickfont=font(12, \"Courier\"),\n",
" xrange,\n",
" ylabel=\"θ/π\",\n",
" maxeigenvalues,\n",
" ytickfont=font(12, \"Courier\"),\n",
" title=\"Diffusion Operator Symbol\",\n",
" transpose=true,\n",
" aspect_ratio=:equal\n",
" )\n",
" xlims!(1, numberruns)\n",
" ylims!(1, numberruns)\n",
" xlims!(θ_min/π, θ_max/π)\n",
" ylims!(θ_min/π, θ_max/π)\n",
"end"
]
}
Expand Down
11 changes: 9 additions & 2 deletions examples/jupyter/demo2_jacobi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,21 @@
"\n",
" # plot\n",
" println(\"max eigenvalue: \", maxeigenvalue)\n",
" xrange = θ_min/π:(θ_max - θ_min)/π/(numberruns-1):θ_max/π\n",
" heatmap(\n",
" xrange,\n",
" xlabel=\"θ/π\",\n",
" xtickfont=font(12, \"Courier\"),\n",
" xrange,\n",
" ylabel=\"θ/π\",\n",
" ytickfont=font(12, \"Courier\"),\n",
" maxeigenvalues,\n",
" title=\"Jacobi Operator Symbol\",\n",
" transpose=true,\n",
" aspect_ratio=:equal\n",
" )\n",
" xlims!(1, numberruns)\n",
" ylims!(1, numberruns)\n",
" xlims!(θ_min/π, θ_max/π)\n",
" ylims!(θ_min/π, θ_max/π)\n",
"end"
]
}
Expand Down
13 changes: 10 additions & 3 deletions examples/jupyter/demo3_pmultigrid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# P-multigrid Example"
"# Two-grid P-multigrid Example"
]
},
{
Expand Down Expand Up @@ -122,14 +122,21 @@
"\n",
" # plot\n",
" println(\"max eigenvalue: \", maxeigenvalue)\n",
" xrange = θ_min/π:(θ_max - θ_min)/π/(numberruns-1):θ_max/π\n",
" heatmap(\n",
" xrange,\n",
" xlabel=\"θ/π\",\n",
" xtickfont=font(12, \"Courier\"),\n",
" xrange,\n",
" ylabel=\"θ/π\",\n",
" ytickfont=font(12, \"Courier\"),\n",
" maxeigenvalues,\n",
" title=\"P-Multigrid Error Symbol\",\n",
" transpose=true,\n",
" aspect_ratio=:equal\n",
" )\n",
" xlims!(1, numberruns)\n",
" ylims!(1, numberruns)\n",
" xlims!(θ_min/π, θ_max/π)\n",
" ylims!(θ_min/π, θ_max/π)\n",
"end"
]
}
Expand Down
13 changes: 10 additions & 3 deletions examples/jupyter/demo4_pmultigrid_multilevel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# P-multigrid Example"
"# Three-grid P-multigrid Example"
]
},
{
Expand Down Expand Up @@ -127,14 +127,21 @@
"\n",
" # plot\n",
" println(\"max eigenvalue: \", maxeigenvalue)\n",
" xrange = θ_min/π:(θ_max - θ_min)/π/(numberruns-1):θ_max/π\n",
" heatmap(\n",
" xrange,\n",
" xlabel=\"θ/π\",\n",
" xtickfont=font(12, \"Courier\"),\n",
" xrange,\n",
" ylabel=\"θ/π\",\n",
" ytickfont=font(12, \"Courier\"),\n",
" maxeigenvalues,\n",
" title=\"P-Multigrid Error Symbol\",\n",
" transpose=true,\n",
" aspect_ratio=:equal\n",
" )\n",
" xlims!(1, numberruns)\n",
" ylims!(1, numberruns)\n",
" xlims!(θ_min/π, θ_max/π)\n",
" ylims!(θ_min/π, θ_max/π)\n",
"end"
]
}
Expand Down

0 comments on commit 2ab2a6b

Please sign in to comment.