I would like to solve a poisson equation on a manifold. I would like to use periodic boundary conditions, but I am not sure they are supported in the version of dolfin I am using (1.6.0). For example, if I run the following code, which creates a function space on the boundary of the unit square,
from dolfin import *
# Sub domain for Periodic boundary condition
class PeriodicBoundary(SubDomain):
# Left boundary is "target domain" G
def inside(self, x, on_boundary):
print "The inside function has been called."
return bool(x[0] < DOLFIN_EPS and x[0] > -DOLFIN_EPS and on_boundary)
# Map right boundary (H) to left boundary (G)
def map(self, x, y):
print "The map function has been called."
y[0] = x[0] - 1.0
y[1] = x[1]
# Create mesh and finite element
mesh = UnitSquareMesh(32, 32)
periodic = PeriodicBoundary()
bmesh = BoundaryMesh(mesh,'exterior')
V = FunctionSpace(bmesh, "CG", 1, constrained_domain=periodic)
I do not see any print statements to say that the PeriodicBoundary class has been called -- it seems to be ignored. If I instead ask for a function on the original mesh (not the boundary mesh):
V = FunctionSpace(mesh, "CG", 1, constrained_domain=periodic)
I see lots of calls to the class.
Are periodic boundary conditions on manifolds simply not supported in dolfin as yet?