Subsequent use of split gives wrong results
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 = VectorFunctionS
# 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
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 |