I'm trying to use periodic boundary conditions within a Raviart-Thomas finite element space in Fenics (dolfin 1.2.0) in a Ubuntu 12.04 (amd64) machine (with python 2.7). If other FE space is used, everything works fine, but if a Raviart-Thomas is considered, python crashes (due to libdolfin errors). In what follows, it is attached a test code to reproduce the error:

from dolfin import *

# Periodic boundary condition class
class PeriodicWall(SubDomain):
    def inside(self, x, on_boundary):
        return bool(on_boundary and near(x[0], 0.5))  
    def map(self, x, y):
        y[0] = x[0] 
        y[1] = x[1] + 1.0

# Mesh and periodic boundary conditions
mesh = RectangleMesh(-0.5,-0.5,0.5,0.5,5,5,"left")
periodicwall = PeriodicWall()

# Raviart-Thomas space with periodic boundaries
V = FunctionSpace(mesh, "RT", 1, constrained_domain=periodicwall)

Any kind of help would be helpful: are there any errors in the test code? or is it a known bug in Dolfin?

  • $\begingroup$ The indentation seems to be incorrect (both inside and map should be member functions, right?) If I fix it, the code works for me (master on github). $\endgroup$ – Christian Clason May 21 '13 at 15:17
  • $\begingroup$ It was my fault indenting the question on the textbox (the indentation is correct in my python script). On the other hand, if the code works from github, maybe the problem comes from the Ubuntu fenics packages. Thanks for the hint! $\endgroup$ – maprieto May 21 '13 at 15:27
  • 2
    $\begingroup$ Sorry, that should be bitbucket, of course. You can try the FEniCS-dev PPA and see if that fixes your problem. $\endgroup$ – Christian Clason May 21 '13 at 16:12
  • $\begingroup$ Using FEniCS-dev PPA solves the crash error and now everything works properly. Thanks, @ChristianClason $\endgroup$ – maprieto May 22 '13 at 14:31
  • $\begingroup$ Glad to hear that. Just a heads-up: Since the question is about a bug that will be fixed in the next version, it might be closed as "too localized" in the near future (especially since it's unanswered). $\endgroup$ – Christian Clason May 22 '13 at 15:09