Skip to main content
Tweeted twitter.com/StackSciComp/status/1148245481115574272
Improve writing
Source Link
nicoguaro
  • 8.6k
  • 6
  • 26
  • 51

I got stuck with Hestaven/Warburton's dG-FEM matlabMatlab code. Starting with the file AdvecRHS1D.m

 , we see in line 11

du(:) = (u(vmapM)-u(vmapP)).*(a*nx(:)-(1-alpha)*abs(a*nx(:)))/2;

which calculates the jump $[u]$ between adjacent elements and multiplies it with some factor, giving

$$du=[u]\frac{an-(1-\alpha)|an|}{2}=[u]a\frac{n-(1-\alpha)}{2}, n\in \{-1,1\},\\ a>,\ 1\geq\alpha\geq 0$$

which looks very similar to the numerical flux described as

$$(au)^*=\{\{u\}\} + a\frac{1-\alpha}{2}[u]$$ if

if we leave out the average $\{\{u\}\}$. Yet these terms are obviously not the same. Then

Then, for the computation of the right hand side of the PDE, this happens:

rhsu = -a*rx.*(Dr*u) + LIFT*(Fscale.*(du));
rhsu = -a*rx.*(Dr*u) + LIFT*(Fscale.*(du));

which is supposed to calculate the integral

$$\left[l^k(x)(au^k_h) - (au)^* \right]_{x_l^k}^{x_r^k} = \oint_{\delta D^k}\hat{n}(au_h - (au)^*)l_i(r)$$

But i dontI don't understand how this line of code is expressing this.

EDIT: I found a paper, see p.5, that gives some explanation on the calculation of rhsu. But still, it remains pretty unclear to me.

I got stuck with Hestaven/Warburton's dG-FEM matlab code. Starting with the file AdvecRHS1D.m

  we see in line 11

du(:) = (u(vmapM)-u(vmapP)).*(a*nx(:)-(1-alpha)*abs(a*nx(:)))/2;

which calculates the jump $[u]$ between adjacent elements and multiplies it with some factor, giving

$$du=[u]\frac{an-(1-\alpha)|an|}{2}=[u]a\frac{n-(1-\alpha)}{2}, n\in \{-1,1\},\\ a>,\ 1\geq\alpha\geq 0$$

which looks very similar to the numerical flux described as

$$(au)^*=\{\{u\}\} + a\frac{1-\alpha}{2}[u]$$ if we leave out the average $\{\{u\}\}$. Yet these terms are obviously not the same. Then, for the computation of the right hand side of the PDE, this happens:

rhsu = -a*rx.*(Dr*u) + LIFT*(Fscale.*(du));

which is supposed to calculate the integral

$$\left[l^k(x)(au^k_h) - (au)^* \right]_{x_l^k}^{x_r^k} = \oint_{\delta D^k}\hat{n}(au_h - (au)^*)l_i(r)$$

But i dont understand how this line of code is expressing this.

EDIT: I found a paper, see p.5, that gives some explanation on the calculation of rhsu. But still it remains pretty unclear to me.

I got stuck with Hestaven/Warburton's dG-FEM Matlab code. Starting with the file AdvecRHS1D.m, we see in line 11

du(:) = (u(vmapM)-u(vmapP)).*(a*nx(:)-(1-alpha)*abs(a*nx(:)))/2;

which calculates the jump $[u]$ between adjacent elements and multiplies it with some factor, giving

$$du=[u]\frac{an-(1-\alpha)|an|}{2}=[u]a\frac{n-(1-\alpha)}{2}, n\in \{-1,1\},\\ a>,\ 1\geq\alpha\geq 0$$

which looks very similar to the numerical flux described as

$$(au)^*=\{\{u\}\} + a\frac{1-\alpha}{2}[u]$$

if we leave out the average $\{\{u\}\}$. Yet these terms are obviously not the same.

Then, for the computation of the right hand side of the PDE, this happens:

rhsu = -a*rx.*(Dr*u) + LIFT*(Fscale.*(du));

which is supposed to calculate the integral

$$\left[l^k(x)(au^k_h) - (au)^* \right]_{x_l^k}^{x_r^k} = \oint_{\delta D^k}\hat{n}(au_h - (au)^*)l_i(r)$$

