Geometrical PBC does not suitable for 3D?


I have been using the geometrical periodic BC for dolfinx_mpc, but now my project goes to 3D problem, and I find that the geometrical PBC doesn’t work anymore.

In order to find the bug, I test the basic linear transport problem:
Screenshot from 2024-01-30 11-22-30
in unit domains(interval, square and cube), and it turns out that it works well for 1D and 2D(even when the PBC is on both directions) case, but for 3D case, the result doesn’t seem to be “periodic” even if I only impose PBC on one direction.

So I want to ask, is there any limit to the geometrical periodic BC, should I use topological periodic BC instead?
Thanks in advance.

No, there should be no limit to the periodic bcs. I’ve not encoded anything specific for any sub-dimension (at least not intended to).

Could you provide an MWE, for instance by changing: dolfinx_mpc/python/demos/ at main · jorgensd/dolfinx_mpc · GitHub from 2D to 3D?

Sorry, I guess I made a mistake.

When I solve the conservation equations, there are numerical instability. So it is more a numerical issue but not a problem about coding, now it works.