Spatial coordinates in form are scaled by 2/3 in 2D
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DOLFIN |
Invalid
|
Critical
|
Unassigned | ||
FFC |
Fix Released
|
Critical
|
Kristian B. Ølgaard |
Bug Description
Here's a program that plots y=x, y=2x, y=3x in 1D and 2D, giving correct plots in 1D but scaled by 2/3 in 2D:
from dolfin import *
n = 30
factor = 1.0
#cell = interval
cell = triangle
d = cell.d
if d == 1:
mesh = UnitInterval(n)
elif d == 2:
mesh = UnitSquare(n, n)
#factor = 3.0/2.0 # Enable this to adjust for bug and get correct plots
# Asserting that x indeed goes from 0 to 1
assert mesh.coordinate
assert mesh.coordinate
# Hack for bug in ffc, fix proposed for merging into dev branch
x = cell.x if d == 1 else cell.x[0]
V = FunctionSpace(mesh, "CG", 1)
for k in range(1, 4):
u = factor*k*x
print str(u)
uh = project(u, V)
plot(uh, vmin=-1.0, vmax=1.0)
interactive()
Changed in ffc: | |
status: | Fix Committed → Fix Released |
This test is a bit cryptic. Can you make it easy for us and explain what the expected result is (and how to check it), and what the actual result is (and how to check it).