Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
markuswess committed Jun 14, 2024
1 parent cc76fea commit 3752987
Show file tree
Hide file tree
Showing 47 changed files with 1,413 additions and 2,950 deletions.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/fdtd_2d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/primal_dual_quad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/stokes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/stokes_disc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
147 changes: 109 additions & 38 deletions _sources/examples/qualitative_dispersion.ipynb

Large diffs are not rendered by default.

113 changes: 60 additions & 53 deletions _sources/examples/ring_resonator.ipynb

Large diffs are not rendered by default.

45 changes: 0 additions & 45 deletions _sources/first_steps.md

This file was deleted.

1 change: 0 additions & 1 deletion _sources/introduction.md

This file was deleted.

34 changes: 32 additions & 2 deletions _sources/maxwell.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
(maxwell)=
## The dual cell method for the time-domain Maxwell system
# The dual cell method for the time-domain Maxwell system

In this section we describe in detail how the dual cell method is applied to the time-domain Maxwell equations
In this section we describe in detail how the dual cell method is applied to the time-domain Maxwell equations.

## Problem setting

The time-domain Maxwell system (we neglect possible sources here) is the problem to find fields $\mathbf D,\mathbf B,\mathbf H,\mathbf E$ such that
```{card}
\begin{align*}
\partial_t \mathbf{D}(t,\mathbf{x})-\mathrm{curl}\mathbf{H}(t,\mathbf{x})&=0,\\
\partial_t \mathbf{B}(t,\mathbf{x})+\mathrm{curl}\mathbf{E}(t,\mathbf{x})&=0.\\
&+\text{b.c., i.c.,}
\end{align*}
```
for $t\in(0,T),\mathbf x\in\Omega$ and some $T>0$ and a suitable domain $\Omega\subset\mathbb R^3$.
To close the system one also needs the constitutive relations
```{card}
\begin{align*}
\mathbf{D} &= {\color{emph1}\varepsilon}\mathbf{E},&
\mathbf{B} &= {\color{emph2}\mu}\mathbf{H},
\end{align*}
```
where $\varepsilon,\mu$ are the **permittivity** and **permeability** of the medium in question.

In weak (EH-)formulation, assuming homogeneous boundary conditions $\mathbf E \times \mathbf n = 0$, the above problem may be rewritten as the problem to find $\mathbf E,\mathbf H:[0,T]\to H(\mathrm{curl})(\Omega)$ such that
```{card}
\begin{align*}
\int_\Omega\varepsilon \partial_t \mathbf{E}(t,\mathbf{x})\mathbf E'(\mathbf x)d\mathbf x-\int_\Omega\mathrm{curl}\mathbf{H}(t,\mathbf{x})\mathbf E'(\mathbf x)d\mathbf x&=0,\\
\int_\Omega\mu\partial_t \mathbf{H}(t,\mathbf{x})\mathbf H'(\mathbf x)d\mathbf x+\int_\Omega\mathbf{E}(t,\mathbf{x})\mathrm{curl}\mathbf H'(\mathbf x)d\mathbf x&=0.\\
&+\text{i.c.,}
\end{align*}
```
for all $\mathbf E',\mathbf H'\in H(\mathrm{curl})(\Omega)$.
9 changes: 9 additions & 0 deletions _sources/maxwell/basic_ideas.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(introduction)=
# Introduction

## State of the art




## From FDTD to the dual cell method
3 changes: 2 additions & 1 deletion _sources/maxwell/hcurl.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
(spaces)=
## Construction of discrete spaces on dual cells
# Construction of discrete spaces on dual cells

137 changes: 137 additions & 0 deletions _sources/maxwell/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
(introduction)=
# Introduction