But I don't understand how this line of code is expressing this.

EDIT: I found a paper, see p.5, that gives some explanation on the calculation of rhsu. But still, it remains pretty unclear to me.

added 7 characters in body
Source Link
dba
  • 295
  • 1
  • 8

I got stuck with Hestaven/Warburton's dG-FEM matlab code. Starting with the file AdvecRHS1D.m

we see in line 11

du(:) = (u(vmapM)-u(vmapP)).*(a*nx(:)-(1-alpha)*abs(a*nx(:)))/2;

which calculates the jump $[u]$ between adjacent elements and multiplies it with some factor, giving

$$du=[u]\frac{an-(1-\alpha)|an|}{2}=[u]a\frac{n-(1-\alpha)}{2}, n\in \{-1,1\},\\ a>,\ 1\geq\alpha\geq 0$$

which looks very similar to the numerical flux described as

$$(au)^*=\{\{u\}\} + a\frac{1-\alpha}{2}[u]$$ if we leave out the average $\{\{u\}\}$. Yet these terms are obviously not the same. Then, for the computation of the right hand side of the PDE, this happens:

rhsu = -a*rx.*(Dr*u) + LIFT*(Fscale.*(du));

which is supposed to calculate the integral

$$\left[l^k(x)(au^k_h) - (au)^* \right]_{x_l^k}^{x_r^k} = \oint_{\delta D^k}\hat{n}(au_h - (au)^*)l_i(r)$$

But i dont understand how this line of code is expressing this.

IEDIT: I found a paper, see p.5, that gives some explanation on the calculation of rhsu. But still it remains pretty unclear to me.

I got stuck with Hestaven/Warburton's dG-FEM matlab code. Starting with the file AdvecRHS1D.m

we see in line 11

du(:) = (u(vmapM)-u(vmapP)).*(a*nx(:)-(1-alpha)*abs(a*nx(:)))/2;

which calculates the jump $[u]$ between adjacent elements and multiplies it with some factor, giving

$$du=[u]\frac{an-(1-\alpha)|an|}{2}=[u]a\frac{n-(1-\alpha)}{2}, n\in \{-1,1\},\\ a>,\ 1\geq\alpha\geq 0$$

which looks very similar to the numerical flux described as

$$(au)^*=\{\{u\}\} + a\frac{1-\alpha}{2}[u]$$ if we leave out the average $\{\{u\}\}$. Yet these terms are obviously not the same. Then, for the computation of the right hand side of the PDE, this happens:

rhsu = -a*rx.*(Dr*u) + LIFT*(Fscale.*(du));

which is supposed to calculate the integral

$$\left[l^k(x)(au^k_h) - (au)^* \right]_{x_l^k}^{x_r^k} = \oint_{\delta D^k}\hat{n}(au_h - (au)^*)l_i(r)$$

But i dont understand how this line of code is expressing this.

I found a paper, see p.5, that gives some explanation on the calculation of rhsu. But still it remains pretty unclear to me.

I got stuck with Hestaven/Warburton's dG-FEM matlab code. Starting with the file AdvecRHS1D.m

we see in line 11

du(:) = (u(vmapM)-u(vmapP)).*(a*nx(:)-(1-alpha)*abs(a*nx(:)))/2;

which calculates the jump $[u]$ between adjacent elements and multiplies it with some factor, giving

$$du=[u]\frac{an-(1-\alpha)|an|}{2}=[u]a\frac{n-(1-\alpha)}{2}, n\in \{-1,1\},\\ a>,\ 1\geq\alpha\geq 0$$

which looks very similar to the numerical flux described as

$$(au)^*=\{\{u\}\} + a\frac{1-\alpha}{2}[u]$$ if we leave out the average $\{\{u\}\}$. Yet these terms are obviously not the same. Then, for the computation of the right hand side of the PDE, this happens:

rhsu = -a*rx.*(Dr*u) + LIFT*(Fscale.*(du));

which is supposed to calculate the integral

$$\left[l^k(x)(au^k_h) - (au)^* \right]_{x_l^k}^{x_r^k} = \oint_{\delta D^k}\hat{n}(au_h - (au)^*)l_i(r)$$

But i dont understand how this line of code is expressing this.

