Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emmarothwell1/restricted function space #252

Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ebb10c1
Add trimmed serendipity
rckirby Feb 27, 2020
3ff2d50
Fix value shape for trimmed serendipity
rckirby Feb 27, 2020
c9bb809
ufl plumbing update for trimmed serendipity.
Justincrum Apr 10, 2020
87cd5a0
Plumbing for SminusDiv.py
Justincrum Apr 14, 2020
c17ccb5
Adding in element stuff for SminusCurl.
Justincrum Sep 8, 2020
0449576
Merge remote-tracking branch 'origin' into trimmedSerendipity
Justincrum Sep 22, 2020
5eea76b
Merge remote-tracking branch 'origin/master' into trimmedSerendipity
rckirby Jun 23, 2022
5b141d8
Merge pull request #23 from firedrakeproject/trimmedSerendipity
rckirby Jun 27, 2022
9135be1
Merge branch 'FEniCS:main' into master
dham Aug 4, 2022
3f5ad50
Merge branch 'main' into merge_fenics
dham Oct 13, 2022
0c592ec
Merge pull request #30 from firedrakeproject/merge_fenics
dham Oct 13, 2022
e2d2268
Fix typo
nbouziani Jan 15, 2023
13435fb
Merge pull request #32 from firedrakeproject/merge_fenics
dham Jan 25, 2023
f4babc4
Merge remote-tracking branch 'upstream/main' into ksagiyam/merge_upst…
ksagiyam Feb 24, 2023
772485d
Merge pull request #34 from firedrakeproject/ksagiyam/merge_upstream
ksagiyam Mar 13, 2023
16e3bbe
Merge remote-tracking branch 'fenics/main' into dham/merge_fenics
dham Jun 1, 2023
3c62318
Merge pull request #37 from firedrakeproject/dham/merge_fenics
dham Jun 2, 2023
55c281d
Merge remote-tracking branch 'upstream/main'
connorjward Aug 8, 2023
32c09fb
remove spurioius names
dham Sep 12, 2023
2e170ce
Merge pull request #41 from firedrakeproject/dham/fix_element_list
dham Sep 12, 2023
77fc281
Merge branch 'FEniCS:main' into master
dham Sep 12, 2023
f74efca
Merge remote-tracking branch 'fenics/main'
dham Sep 12, 2023
fd43d0d
Merge branch 'FEniCS:main' into master
dham Sep 20, 2023
7fbbd64
Merge branch 'FEniCS:main' into master
dham Sep 21, 2023
cf66c4b
Merge branch 'FEniCS:main' into master
dham Sep 22, 2023
ab66c9f
Merge remote-tracking branch 'upstream/main' into dolci/merge_upstream_2
Ig-dolci Nov 7, 2023
3f337c8
Merge pull request #46 from firedrakeproject/dolci/merge_upstream_2
JDBetteridge Nov 15, 2023
fa06f13
Merge remote-tracking branch 'upstream/main' into JHopeCollins/upstre…
JHopeCollins Nov 30, 2023
054b061
Merge pull request #48 from firedrakeproject/JHopeCollins/upstream-up…
JHopeCollins Nov 30, 2023
c25cfe2
adding label to functionspace
emmarothwell1 Jan 27, 2024
21305a0
pass label through to dualspace too
emmarothwell1 Jan 28, 2024
bd96715
removed label from __init__
emmarothwell1 Jan 29, 2024
698432d
change default label to ""
emmarothwell1 Jan 29, 2024
0c431c7
apply pr suggestions
emmarothwell1 Jan 31, 2024
0c2bddc
Update ufl/functionspace.py
mscroggs Feb 1, 2024
77c8f3d
Merge branch 'main' into emmarothwell1/restricted_function_space
mscroggs Feb 1, 2024
92233ea
Merge branch 'main' into emmarothwell1/restricted_function_space
dham Feb 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 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=""):
"""Initialise."""
if domain is None:
# DOLFIN hack
Expand All @@ -50,11 +50,15 @@ def __init__(self, domain, element):
else:
if element.cell != domain_cell:
raise ValueError("Non-matching cell of finite element and domain.")

AbstractFunctionSpace.__init__(self)
self._label = label
self._ufl_domain = domain
self._ufl_element = element

def label(self):
"""Return label of boundary domains to differentiate restricted and unrestricted."""
return self._label

def ufl_sub_spaces(self):
"""Return ufl sub spaces."""
return ()
Expand Down Expand Up @@ -88,7 +92,7 @@ def _ufl_hash_data_(self, name=None):
edata = None
else:
edata = element._ufl_hash_data_()
return (name, ddata, edata)
return (name, ddata, edata, self.label())

def _ufl_signature_data_(self, renumbering, name=None):
"""UFL signature data."""
Expand All @@ -103,7 +107,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, self.label())

def __repr__(self):
"""Representation."""
Expand All @@ -118,7 +122,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 @@ -143,13 +147,13 @@ class DualSpace(BaseFunctionSpace, UFLObject):
_primal = False
_dual = True

def __init__(self, domain, element):
def __init__(self, domain, element, label=""):
"""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
Loading