Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
markuswess committed Jul 29, 2024
1 parent bb911ff commit bffdeda
Show file tree
Hide file tree
Showing 20 changed files with 181 additions and 175 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions _sources/examples/basics.ipynb

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions _sources/examples/grad.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"id": "60f2ed24",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -80,14 +80,14 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"id": "5f43a2c0",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "7e38079058ea4fae9ce05e0b895c631d",
"model_id": "927ad9856179446999e231e82b3d4325",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -127,7 +127,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 5,
"id": "7cb4ebf7",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -163,14 +163,14 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 6,
"id": "e781f39d",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "cfe8e4d589ae4d228c0ed86cab6c41e8",
"model_id": "98fba7dbf06a4cad8d31efe5c07ac0a0",
"version_major": 2,
"version_minor": 0
},
Expand Down
54 changes: 40 additions & 14 deletions _sources/examples/mass_lumping.ipynb

Large diffs are not rendered by default.

31 changes: 23 additions & 8 deletions _sources/examples/qualitative_dispersion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e82c82b2961647399a75541a211de139",
"model_id": "df22ff7c698e46fdaffea99a720798a1",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -222,10 +222,25 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 11,
"id": "0c1bbb33",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "942bc202ae1f442fa1ddcdbc41de8ef8",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"WebGuiWidget(layout=Layout(height='50vh', width='100%'), value={'gui_settings': {}, 'ngsolve_version': '6.2.24…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"gfE = GridFunction(fesE)\n",
"gfH = GridFunction(fesH)\n",
Expand All @@ -235,7 +250,7 @@
"gfH.vec.data = massinvH*lffH.vec\n",
"gfE.vec.data[:] = 0.\n",
"\n",
"#scene = Draw(gfH,mesh,intpoints=dcs.GetWebGuiPoints(2),order=2,autoscale=False,min=0,max=1)\n",
"scene = Draw(gfH,mesh,intpoints=dcs.GetWebGuiPoints(2),order=2,autoscale=False,min=0,max=1)\n",
"\n",
"gfE.vec.data = tau/2*massinvE@Grad*gfH.vec"
]
Expand All @@ -250,7 +265,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 12,
"id": "06f43b80",
"metadata": {},
"outputs": [
Expand All @@ -259,7 +274,7 @@
"output_type": "stream",
"text": [
"\n",
" timesteps: 1546\t dofs: 162256\t dofs per second: 1.297550e+08\n"
" timesteps: 1546\t dofs: 162256\t dofs per second: 3.499704e+07\n"
]
}
],
Expand All @@ -283,7 +298,7 @@
" timepassed = time()-now\n",
" before_energy_time = time()\n",
" gfH_history.AddMultiDimComponent(gfH.vec)\n",
" #scene.Redraw()\n",
" scene.Redraw()\n",
" times.append(t)\n",
" tmpH.data = massH * gfH.vec\n",
" tmpE.data = massE * gfE.vec\n",
Expand All @@ -309,7 +324,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0a24c384d02746c797e7f428cc1b264b",
"model_id": "4c4f5c4aee2e474297a5b428640a49db",
"version_major": 2,
"version_minor": 0
},
Expand Down
41 changes: 9 additions & 32 deletions _sources/examples/ring_resonator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "380ed363078e4261a256c0089f317365",
"model_id": "552479b2af704bda8f748a40056203ab",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -191,7 +191,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "fc3bb36345a9407dad22d5cee49678dc",
"model_id": "4f72567959394251ac2c87d96f306d07",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -398,7 +398,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ce97a5a9fa1147e2ba0a585a56f9f769",
"model_id": "7da11b03b788477bb30469b281b1d5c0",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -445,7 +445,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "569ded9b277b43c884bbf6e454556205",
"model_id": "8ce1ee8ed69f4adea5946fa766a968bc",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -527,7 +527,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"{<ET.SEGM: 1>: <ngsolve.fem.IntegrationRule object at 0x73d874c3d7f0>, <ET.TRIG: 10>: <ngsolve.fem.IntegrationRule object at 0x73d874c3e130>, <ET.TET: 20>: <ngsolve.fem.IntegrationRule object at 0x73d874c3d970>}\n"
"{<ET.SEGM: 1>: <ngsolve.fem.IntegrationRule object at 0x78076c374830>, <ET.TRIG: 10>: <ngsolve.fem.IntegrationRule object at 0x78076c217530>, <ET.TET: 20>: <ngsolve.fem.IntegrationRule object at 0x78076c217730>}\n"
]
}
],
Expand Down Expand Up @@ -643,22 +643,7 @@
"execution_count": 15,
"id": "8f36386f",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0d1d6b03189342c58bc83585805793be",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"WebGuiWidget(layout=Layout(height='50vh', width='100%'), value={'gui_settings': {}, 'ngsolve_version': '6.2.24…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"gfu = GridFunction(fes)\n",
"gfp_history = GridFunction(fes.components[0],multidim = 0)\n",
Expand All @@ -685,15 +670,7 @@
"execution_count": 16,
"id": "95edd60c",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"t = 5.985820000000924, \t 3.902223e+07 DoFs/ssss\r"
]
}
],
"outputs": [],
"source": [
"from time import time\n",
"\n",
Expand Down Expand Up @@ -740,7 +717,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d42befb0216d40bdb0b3db9dceac42db",
"model_id": "6970d5c7b709419f94b01e4a56cb6087",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -755,7 +732,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"computed i = 11327 timesteps in 94.66788983345032 seconds with an average of 4.576177e+07 Dofs/s\n"
"computed i = 11327 timesteps in 45.03072690963745 seconds with an average of 9.620475e+07 Dofs/s\n"
]
}
],
Expand Down
67 changes: 27 additions & 40 deletions _sources/examples/waveguide_3d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0b2d77bf8b294b4d9c02b0fdd7886c05",
"model_id": "ab6268f711344ed5b8049efef1c2563a",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -219,22 +219,7 @@
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "42b2cfd58d7540daa972312b96d46387",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"WebGuiWidget(layout=Layout(height='50vh', width='100%'), value={'gui_settings': {'Objects': {'Clipping Plane':…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"#Draw solution\n",
"#scenee = Draw (gfE[1], mesh, \"E\", order=2, draw_surf=False, clipping={\"y\":1, \"z\":0},min=-0.5,max=0.5,autoscale=False,points=dcs.GetWebGuiPoints(2),settings = {\"Objects\" : {\"Clipping Plane\" : True}}, euler_angles=[-120,2,-15])\n",
Expand All @@ -247,27 +232,7 @@
"execution_count": 8,
"id": "f0b56a40",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" time = 2.133333333333392, step = 1200, 3.423778e+06 dofs/ss"
]
},
{
"ename": "KeyboardInterrupt",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"Input \u001b[0;32mIn [8]\u001b[0m, in \u001b[0;36m<cell line: 16>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 21\u001b[0m i\u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m\n\u001b[1;32m 22\u001b[0m tmpE\u001b[38;5;241m.\u001b[39mdata \u001b[38;5;241m=\u001b[39m tau\u001b[38;5;241m*\u001b[39mbf_mixed\u001b[38;5;241m.\u001b[39mT\u001b[38;5;241m*\u001b[39mgfH\u001b[38;5;241m.\u001b[39mvec\u001b[38;5;241m+\u001b[39mbfm_E\u001b[38;5;241m*\u001b[39m(gfE\u001b[38;5;241m.\u001b[39mvec\u001b[38;5;241m-\u001b[39mrhsEfunc(t))\n\u001b[0;32m---> 23\u001b[0m gfE\u001b[38;5;241m.\u001b[39mvec\u001b[38;5;241m.\u001b[39mdata \u001b[38;5;241m=\u001b[39m \u001b[43mrhsEfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[43mt\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 24\u001b[0m gfE\u001b[38;5;241m.\u001b[39mvec\u001b[38;5;241m.\u001b[39mdata \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m massE_inv\u001b[38;5;241m*\u001b[39mtmpE\n\u001b[1;32m 26\u001b[0m gfH\u001b[38;5;241m.\u001b[39mvec\u001b[38;5;241m.\u001b[39mdata \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;241m-\u001b[39mtau\u001b[38;5;241m*\u001b[39mmassH_inv\u001b[38;5;129m@bf_mixed\u001b[39m\u001b[38;5;241m*\u001b[39mgfE\u001b[38;5;241m.\u001b[39mvec\n",
"Input \u001b[0;32mIn [6]\u001b[0m, in \u001b[0;36m<lambda>\u001b[0;34m(t)\u001b[0m\n\u001b[1;32m 7\u001b[0m gfe\u001b[38;5;241m.\u001b[39mvec\u001b[38;5;241m.\u001b[39mdata \u001b[38;5;241m=\u001b[39m massE_surf_inv\u001b[38;5;241m*\u001b[39mlfr\n\u001b[1;32m 8\u001b[0m \u001b[38;5;66;03m#Draw(gfe)\u001b[39;00m\n\u001b[0;32m---> 11\u001b[0m rhsEfunc \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mlambda\u001b[39;00m t: exp(\u001b[38;5;241m-\u001b[39mc\u001b[38;5;241m*\u001b[39m(t\u001b[38;5;241m<\u001b[39mt0)\u001b[38;5;241m*\u001b[39m(t0\u001b[38;5;241m-\u001b[39mt)\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m2\u001b[39m)\u001b[38;5;241m*\u001b[39msin(omega\u001b[38;5;241m*\u001b[39mt)\u001b[38;5;241m*\u001b[39mgfe\u001b[38;5;241m.\u001b[39mvec\n\u001b[1;32m 13\u001b[0m \u001b[38;5;66;03m#visualize dirichlet data over time\u001b[39;00m\n\u001b[1;32m 14\u001b[0m ts \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39marange(\u001b[38;5;241m0\u001b[39m,\u001b[38;5;241m5\u001b[39m,\u001b[38;5;241m0.01\u001b[39m)\n",
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
]
}
],
"outputs": [],
"source": [
"from time import time\n",
"\n",
Expand Down Expand Up @@ -307,10 +272,32 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"id": "1225aeff",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"finshed with an average of 9.010176e+07 dofs/s"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a07db28ac6844810a845e72a753a07dd",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"WebGuiWidget(layout=Layout(height='50vh', width='100%'), value={'gui_settings': {'eval': 1, 'Objects': {'Clipp…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"print(\"finshed with an average of {:e} dofs/s\".format(i*fes.ndof/timepassed),end=\"\")\n",
"Draw (gfE_anim, mesh, order=2, animate = True, draw_surf=False, clipping={\"y\":1, \"z\":0},min=-0.5,max=0.5,autoscale=False,points=dcs.GetWebGuiPoints(2),settings = {\"eval\": 1, \"Objects\" : {\"Clipping Plane\" : True}}, euler_angles=[-120,2,-15]);"
Expand Down
2 changes: 1 addition & 1 deletion _sources/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This book is designed to provide an introduction and examples to the implementat

The *Dual Cell Method* (DCM) is a Galerkin Method for the simulation of time-domain waves (e.g., electromagnetic or acoustiv waves) in mixed formulation. It is a Disconitinuous Galerkin variant where the two wave-fields are approximated by conforming functions on meshes dual to each other. Thus the respective ansatz functions feature discontinuities on different element boundaries.

For a full mathematical introduction to the method we refer to {cite}`WKCS2023,KCS2021`.
For a full mathematical introduction to the method we refer to {cite}`WKCS2023,KCS2021` and to {cite}`CKSW2024_waves` for a shorter read.

---

Expand Down
14 changes: 7 additions & 7 deletions examples/basics.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/grad.html

Large diffs are not rendered by default.

Loading

0 comments on commit bffdeda

Please sign in to comment.