Skip to content

Commit 186494b

Browse files
committed
pbm formulation
1 parent 29cc8e1 commit 186494b

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ usr
1919
.env
2020
.iga-python
2121
*_autosummary*
22+
23+
.DS_Store

exercises/harmonic-feec.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,7 @@
264264
]
265265
}
266266
],
267-
"metadata": {
268-
"language_info": {
269-
"name": "python"
270-
}
271-
},
267+
"metadata": {},
272268
"nbformat": 4,
273269
"nbformat_minor": 5
274270
}

exercises/harmonic-fem.ipynb

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
"source": [
88
"# Harmonic fields with H1 fem spaces\n",
99
"\n",
10-
"In this example we .... consider the vector Poisson equation with homogeneous Dirichlet boundary conditions:\n",
10+
"In this exercise we consider the following vector problem with homogeneous boundary conditions in H(curl):\n",
1111
"\n",
1212
"$$\n",
1313
"\\begin{align}\n",
14-
" - \\nabla^2 \\mathbf{u} = \\mathbf{f} \\quad \\mbox{in} ~ \\Omega, \\quad \\quad \n",
15-
" \\mathbf{u} = 0 \\quad \\mbox{on} ~ \\partial \\Omega.\n",
14+
" \\nabla \\times \\mathbf{u} = 0 \\quad \\mbox{in} ~ \\Omega \\\\\n",
15+
" \\nabla \\cdot \\mathbf{u} = 0 \\quad \\mbox{in} ~ \\Omega \\\\\n",
16+
" \\mathbf{n} \\times \\mathbf{u} = 0 \\quad \\mbox{on} ~ \\partial \\Omega.\n",
1617
"\\end{align}\n",
1718
"$$\n",
1819
"\n",
@@ -23,15 +24,24 @@
2324
"$$\n",
2425
"\\begin{align}\n",
2526
" \\text{find $\\mathbf{u} \\in V$ such that} \\quad \n",
26-
" a(\\mathbf{u},\\mathbf{v}) = l(\\mathbf{v}) \\quad \\forall \\mathbf{v} \\in V,\n",
27+
" a(\\mathbf{u},\\mathbf{v}) = 0 \\quad \\forall \\mathbf{v} \\in V,\n",
2728
"\\end{align}\n",
2829
"$$\n",
2930
"\n",
3031
"where \n",
3132
"\n",
32-
"- $V \\subset \\mathbf{H}_0^1(\\Omega)$, \n",
33-
"- $a(\\mathbf{u},\\mathbf{v}) := \\int_{\\Omega} \\nabla \\mathbf{u} : \\nabla \\mathbf{v} ~ d\\Omega$,\n",
34-
"- $l(\\mathbf{v}) := \\int_{\\Omega} \\mathbf{f} \\cdot \\mathbf{v} ~ d\\Omega$."
33+
"- $V \\subset (\\mathbf{H}^1(\\Omega))^2$, \n",
34+
"- $a := a_{\\rm curl} + a_{\\rm div} + a_{\\rm bc}$\n",
35+
"- $a_{\\rm curl}(\\mathbf{u},\\mathbf{v}) = \\int_{\\Omega} (\\nabla \\times \\mathbf{u}) \\cdot (\\nabla \\times \\mathbf{v})$,\n",
36+
"- $a_{\\rm div}(\\mathbf{u},\\mathbf{v}) = \\int_{\\Omega} (\\nabla \\cdot \\mathbf{u}) (\\nabla \\cdot \\mathbf{v})$,\n",
37+
"- $a_{\\rm bc}(\\mathbf{u},\\mathbf{v}) = \\kappa \\int_{\\partial\\Omega} (\\mathbf{n} \\times \\mathbf{u}) \\cdot (\\mathbf{n} \\times \\mathbf{v})$.\n",
38+
"\n",
39+
"with $\\kappa$ a large penalization constant.\n",
40+
"\n",
41+
"The exercise is to assemble the matrix of $a$ and compute the first eigenmode using scipy.\n",
42+
"\n",
43+
"The same problem will be addressed in another notebook with structure preserving finite elements, where the solution will only be in H(curl)\n",
44+
"and the divergence-free equation will only be imposed in a weak sense.\n"
3545
]
3646
},
3747
{
@@ -264,11 +274,7 @@
264274
]
265275
}
266276
],
267-
"metadata": {
268-
"language_info": {
269-
"name": "python"
270-
}
271-
},
277+
"metadata": {},
272278
"nbformat": 4,
273279
"nbformat_minor": 5
274280
}

0 commit comments

Comments
 (0)