How to set the anti-periodic boundary conditions in FENICS

Hi,

I have confirmed that a periodic boundary condition can be set in FENICS.

Is it possible to set an anti-periodic boundary condition in FENICS?

While a Periodic Boundary condition sets the same value for the unknowns on the corresponding boundary, an Antiperiodic Boundary condition sets a sign-reversed value.

Any advice would be appreciated.

You can use dolfinx and dolfinx-mpc to do this. See the Periodic demo, which takes in the argument scale that you can set to -1:
def create_periodic_constraint(self, meshtag, tag, relation, bcs, scale=1):.

1 Like

Thanks for the quick response, dokken.
I’ll try dolfinx and dolfinx-mpc right away.