Bug in site-packages/dolfin/compilemodules/subdomains.py

Issue #778 resolved
Juan M. Bello-Rivas created an issue

It seems that at the beginning of the definition of the CompiledSubDomain function (in site-packages/dolfin/compilemodules/subdomains.py), the code:

    if isinstance(cppcode, string_types) and "class" in cppcode and \
           "SubDomain" in cppcode:
        members = []
        classname = re.findall(r"class[ ]+([\w]+).*", code)[0]
        code = cppcode

should read:

    if isinstance(cppcode, string_types) and "class" in cppcode and \
           "SubDomain" in cppcode:
        members = []
        code = cppcode
        classname = re.findall(r"class[ ]+([\w]+).*", code)[0]

Indeed, transposing the last two lines allows me to compile my own C++ SubDomain instance without problems (otherwise the program fails). This has been verified on dolfin aa0790a333cac40802baea618c3709b91196bd77