- changed status to duplicate
Function.split() does not properly handle constrained domains
Issue #510
duplicate
Using this code on FEniCS 1.5 prints "4, 5, 5". The expected output is "4, 4, 4"
from dolfin import *
mesh = UnitIntervalMesh(4)
class PeriodicDomain(SubDomain):
def inside(self, x, on_boundary):
return near(x[0], 0)
def map(self, x, y):
y[0] = x[0] - 1.0
cd = PeriodicDomain()
V = FunctionSpace(mesh, 'CG', 1, constrained_domain=cd)
Vmix = V*V
u = Function(V)
umix = Function(Vmix)
umix1, umix2 = umix.split(True)
print len(u.vector()), len(umix1.vector()), len(umix2.vector())
Using a FunctionAssigner seems to work properly, at least this prints "4":
Vmix0 = FunctionAssigner(V, Vmix.sub(0))
Vmix0.assign(u, umix.sub(0))
print len(u.vector())
Comments (1)
-
reporter - Log in to comment
Duplicate of #405.