2

I'm facing an "assembly issue" concerning a finite element method, that is a DG method, I was working on. I'll sum up my problem.

If we consider a $\mathbb{P}^1$ Lagrangian piece-wise discretization $\mathcal{T}_h$ (with finite element denoted $T_i$) of a domain $\Omega \subset \mathbb{R}^2$. Let $span\{\Phi_{i,j}, 1 \leq j \leq 3\}$ be the space of shape functions, $3$ is the number of degrees of freedom over $T_i$. Thus, a solution $u$ would be expressed in function of each $\Phi_i$ over every $T_i$ such that, $u_i = \sum_{1 \leq j \leq 3} u_{ij}\Phi_{ij}$

Then, how do you compute the following expressions $M_{ij} = \int_{T_i} \Phi_i \Phi_j$ and $B_{ij} = \int_{T_i} \Phi_i \times \Phi_j$ with $1 \leq i, j \leq n_T$ where $n_T$ is the number of triangular mesh elements. $M, B$ being any local matrices.

I'd go for : Expressing $\Phi_i$ as a first order polynomial $\Phi_i = ax + by + c$ and the same for $\Phi_j$ but how do you compute numerically the integration over $T_i$ ?

Additional question : Does a change of coordinate affects local matrices ? i.e DO we need to rewrite the matrices when we perform a change of coordinate

Thanks.

P.S : Sorry for the unrelated tag but I couldn't add something else, the display went wrong.

Amzocks
  • 243
  • Are you looking for suitable Gauss points in the triangle? E.g. as described here? – ccorn Jul 24 '13 at 10:05
  • I'm actually looking for the expression of local matrices with ddf on the vertices. – Amzocks Jul 24 '13 at 12:03
  • 1
    You can either (a) use an affine transformation to map the integration to reference element, or (b) use the barycentric coordinates of the vertices to represent a $P^1$ polynomial $\sum_{i=1}^3 a_i\lambda_i$, not $ax+by+c$. – Shuhao Cao Jul 26 '13 at 15:22
  • Alright, but how do you compute the local matrices for the reference element ? – Amzocks Jul 29 '13 at 08:20

1 Answers1

1

This answer is to extend my comment above as a full answer.

The basis function of the linear Lagrangian finite element $\mathbb{P}^1$, happens to the barycentric coorinates for the triangle of interest, say $T$ in your case. $\Phi_{j} = 1$ on the $j$-th vertex of $T_i$ ($j=1,2,3$ is the local index of the vertex). Then a widely-cited article in finite element community is On finite element integration in natural co-ordinates. It is behind a paywall unfortunately, so here I reproduce the formula as follows:

For an interval $I$, $\Phi_j$ was the nodal basis ($1$ on the $j$-th node, $0$ on the other), then: $$ \int_I \Phi_1^a \,\Phi_2^b \,dx = \frac{a!\,b!}{(a + b + 1)!} |I|. $$

For a triangle $T$, $\Phi_j$ was the nodal basis for $j$-th vertex, then: $$ \int_T \Phi_1^a \,\Phi_2^b\, \Phi_3^c\, dA = \frac{a!\,b!\,c!}{(a + b + c + 2)!} 2!|T|. $$

For a tetrahedron $V$, $\Phi_j$ was the nodal basis for $j$-th vertex, then: $$ \int_V \Phi_1^a \,\Phi_2^b \,\Phi_3^c \,\Phi_4^d \, dV = \frac{a! \, b! \, c! \, d!}{(a + b + c + d + 3)!} 3!|V|. $$ You can go on and on, which can be generalized to $n$-simplex.

In your case
$$ \int_T \Phi_i \,\Phi_j = \frac{|T|}{12}(1+\delta_{ij}),\tag{1} $$ where $\delta_{ij}$ is the Kroncker delta.

Notice $\Phi_i$ and $\Phi_j$ are scalars, so the cross product (exterior product), $\Phi_j\times \Phi_i$, is just scalar product. Unless what you mean is: $$ \int_T \nabla \Phi_i \times \nabla \Phi_j \quad \text{ or } \int_T \begin{pmatrix} \Phi_i \\ \Phi_j\end{pmatrix}\times \begin{pmatrix} \Phi_m \\ \Phi_n\end{pmatrix}. $$ If it is the latter then just apply the wedge product formula for a 2 dimensional vector, and exploit formula (1) for each term.

If it is the former, which is the wedge product (cross product) of the gradient of each nodal basis. Firstly $$\nabla \Phi_i = -\frac{\mathbf{n}_i}{h_i} =-\frac{|\mathbf{e}_i|\mathbf{n}_i}{2|T|}, $$ where $h_i$ is the height on the edge $\mathbf{e}_i$ opposite to the $i$-th vertex in this triangle, and $\mathbf{n}_i$ is the unit vector normal to the edge $e_i$, pointing outward from the triangle. Hence $$ \nabla \Phi_i \times \nabla \Phi_j = \frac{|\mathbf{e}_i|\mathbf{n}_i}{2|T|}\times \frac{|\mathbf{e}_j|\mathbf{n}_j}{2|T|} = \frac{1}{4|T|^2} {\mathbf{e}_i\times \mathbf{e}_j}. $$ This is done by rotating each vector in $ |\mathbf{e}_i|\mathbf{n}_i\times |\mathbf{e}_j|\mathbf{n}_j$ by $\pi/2$. Now $\mathbf{e}_i\times \mathbf{e}_j$ just produces the area times $2$ (Why? one way to think of this is the 3D cross product formula). Hence $$ \int_T \nabla \Phi_i \times \nabla \Phi_j = \frac{1}{2}. $$

Shuhao Cao
  • 18,935
  • Thanks a lot for this detailed answer. However I didn't get everything : Where do the integral expressions come from ? (i.e $\int_T \Phi_1^a ,\Phi_2^b, \Phi_3^c, dA = \frac{a!,b!,c!}{(a + b + c + 2)!} 2!|T|$) Moreover what do you mean by "$h_i$ the height on the edge $e_i$" ? What is $h_i$ ? And does $|e_i|$ stand for the length of the opposite edge of the $i^{th}$ vertex ? Further, if you consider $\int_T \Phi_i(x, y) \Phi_j(x, y) c(x, y)$, how could you deal with this function $c$, a decomposition into the $\Phi$ basis ? Then, how would you treat something simple like $c(x, y) = x$ ? – Amzocks Jul 30 '13 at 08:37
  • @Amzocks Use one edge $\mathbf{e}_i$ as base, $h_i$ is the height on that base. Yes, $|\mathbf{e}_i|$ stands for the length of the edge. For $\mathbb{P}^1$, $c$ can be treated like a piecewise constant, you can compute the average $\bar{c}$ of $c$ at a specific $T$, then use $\bar{c}$, for higher order elements you have to use quadrature. I suggest go reading the finite element section of Thomee and Larsson for some quick references. – Shuhao Cao Jul 30 '13 at 13:11