Skip to content

Commit

Permalink
adding label to functionspace
Browse files Browse the repository at this point in the history
  • Loading branch information
emmarothwell1 committed Jan 27, 2024
1 parent 054b061 commit c25cfe2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ufl/functionspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def ufl_sub_spaces(self):
class BaseFunctionSpace(AbstractFunctionSpace, UFLObject):
"""Base function space."""

def __init__(self, domain, element):
def __init__(self, domain, element, label=None):
"""Initialise."""
if domain is None:
# DOLFIN hack
Expand Down Expand Up @@ -75,11 +75,16 @@ def ufl_domains(self):
else:
return (domain,)

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

def _ufl_hash_data_(self, name=None):
"""UFL hash data."""
name = name or "BaseFunctionSpace"
domain = self.ufl_domain()
element = self.ufl_element()
bdata = self.label()
if domain is None:
ddata = None
else:
Expand All @@ -88,13 +93,14 @@ def _ufl_hash_data_(self, name=None):
edata = None
else:
edata = element._ufl_hash_data_()
return (name, ddata, edata)
return (name, ddata, edata, bdata)

def _ufl_signature_data_(self, renumbering, name=None):
"""UFL signature data."""
name = name or "BaseFunctionSpace"
domain = self.ufl_domain()
element = self.ufl_element()
bdata = self.label()
if domain is None:
ddata = None
else:
Expand All @@ -103,7 +109,7 @@ def _ufl_signature_data_(self, renumbering, name=None):
edata = None
else:
edata = element._ufl_signature_data_()
return (name, ddata, edata)
return (name, ddata, edata, bdata)

def __repr__(self):
"""Representation."""
Expand Down

0 comments on commit c25cfe2

Please sign in to comment.