subspaces are recreated on every .sub() call

Issue #206 resolved
Nico Schlömer created an issue

Subspaces are recreated everytime they are requested.

MWE:

from dolfin import *
mesh = UnitSquareMesh(20, 20)
V = FunctionSpace(mesh, 'CG', 1)
W = V*V

print V.id(), W.sub(0).id(), W.sub(0).id()

On my computer, this gives

3 6 9

This issue is similar to #197.

Comments (5)

  1. Jan Blechta
    • changed status to open

    Fix in pull request #167. Nevertheless, there was nothing harmful. dolfin::SubSpace object was constructed every time but those were just pointer intializations. Dofmap was not constructed redundantly.

  2. Log in to comment