Hello,
I have been using the following DOLFIN class (which I found at https://bitbucket.org/fenics-project/dolfin/pull-requests/4/adding-test-for/diff) to allow my 3D meshes (e.g. a cube mesh) to be periodic in the x direction.
class PeriodicBoundary3(SubDomain):
def inside(self, x, on_boundary):
return bool(x[0] < DOLFIN_EPS and x[0] > -DOLFIN_EPS and on_boundary)
def map(self, x, y):
y[0] = x[0] - 1.0
y[1] = x[1]
y[2] = x[2]
I would like to know how to modify this class to make my mesh periodic in all three directions (x, y and z).
Thank you in advance for your help!