Periodic boundary condition for DG in FEniCS

Dear All, I wonder if the periodic boundary condition could be used now for DG schemes? It looks like about 8 months ago it’s not implemented in FEniCS, but How about now? Thank you!

1 Like

Hi,
sorry I don’t think this has changed. However with the mixed-dimensional branch, you should now be able to enforce it weakly by defining Lagrange multipliers lamb living on one side and add something like:

lamb*u*ds(2)-lamb*u*ds(1)

in your form where 1 and 2 are opposite faces. Although I haven’t tried it.

Thank you so much for this information! Just a quick questions, for interior penalty terms involving the edge length, is there any operator or UFL we could use to output the length of the interior edge(say we are in 2-D)?

f = FacetArea(mesh)

might be what you are looking for

Thank you so much for the quick reply, I just tested it, looks like it will not work as I have the following error “Discontinuous type Coefficient must be restricted”

Just do f("+"), f("-") or avg(f) which should all give the same results

Thank you so much! I think I understand what you mean now!