EDIT: I found a paper, see p.5, that gives some explanation on the calculation of rhsu. But still it remains pretty unclear to me.

page number
Source Link
dba
  • 295
  • 1
  • 8

I got stuck with Hestaven/Warburton's dG-FEM matlab code. Starting with the file AdvecRHS1D.m

we see in line 11

du(:) = (u(vmapM)-u(vmapP)).*(a*nx(:)-(1-alpha)*abs(a*nx(:)))/2;

which calculates the jump $[u]$ between adjacent elements and multiplies it with some factor, giving

$$du=[u]\frac{an-(1-\alpha)|an|}{2}=[u]a\frac{n-(1-\alpha)}{2}, n\in \{-1,1\},\\ a>,\ 1\geq\alpha\geq 0$$

which looks very similar to the numerical flux described as

$$(au)^*=\{\{u\}\} + a\frac{1-\alpha}{2}[u]$$ if we leave out the average $\{\{u\}\}$. Yet these terms are obviously not the same. Then, for the computation of the right hand side of the PDE, this happens:

rhsu = -a*rx.*(Dr*u) + LIFT*(Fscale.*(du));

which is supposed to calculate the integral

$$\left[l^k(x)(au^k_h) - (au)^* \right]_{x_l^k}^{x_r^k} = \oint_{\delta D^k}\hat{n}(au_h - (au)^*)l_i(r)$$

But i dont understand how this line of code is expressing this.

I found a paper, see p.5, that gives some explanation on the calculation of rhsu. But still it remains pretty unclear to me.

I got stuck with Hestaven/Warburton's dG-FEM matlab code. Starting with the file AdvecRHS1D.m

we see in line 11

du(:) = (u(vmapM)-u(vmapP)).*(a*nx(:)-(1-alpha)*abs(a*nx(:)))/2;

which calculates the jump $[u]$ between adjacent elements and multiplies it with some factor, giving

$$du=[u]\frac{an-(1-\alpha)|an|}{2}=[u]a\frac{n-(1-\alpha)}{2}, n\in \{-1,1\},\\ a>,\ 1\geq\alpha\geq 0$$

which looks very similar to the numerical flux described as

$$(au)^*=\{\{u\}\} + a\frac{1-\alpha}{2}[u]$$ if we leave out the average $\{\{u\}\}$. Yet these terms are obviously not the same. Then, for the computation of the right hand side of the PDE, this happens:

rhsu = -a*rx.*(Dr*u) + LIFT*(Fscale.*(du));

which is supposed to calculate the integral

$$\left[l^k(x)(au^k_h) - (au)^* \right]_{x_l^k}^{x_r^k} = \oint_{\delta D^k}\hat{n}(au_h - (au)^*)l_i(r)$$

But i dont understand how this line of code is expressing this.

I got stuck with Hestaven/Warburton's dG-FEM matlab code. Starting with the file AdvecRHS1D.m

we see in line 11

du(:) = (u(vmapM)-u(vmapP)).*(a*nx(:)-(1-alpha)*abs(a*nx(:)))/2;

which calculates the jump $[u]$ between adjacent elements and multiplies it with some factor, giving

$$du=[u]\frac{an-(1-\alpha)|an|}{2}=[u]a\frac{n-(1-\alpha)}{2}, n\in \{-1,1\},\\ a>,\ 1\geq\alpha\geq 0$$

which looks very similar to the numerical flux described as

$$(au)^*=\{\{u\}\} + a\frac{1-\alpha}{2}[u]$$ if we leave out the average $\{\{u\}\}$. Yet these terms are obviously not the same. Then, for the computation of the right hand side of the PDE, this happens:

rhsu = -a*rx.*(Dr*u) + LIFT*(Fscale.*(du));

which is supposed to calculate the integral

$$\left[l^k(x)(au^k_h) - (au)^* \right]_{x_l^k}^{x_r^k} = \oint_{\delta D^k}\hat{n}(au_h - (au)^*)l_i(r)$$

But i dont understand how this line of code is expressing this.

I found a paper, see p.5, that gives some explanation on the calculation of rhsu. But still it remains pretty unclear to me.

Source Link
dba
  • 295
  • 1
  • 8
Loading