1D discontinuous Galerkin FEM code

Hello, teacher, Can freefem++ write 1D discontinuous Galerkin FEM code?

yes you can !
except periodic boundary condition (no jump, mean, on periodic boundary ).

Hello, in fact, if there is a jump on periodic boundary, can freefem++ not implement the 1D discontinuous Galerkin FEM code?

Yes the jump and mean function is implémentée in version 4.11,

I have try it ok for my se thé exemple

Hello, as shown in the figure, this is a 1D discontinuous finite element problem. If I want to realize the above boundary term (the second term in the last line)in FreeFem++, how can I achieve it? thank you

Read thé CHANGELOG.md file for the syntaxe, sorry the doc is not updated:

  • DG formulation in 1d : add integral of all border of element : intallBE(ThL) and unified the notation by adding intallBE(ThS) , intallBE(Th2), intallBE(Th3) nuVertex of now the vertex number of element in intallBE0d integral BoundaryBE, InternalBE to know if border element (BE) is on true boundary of not. update nElementonB in case on no manifold data (value greater > 2) in meshL, MeshS case … add code to use jump, mean of test functuon on MeshL case. ( not in mesh3 ) to compute RHS.
1 Like

Hello, thank you for your reply. I understand, but How will this symbol be implemented?

屏幕截图 2022-06-30 111526

u+ refers to the value on the right of the oriented edge

Hello, in freefem++, about the one-dimensional discontinuous finite element method, on two adjacent intervals, on the common endpoint K of elements e1 and e2, how to represent the value of this point when k is on the first element?

I am not sure thaï u_xx is defined , I will se to morrow!

the the way the get the otherside de value is

otherside(u) 

If I make no mistake you formula is

intallBE(Th)((dxx(u)*jump(v)-dyy(v)jump(u))(N.x>0)/lenEdge)

Hello, thank you for your answer. The value u^ (+) of the right cell and the value u^ (-) of the left cell are taken on the adjacent cell. How to distinguish these two values when programming? That is, how to define the boundary item u^ (+) *v^ (-) or u^ (-) *v^ (+)?

intallBE(Th)(u^(+)*v^(-))?

intallBE(Th)(u^(-)*v^(+))?

intallBE mean you are on left or right on the segment so all point are vue 2 times.

It is why, I had (N.x > 0) to get just take the right value

it is impossible of write intallBE(Th)(u^(+)*v^(-))because it is non local

1 Like

Hello, I have a boundary item, i.e. U0 ^ {+} * U1 ^ {-} on \ partial \ Omega. Use this command intallbe (th) (U0 * (N.x> 0) * otherside (U1) * jump (V)/lenEdge). Is it correct?

I think no if it is a true boundary because otherside have no sens and ìntallbe do the integration on all triangle boundary.

Hello, in fact, this is my boundary condition,
屏幕截图 2022-08-08 181810
where f is the flux, p = 2.,

Expand the flux by u ^ {+} * u ^ {+} + u ^ {+} * u ^ {-} + u ^ {-} * u ^ {-}, then the above boundary condition is

Σ (jump (v) * (u ^ {+} * u ^ {+} + u ^ {+} * u ^ {-} + u ^ {-} * u ^ {-}), this command

intallBE (Th) (jump (v) * (u* u * (N.x > 0) + u* u + u * u * (N.x < 0)) / lenEdge), is it correct?

remark, you schema is def at point and in freefem you have finite element function
so if you take P1dcL1 finite element when the dof is the value a vertex

so u_m^- == u[2m] and u_m^+ == u[][2m+1]

where m is ne element element

load "msh3"
load "Element_P1dc1"
meshL Th=segment(10);
fespace Vh(Th,P1dcL1);
Vh u=x;
cout << u[] << endl; // to see 

for(int m=0;m<10;++m)
{
	cout << " u_m^- " << u[][2*m] << "    ";
	cout << " u_m^+ " << u[][2*m+1] << endl;
	
}
 

Hello, thank you for your reply, in fact, I developed the numerical flux of boundary conditions f = u ^ {+} * u ^ {+} + u ^ {+} * u ^ {-} + u ^ {-} *u ^ {-},p=1, this how to say in FreeFem++?

I want to know if I have the right boundary conditions?

intallBE(th)(jump(v)(uu*(N.x>0)+uu+uu*(N.x<0)))

Hello, according to your answer, if u_m ^ - is N.x < 0, then intallBE (th) (u (N.x> 0) * u * (N.x < 0) * jump (v))* on the boundary is a nonlinear term?

Hi, Frédéric,
if i understand it correctly, at this moment, DG in a periodic domain is not supported within freefem, right? thank you very much.

yes, the jump, mean are not correct with periodic BC.

understood, i guess it will be potentially fixed in newer version of freefem, right?