Skip to content

Bugfix/dangling reference in slavedofs

Andreas Dedner requested to merge bugfix/dangling_reference_in_slavedofs into master

The problem occurs if we have a code sequence like Space space1(...), Space space2(...), delete space1 then space1,space2 have the same dofMapper and thus also lead to the same SlaveDofs (identical singleton key). That SlaveDofs instance stores a reference to the space (in this case space1) which is then dangling. This patch fixes that problem but is not backwards compatible, since the rebuild method now takes the space as argument. This breaks for example the DirichletConstraints in the dune-fem-howto (and in derived modules).

Discussion: should slaveDofs() be a method on the discrete function space?

Merge request reports