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

Check all subdomain data is the same #2369

Merged
merged 8 commits into from
Oct 31, 2022
9 changes: 8 additions & 1 deletion python/dolfinx/fem/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,15 @@ def _form(form):
""""Compile a single UFL form"""
# Extract subdomain data from UFL form
sd = form.subdomain_data()
subdomains, = list(sd.values()) # Assuming single domain
domain, = list(sd.keys()) # Assuming single domain
# Get subdomain data for each integral type
subdomains = {}
for integral_type, data in sd.get(domain).items():
# Check that the subdomain data for each integral of this type is
# the same
assert all([id(d) == id(data[0]) for d in data])
subdomains[integral_type] = data[0]

mesh = domain.ufl_cargo()
if mesh is None:
raise RuntimeError("Expecting to find a Mesh in the form.")
Expand Down