Skip to content

Commit

Permalink
pass label through to dualspace too
Browse files Browse the repository at this point in the history
  • Loading branch information
emmarothwell1 committed Jan 28, 2024
1 parent c25cfe2 commit 21305a0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ufl/functionspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def __init__(self, domain, element, label=None):
AbstractFunctionSpace.__init__(self)
self._ufl_domain = domain
self._ufl_element = element
self._label = label

def ufl_sub_spaces(self):
"""Return ufl sub spaces."""
Expand All @@ -77,7 +78,7 @@ def ufl_domains(self):

def label(self):
"""Return label containing boundary domains"""
return self.label
return self._label

def _ufl_hash_data_(self, name=None):
"""UFL hash data."""
Expand Down Expand Up @@ -124,7 +125,7 @@ class FunctionSpace(BaseFunctionSpace, UFLObject):

def dual(self):
"""Get the dual of the space."""
return DualSpace(self._ufl_domain, self._ufl_element)
return DualSpace(self._ufl_domain, self._ufl_element, label=self._label)

def _ufl_hash_data_(self):
"""UFL hash data."""
Expand All @@ -149,13 +150,13 @@ class DualSpace(BaseFunctionSpace, UFLObject):
_primal = False
_dual = True

def __init__(self, domain, element):
def __init__(self, domain, element, label=None):
"""Initialise."""
BaseFunctionSpace.__init__(self, domain, element)
BaseFunctionSpace.__init__(self, domain, element, label)

def dual(self):
"""Get the dual of the space."""
return FunctionSpace(self._ufl_domain, self._ufl_element)
return FunctionSpace(self._ufl_domain, self._ufl_element, label=self._label)

def _ufl_hash_data_(self):
"""UFL hash data."""
Expand Down

0 comments on commit 21305a0

Please sign in to comment.