Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JSchoeberl committed May 13, 2024
1 parent d0e5a41 commit 41b8895
Show file tree
Hide file tree
Showing 12 changed files with 232 additions and 309 deletions.
260 changes: 130 additions & 130 deletions MPIparallel/paralleliteration.html

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions _sources/MPIparallel/paralleliteration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@
"source": [
"c.shutdown(hub=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6defb2f8-1a74-4f3e-a2ae-09ef1828406d",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
16 changes: 8 additions & 8 deletions _sources/aposteriori/equilibrated.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@
"The lower bound depends on the shape of elements and the coefficient $\\lambda$, but is robust with respect to the polynomial order $k$.\n",
"\n",
"The main idea is the following: Instead of calculating the $H^{-1}$-norm of $r$, we compute a lifting $\\sigma^\\Delta$ such that $\\operatorname{div} \\sigma^\\Delta = r$, and calculate the $L_2$-norm of $\\sigma^\\Delta$. Since $r$ is not a regular function, the equation must be posed in distributional form:\n",
"\n",
"$$\n",
"\\int_\\Omega \\sigma^\\Delta \\cdot \\nabla \\varphi = - r(\\varphi) \\qquad \\forall \\, \\varphi \\in V\n",
"$$\n",
"Then, the residual can be estimated without envolving any generic constant:\n",
"\n",
"\\begin{eqnarray*}\n",
"\\| r \\|_{A^\\ast} & = & \\sup_{v \\in V} \\frac{r(v)}{\\| v \\|_A} = \\sup_v \\frac{\\int \\sigma^\\Delta \\cdot \\nabla v }{\\|v \\|_A} \\\\\n",
"&= & \\sup_v \\frac{\\int \\lambda^{-1/2} \\sigma^\\Delta \\cdot \\lambda^{1/2} \\nabla v }{\\|v \\|_A}\n",
Expand Down Expand Up @@ -215,11 +217,10 @@
"r2 = MoveTo(0.6,0.6).Rectangle(0.2,0.2).Face()\n",
"r2.faces.name='source'\n",
"\n",
"# r1 -= r2\n",
"# shape = Glue( [r1,r2] )\n",
"shape = r1\n",
"mesh = Mesh(OCCGeometry(shape,dim=2).GenerateMesh(maxh=0.1))\n",
"r1 -= r2\n",
"shape = Glue( [r1,r2] )\n",
"\n",
"mesh = Mesh(OCCGeometry(shape,dim=2).GenerateMesh(maxh=0.1))\n",
"Draw (mesh);"
]
},
Expand All @@ -237,8 +238,7 @@
"u,v = fes.TnT()\n",
"\n",
"a = BilinearForm(grad(u)*grad(v)*dx).Assemble()\n",
"# source = mesh.MaterialCF( { \"source\" : 1 }, default=1 )\n",
"source = x*y\n",
"source = mesh.MaterialCF( { \"source\" : x*y }, default=0 )\n",
"f = LinearForm(source*v*dx).Assemble()\n",
"\n",
"gfu = GridFunction(fes, name=\"solution\")\n",
Expand Down Expand Up @@ -285,8 +285,8 @@
"n = specialcf.normal(mesh.dim)\n",
"bfequ = (tau*sigma + w*div(tau) + v*div(sigma) + w*mu + lam*v) * dx \n",
"bfequ += (-sigma*n*vf-tau*n*wf)*dx(element_boundary=True) \n",
"bfequ += (-1e10*wf.Trace()*vf.Trace())*ds(definedon=dirichlet) # penalty for Dirichlet\n",
"bfequ += (-1e10*mu*lam)*ds(definedon=dirichlet) # no equilibration condition at Dir bnd\n",
"bfequ += (-1e10*wf.Trace()*vf.Trace())*ds(definedon=mesh.Boundaries(dirichlet)) # penalty for Dirichlet\n",
"bfequ += (-1e10*mu*lam)*ds(definedon=mesh.Boundaries(dirichlet)) # no constraint at Dir bnd\n",
"\n",
"# the residual: element-term + edge term:\n",
"lfequ = (source+Trace(gfu.Operator(\"hesse\")))*v*dx \n",
Expand Down
57 changes: 29 additions & 28 deletions _sources/secondorder/erroranalysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@
"\n",
"$$\n",
"\\int (\\sigma - I_h \\sigma) \\tau_h + \n",
"\\int \\underbrace{(I - P_h) \\opdiv \\sigma}_{\\in V_h^\\ast} \\;\\underbrace{ q_h}_{\\in V_h} + \\int \\underbrace{ \\opdiv \\tau_h}_{\\in V_h} \\, \\underbrace{ (u-P_h u) }_{\\in V_h^\\ast}\n",
"\\int \\underbrace{(I - P_h) \\opdiv \\sigma}_{\\in V_h^\\bot} \\;\\underbrace{ q_h}_{\\in V_h} + \\int \\underbrace{ \\opdiv \\tau_h}_{\\in V_h} \\, \\underbrace{ (u-P_h u) }_{\\in V_h^\\bot}\n",
"$$\n",
"\n",
"Thanks to orthogonality, the second and third term vanish !\n",
"\n",
"Thus, we get the error estimate \n",
"\n",
"$$\n",
"\\| \\sigma_h - I_h \\sigma \\|_{H(\\opdiv)} + \\| u_h - P_h u \\|_{L_2}\n",
"\\preceq \\sup_{\\tau_h} \\frac{ \\int (\\sigma - I_h \\sigma) \\tau_h} { \\| \\tau_h \\|_{H(\\opdiv)}} \\leq \\| \\sigma - I_h \\sigma \\|_{L_2}\n",
Expand All @@ -75,32 +76,6 @@
"The flux error is as good as we can interpolate into the flux space. Since the finite element space for $u_h$ is of lower order, the error $u - u_h$ is in general of lower order. But, the filtered error $\\| u_h - P_h u_h \\|$ has the better order."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Local post-processing\n",
"\n",
"Since $\\nabla u = \\lambda^{-1} \\sigma$, we can reconstruct a better approximation $\\widetilde u$ by small, element-wise problems:\n",
"\n",
"$$\n",
"\\widetilde u = \\operatorname{arg}\\min_{v_h \\in P^{k+1} \\atop \\int_T v_h = \\int_T u_h} \\| \\lambda \\nabla v_h -  \\sigma \\|_{L_2, \\lambda^{-1}}^2\n",
"$$\n",
"\n",
"This optimization problems can be written as a mixed variational problem:\n",
"\n",
"Find: $\\widetilde u \\in P^{k+1,dc}$ and $p_h \\in P^0$:\n",
"\n",
"$$\n",
"\\begin{array}{ccccll}\n",
"\\sum_T \\int_T \\lambda \\nabla \\widetilde u \\nabla \\widetilde v \n",
"& + & \\int_{\\Omega} \\widetilde v_h p_h & = & \\sum_T \\int_T \\sigma_h \\nabla \\widetilde v_h & \\forall \\, \\widetilde v_h \\\\\n",
"\\int_{\\Omega} \\widetilde u_h q_h & & & = & \\int_{\\Omega} u_h q_h & \n",
"\\forall q_h\n",
"\\end{array}\n",
"$$"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -161,7 +136,33 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now do the postprocessing. This requires to solve decoupled problems on every element, what is cheap."
"## Local post-processing\n",
"\n",
"Since $\\nabla u = \\lambda^{-1} \\sigma$, we can reconstruct a better approximation $\\widetilde u$ by small, element-wise problems:\n",
"\n",
"$$\n",
"\\widetilde u = \\operatorname{arg}\\min_{v_h \\in P^{k+1} \\atop \\int_T v_h = \\int_T u_h} \\| \\lambda \\nabla v_h -  \\sigma \\|_{L_2, \\lambda^{-1}}^2\n",
"$$\n",
"\n",
"This optimization problems can be written as a mixed variational problem:\n",
"\n",
"Find: $\\widetilde u \\in P^{k+1,dc}$ and $p_h \\in P^0$:\n",
"\n",
"$$\n",
"\\begin{array}{ccccll}\n",
"\\sum_T \\int_T \\lambda \\nabla \\widetilde u \\nabla \\widetilde v \n",
"& + & \\int_{\\Omega} \\widetilde v_h p_h & = & \\sum_T \\int_T \\sigma_h \\nabla \\widetilde v_h & \\forall \\, \\widetilde v_h \\\\\n",
"\\int_{\\Omega} \\widetilde u_h q_h & & & = & \\int_{\\Omega} u_h q_h & \n",
"\\forall q_h\n",
"\\end{array}\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This requires to solve decoupled problems on every element, what is cheap."
]
},
{
Expand Down
1 change: 1 addition & 0 deletions _sources/secondorder/finiteelements.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"It has dimension 6. We need two functionals per edge to define the normal component.\n",
"\n",
"The $BDM_k$ elements are defined as\n",
"\n",
"$$\n",
"V_T = [P^k]^2\n",
"$$\n",
Expand Down
33 changes: 16 additions & 17 deletions aposteriori/equilibrated.html

Large diffs are not rendered by default.

44 changes: 0 additions & 44 deletions reports/timedependent/waves/ringresonator.err.log

This file was deleted.

44 changes: 0 additions & 44 deletions reports/timedependent/waves/wave-leapfrogDG.err.log

This file was deleted.

2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

57 changes: 29 additions & 28 deletions secondorder/erroranalysis.html

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions secondorder/finiteelements.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion timedependent/waves/wave-leapfrogDG.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<link rel="stylesheet" type="text/css" href="../../_static/styles/sphinx-book-theme.css?v=384b581d" />
<link rel="stylesheet" type="text/css" href="../../_static/togglebutton.css?v=13237357" />
<link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../../_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css?v=be8a1c11" />
<link rel="stylesheet" type="text/css" href="../../_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css" />
<link rel="stylesheet" type="text/css" href="../../_static/sphinx-thebe.css?v=4fa983c6" />
<link rel="stylesheet" type="text/css" href="../../_static/design-style.1e8bd061cd6da7fc9cf755528e8ffc24.min.css?v=0a3b3ea7" />

Expand Down

0 comments on commit 41b8895

Please sign in to comment.