Can I run a discontinous galerkin code for periodic boundary conditions in free fem ++? Which version is good for this?
Yes but it is written in the formulation due to discontinuity.
Can you please explain how to write the boundary terms in the code?
Which DG formulation do you use ?
This a math problem not a freefem problem , but the idea is simple,
you periodic Boundary condition because like internal border so with the same scheme as for internal edge, but the jump and mean must be computed by hand fo exemple
jump(u)*jump(v) on border 2 and 4 become
Gamma_2 is the translation Tp of Gamma_4 : (x,y) → (x-1,y)
int1d(Th,2) ( (u-u(Tp)) ( v - v(Tp)) now the problem is to compute this integral
remenber you can move the quadrature point so you can slip the formula in 4 term
( no tested so may by error!)
int1d(Th,2) ( (u) ( v ))
+ int1d(Th,2,matu=Tp) ( - (u(Tp) ( v ))
+ int1d(Th,2,mapt=Tp) ( - (u) ( v(Tp) )
+ int1d(Th,4) ( (u v )
As you can see it is hard to do !