This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

mshr subdomain bug in 1.6

+1 vote

It seems mshr in the 1.6 ubuntu ppa has a bug with treating subdomains. This example for instance won't work properly. This might be related to mshr issues #30, #33.
Has this already been fixed and is there a way to update the mshr package?

Simple failing test:

import dolfin
from mshr import *

domain = Rectangle(dolfin.Point(0., 0.), dolfin.Point(1., 1.))
r0 = Rectangle(dolfin.Point(0.1, 0.1), dolfin.Point(0.5, 0.5))
r1 = Rectangle(dolfin.Point(0.6, 0.1), dolfin.Point(0.9, 0.9))
domain.set_subdomain(1, r0)
domain.set_subdomain(2, r1)
mesh2d = generate_mesh(domain, 55)
dolfin.plot(mesh2d, "2D mesh")
mf = dolfin.MeshFunction("size_t", mesh2d, 2, mesh2d.domains())
dolfin.plot(mf, "subdomains", interactive=True)
asked Mar 2, 2016 by meigel FEniCS User (1,520 points)

1 Answer

0 votes

As you mention, the problem is know. It was previously discussed in this thread. The problem has been fixed on the FEniCS 1.7.0dev branch.

To get the latest updates, you can download and build the developer version of FEniCS as instructed here. Otherwise i guess you'll have to wait for the next release.

answered Mar 2, 2016 by emher FEniCS User (1,290 points)
...