child().child() fails for Function and FunctionSpaces in Python
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DOLFIN |
Fix Released
|
High
|
Johan Hake |
Bug Description
It seems like there the children/parent information is not always correctly set when the adapt() function is called on FunctionSpaces or Functions.
The following code demontrates the problem:
-------
from dolfin import *
m0 = UnitIntervalMesh(2)
adapt(adapt(m0))
m1 = m0.child()
m2 = m1.child()
V = FunctionSpace(m0, "CG", 1)
f = Function(V)
adapt(adapt(f, m1), m2)
assert(f.depth() == 3) # Passes
assert(
assert(
f.child().child() # TypeError: expected a FunctionSpace or a Function as argument 1
-------
The same problem occurs if one adapts a FunctionSpace twice and tries to call .child().child() on it.
Similarly the parent information seems to he faulty, as .parent().parent() on the leaf node also produces this error.
Related branches
Changed in dolfin: | |
importance: | Undecided → High |
Changed in dolfin: | |
milestone: | none → 1.2.0 |
status: | Confirmed → Fix Committed |
assignee: | Marie Rognes (meg-simula) → Johan Hake (johan-hake) |
Changed in dolfin: | |
status: | Fix Committed → Fix Released |
Thanks for the report. Is this related to the recent changes for adapt/child in the Python layer, meaning, did it work before)?
I think this is related to Bug#1077923; I'll try to sit down with Johan and take a look at that and this when chance arises.