Skip to content

BUG: no way to query non-empty boundary segments without generating warnings #5275

Description

@stephankramer

Thetis and https://github.com/mesh-adaptation/movement/tree/main/movement use mesh.exterior_facets.unique_markers to figure out which boundary markers exist to do some preprocessing for each of those. Since #5005 this list contains all of the original markers with those that "disappear" as a periodic boundary now corresponding to an empty set - where as previously IIRC exterior_facets.unique_markers would only contain the remaining, active markers. In Thetis it hasn't immediately broken anything, because it just computes some integrals over the empty boundary segments - but it does produce quite a few menacing warning messages

firedrake:WARNING Subdomain (np.int32(1),) is empty. This is likely an error. Did you choose the right label?
firedrake:WARNING Subdomain (np.int32(2),) is empty. This is likely an error. Did you choose the right label?
firedrake:WARNING Subdomain (np.int32(3),) is empty. This is likely an error. Did you choose the right label?
firedrake:WARNING Subdomain (np.int32(4),) is empty. This is likely an error. Did you choose the right label?

Would it break anything to leave out the empty/periodic boundary markers from that list? So it would just be [1,2] or [3,4], or [] for a doubly periodic rectangle? Or alternatively, is there/could we have a mechanism to query which ones are empty without triggering warnings? - e.g. even if I do:

  boundary_markers = [bm for bm in mesh.exterior_facets.unique_markers if mesh.exterior_facets.subset(bm).size > 0]

I get the same warning messages triggered by accessing .subset(bm)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions