Subsequent use of split gives wrong results

Bug #855912 reported by Marie Rognes
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
DOLFIN
Fix Released
Critical
Garth Wells

Bug Description

Something rather funny is happening when using w.split() more than once on a Function w,
I think it is best illustrated with the script below, which produces:

These numbers should be the same:
||u|| = 2.0
||u1|| = 1.0

If the "tmp = ..." line is commented out, I get the expected result:

These numbers should be the same:
||u|| = 2.0
||u1|| = 2.0

Anyone else getting this?

--

from dolfin import *

mesh = UnitSquare(2, 2)
V = VectorFunctionSpace(mesh, "CG", 1)

# Define a function
w1 = Function(V)
w1.vector()[:] = 1.0

# Define a second function
w = Function(V)
w.vector()[:] = 2.0

# Extract first component from w1, not used here -- gives expected
# result if this line is commented out, or if deepcopy=False is used
tmp = w1.split()[0]

# Assign w to w1, expecting w and w1 now to be the same
w1.assign(w)

# Extract subcomponents
u1 = w1.split()[0]
u = w.split()[0]

n_u1 = norm(u1)
n_u = norm(u)

print "These numbers should be the same:"
print "||u|| = ", n_u
print "||u1|| = ", n_u1

Related branches

Johannes Ring (johannr)
Changed in dolfin:
status: New → Confirmed
importance: Undecided → Critical
Changed in dolfin:
milestone: none → 1.0-beta2
Changed in dolfin:
assignee: nobody → Garth Wells (garth-wells)
status: Confirmed → In Progress
Changed in dolfin:
status: In Progress → Fix Committed
Changed in dolfin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.