Refinement algorithm sets parent facets data in 2D, but not in 3D

Issue #502 resolved
Gregor Mitscha-Eibl created an issue

In this issue, it was already reported that some refinement algorithms don't set any parent entities data. I also found out that for setting parent facet data of a 2D mesh, one needs to choose "plaza_with_parent_facets", and this code works:

from dolfin import *
parameters["refinement_algorithm"] = "plaza_with_parent_facets"

mesh = UnitSquareMesh(2, 2)

cf = CellFunction('bool', mesh, True)
mesh1 = adapt(mesh, cf)

f = FacetFunction("size_t", mesh)
f_refined = adapt(f, mesh1)

However, when using a 3D mesh, we get the same error as for "plaza" in 2D, because the parent facets data is missing, so

from dolfin import *
parameters["refinement_algorithm"] = "plaza_with_parent_facets"

mesh = UnitCubeMesh(2, 2, 2)

cf = CellFunction('bool', mesh, True)
mesh1 = adapt(mesh, cf)

f = FacetFunction("size_t", mesh)
f_refined = adapt(f, mesh1)

results in the error message

*** Error:   Unable to adapt mesh function.
*** Reason:  Unable to extract information about parent mesh entites.
*** Where:   This error was encountered inside adapt.cpp.

Comments (4)

  1. Chris Richardson

    I think this has been fixed in master. Maybe you can try out the development version, and see if that works.

  2. Log in to comment