When solving time-domain wave-type problems using a [method of lines](https://en.wikipedia.org/wiki/Method_of_lines) approach one typically has the choice between *implicit* and *explicit* methods. For the former in each time-step the inverse of a system matrix composed of the mass matrix and the discrete differential operator has to be applied. Although such schemes are typically unconditionally stable (independent of the choice of the time-step) the factorization of a large matrix does not scale well for very large numbers of degrees of freedom.

For explicit methods, on the other hand in each time-step merely the inverse mass matrix has to be applied. There exist several methods to make the mass matrix as convenient for inversion as possible. The downside of explicit methods is the fact that their stability depends on the quality of the discretization, i.e., the finer the discretization, the finer is the largest admissible time-step that guarantees stability.


## Reasons for explicit methods

Apart from the obvious better scaling for very large applications, explicit time-domain solvers are also interesting for frequency-domain applications:

### scattering type problems
* time-domain solvers for Helmholtz (2020s e.g., {cite}`AGFR`)
* time-domain preconditioners (2020s, e.g., {cite}`Stolk` )

### resonance type problems
* explicit eigenvalue solvers lite PINVIT, LOBPCG (early 2000s, e.g., {cite}`Knyazev` )
* time-domain filters for eigenvalue problems (very recent {cite}`nw24`)

## State of the art

The most popular explicit methods are

```{card}
Finite Difference Time Domain (FDTD) Methods
^^^^
* 2e5 hits on Google scholar, 1.2e4 since 2022
* low order
* only hexahedral grids
```

```{card}
Discontinuous Galerkin (DG) Methods
^^^^
* 1.5e4 hits on Google scholar, 1.6e3 since 2022
* high order
* necessary choice of numerical fluxes, penalty parameter
```

While both of these methods have been around since the late 1960's and early 1970's FDTD is still most widely used in engineering applications.

## From FDTD to the dual cell method

The main idea of the FDTD methods is the discretization of Stokes' theorem.

```{figure} ../images/stokes.png
---
height: 400px
name: stokes
---
A visualization of Stokes' theorem.
```
This leads to discrete quantities on interlaced hexahedral grids.

```{figure} ../images/stokes_disc.png
---
height: 400px
name: stokes
---
Discrete, pointwise approximations mimmicking Stokes' theorem.
```
$h^l_{i,j,k},e^l_{i,j,k}$ are point values of the fields at points $(x_i,y_j,z_k)$ (tangential to the staggered grid) at timestep number $l$ and satisfy
```{math}
\partial_t h_{i+\tfrac{1}{2},j+\tfrac{1}{2},k}&\approx e_{i+\tfrac{1}{2},j,k}-e_{i+1,j+\tfrac{1}{2},k}-e_{i+\tfrac{1}{2},j+1,k}+e_{i,j+\tfrac{1}{2},k}\\
\partial_t e_{i+\tfrac{1}{2},j+\tfrac{1}{2},k}&\approx h_{i+\tfrac{1}{2},j+\tfrac{1}{2},k}-h_{i,j+\tfrac{1}{2},k+\tfrac{1}{2}}-h_{i-\tfrac{1}{2},j+\tfrac{1}{2},k}-h_{i,j+\tfrac{1}{2},k-\tfrac{1}{2}}
```
The time discretization is done using a [Leap-Frog](https://en.wikipedia.org/wiki/Leapfrog_integration) time-stepping with time-step size $\tau$,
```{math}
\partial_t h^{l}_{i,j,k}\approx \frac{h_{i,j,k}^{l+\tfrac{1}{2}}-h_{i,j,k}^{l-\tfrac{1}{2}}}{\tau},\quad\quad\quad\partial_t e^{l+\tfrac{1}{2}}_{i,j,k}\approx \frac{e_{i,j,k}^{l+1}-e_{i,j,k}^{l}}{\tau}
```
which carries the idea of the interlaced grid to time-domain.

```{card}
Goal of the dual cell method
^^^^
generalize FDTD to
* high order Galerkin method
* on general (tetrahedral) grids
```

## Basic idea of the dual cell construction

For motivation of the construction of the basis functions and spaces we start by focussing on the two dimensional problem.


```{figure} ../images/fdtd_2d.png
---
height: 400px
name: stokes
---
Going to two dimensions.
```

### Galerkin setting and high order spaces

Interpreting the scalar point values (orange circles) as piecewise constant basis functions on each element $\mathbf C$ (dark grey, consisting of four cells) we may proceed from a finite difference setting, to a Galerkin setting.

For the vectorial unknowns the degrees of freedom are the inner tangential components between two neighbouring cells. The respective basis functions are tangentially continuous on each dual element $\tilde {\mathbf C}$ (again consisting of four cells).


```{figure} ../images/primal_dual_quad.png
---
height: 400px
name: stokes
---
primal and dual quad-meshes
```

Thus if the primal and dual elements are given by
```{math}
\mathbf C_j&=\bigcup_{k=0}^3 C_{k(j)}\in\mathcal C\\
\tilde {\mathbf C}_j&=\bigcup_{k=0}^3 C_{\tilde k(j)} \in \tilde{\mathcal C},
```
we may define the local high order spaces
```{math}
\mathcal W_{\mathbf C_j} &= \{H: \mathbf C_j\to \mathbb R : H|_{C_{k(j)}}\in Q^p\quad\forall k, H \text{ is cont.}\}, \\
\mathcal V_{\tilde{\mathbf C}_j} &= \{E: \tilde{\mathbf C}_j\to \mathbb R^2 : E|_{C_{\tilde k(j)}}\in \left(Q^p\right)^2\quad\forall \tilde k, E\cdot\tau \text{ is cont.}\}.
```
The global spaces are then given by $\mathcal W = \bigcup_{\mathbf C\in \mathcal C}\mathcal W_{\mathbf C}$, $\mathcal V = \bigcup_{\tilde{\mathbf C}\in \tilde{\mathcal C}}\mathcal W_{\tilde{\mathbf C}}$ where the basis functions are set to zero outside of their original domain.

Using these spaces we may pose the semi-discrete (ultra) weak form to find $\mathbf E :[0,T]\to\mathcal V$, $H:[0,T]\to\mathcal W$ such that

````{card}
```{math}
\partial_t \left(\varepsilon\mathbf{E},\hat{\mathbf{E}}\right)_{L^2(\Omega)}
-\sum_{{\mathbf C}\in{\mathcal C}}\left(\mathrm{rot} H,\hat{\mathbf{E}}\right)_{L^2({\mathbf C})}+\left(H,\hat{\mathbf{E}}\cdot\tau\right)_{L^2(\partial{\mathbf C})}=0,\quad \forall \hat {\mathbf{E}}\in\mathcal V\\
\partial_t \left(\mu H,\hat H\right)_{L^2(\Omega)}+\sum_{{\mathbf C}\in{\mathcal C}}\left(\mathbf{E},\mathrm{rot} \hat H\right)_{L^2({\mathbf C})}-\left(\mathbf{E}\cdot\tau,\hat H\right)_{L^2(\partial{\mathbf C})}=0,\quad \forall \hat H\in\mathcal W.
```
````

This variational formulation has the following remarkable features:
* The boundary terms arise due to the fact that our discrete spaces have discontinuities on the boundaries of the primal/dual elements respectively. However differing from DG methods across each element boundary one of the fields is (tangentially) continuous.
* We used integration by parts to only have boundary terms on the primal elements in the formulation which helps with implementation.
* Due to skew-symmetry we immediately obtain energy conservation of the semi-discrete system.

It remains to construct a high-order basis (on simplexes) for these spaces. This will be done in the following section.
11 changes: 0 additions & 11 deletions _sources/maxwell/problem_setting.md

This file was deleted.

1 change: 0 additions & 1 deletion _sources/test.md

This file was deleted.

3 changes: 0 additions & 3 deletions _sources/test/test.md

This file was deleted.

Binary file removed _static/dofs_hcurldual_1.pdf
Binary file not shown.
Loading

0 comments on commit 3752987

Please sign in to comment.