This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

About the Discontinuous Galerkin method

+2 votes

Hi

I am trying to understand how to progam the Discontinuous
Galerkin method for the 2D Euler equations.

\begin{equation}
\displaystyle \frac{\partial U}{\partial t}
+ \nabla \cdot F(U) = 0.
\end{equation}

An integration by part on a triangle $T_j$ of a mesh gives

\begin{equation}
\displaystyle \int_{T_j} W \frac{\partial U}{\partial t} dx
+
\displaystyle \int_{\partial T_j interior} W \cdot F(U) \cdot n ds
\end{equation}

\begin{equation}
\displaystyle \int_{\partial T_j on boundary} W \cdot F(U) \cdot n ds
-
\displaystyle \int_{T_j} \nabla W : F(U) dx
= 0
\end{equation}

Introducing the numetical scheme $H(U^-,U^+,n)$ to compute the fluxes $F(U).n$,
I get
\begin{equation}
\displaystyle \int_{T_j} W \frac{\partial U}{\partial t} dx
+
\displaystyle \int_{\partial T_j interior} W \cdot H(U^-,U^+,n) ds
\end{equation}

\begin{equation}
+
\displaystyle \int_{\partial T_j on boundary} W \cdot F(U) \cdot n ds
-
\displaystyle \int_{T_j} \nabla W : F(U) dx
= 0
\end{equation}
where $-$ stands for "inside $T_j$", $+$ stands for "outside $T_j$"
and $n$ for the outward normal to $T_j$. $W$ is the test function vector.

A summation over all triangle $T_j$ gives
\begin{equation}
\displaystyle \int_{\Omega} W \frac{\partial U}{\partial t} dx
+
\sum_j \displaystyle \int_{\partial T_j interior} W \cdot H(U^-,U^+,n) ds
\end{equation}

\begin{equation}
+
\displaystyle \int_{\partial \Omega} W\cdot F(U) \cdot n ds
-
\displaystyle \int_{\partial \Omega} \nabla W : F(U) dx
= 0
\end{equation}

Now I am not sur how I should write the integral on interior
facets in a fenics script for an explicite euler time scheme
\begin{equation}
\sum_j \displaystyle \int_{\partial T_j interior} W \cdot H(U^-,U^+,n) ds
\end{equation}

asked Mar 16, 2014 by Thomas FEniCS Novice (150 points)
edited Mar 16, 2014 by Thomas

Do your problem solved ? I encounter the similar equations. need you repley, thanks a lot.

1 Answer

+2 votes

To my knowledge, UFL does not have integrals over element boundaries.

You may however rewrite the integral over the interior element boundaries as an integral over interior facets and assemble these in the usual way by the dS-Measure (look e.g. in the Poisson DG example how this is done exactly). Therefore, you basically need to sum up contributions from both sides and assemble them at once for each interior facet shared by two elements instead of integrating over each elements boundary.

Note that to rewrite your integrals the following well-known identity might be useful
$$ \sum_{T\in\mathcal{T}_h}\int_{\partial T} q_T \cdot n_T \phi_T\,ds=\int_\Gamma [q]\cdot \{\phi\}\,ds + \int_{\Gamma^0} \{q\}\cdot [\phi]\,ds$$
where $u_T$ is the restriction to $T$, $\Gamma$ is the union of facets and $\Gamma^0$ the union of interior facets.

The average $\{\cdot\}$ and jump $[\cdot]$ are defined according to the standard notation used e.g. in the unified analysis paper of Arnold et. al. 2002.

answered Mar 16, 2014 by Christian Waluga FEniCS Expert (12,310 points)
edited Mar 20, 2014 by Christian Waluga
...