Skip to content

Commit

Permalink
Fix expansion of facets to edges for interior facets (#1132)
Browse files Browse the repository at this point in the history
  • Loading branch information
kinnala authored Jun 13, 2024
1 parent 02a80c3 commit a8d5b09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
3 changes: 2 additions & 1 deletion skfem/element/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
ElementTetP2: ElementTriP2,
ElementHex0: ElementQuad0,
ElementHex1: ElementQuad1,
ElementHex2: ElementQuad2
ElementHex2: ElementQuad2,
ElementHex1DG: ElementQuad1,
}

# for backwards compatibility
Expand Down
12 changes: 2 additions & 10 deletions skfem/mesh/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,16 +458,8 @@ def _expand_facets(self, ix: ndarray) -> Tuple[ndarray, ndarray]:
"""
vertices = np.unique(self.facets[:, ix].flatten())

if self.dim() == 3:
edge_candidates = self.t2e[:, self.f2t[0, ix]].flatten()
# subset of edges that share all points with the given facets
subset = np.nonzero(
np.prod(np.isin(self.edges[:, edge_candidates],
self.facets[:, ix].flatten()),
axis=0)
)[0]
edges = np.intersect1d(self.boundary_edges(),
edge_candidates[subset])
if self.dim() == 3 and self.bndelem is not None:
edges = np.unique(self.f2e[:, ix])
else:
edges = np.array([], dtype=np.int64)

Expand Down

0 comments on commit a8d5b09

Please sign in to comment.