# faceEdges

Find edges belonging to specified faces

Since R2021a

## Description

example

EdgeID = faceEdges(g,RegionID) finds edges belonging to the faces with ID numbers listed in RegionID.

example

EdgeID = faceEdges(g,RegionID,FilterType) returns internal, external, or all edges belonging to the faces with ID numbers listed in RegionID. This syntax is valid for 3-D geometries only.

## Examples

collapse all

Find edges belonging to the top and bottom faces of a block.

Create a block geometry.

gm = multicuboid(3,2,1)
gm =
DiscreteGeometry with properties:

NumCells: 1
NumFaces: 6
NumEdges: 12
NumVertices: 8
Vertices: [8x3 double]

Plot the geometry with the face labels.

pdegplot(gm,"FaceLabels","on","FaceAlpha",0.2)

Find edges belonging to faces 1 and 2.

edgeIDs = faceEdges(gm,[1 2])
edgeIDs = 1×8

1     2     3     4     5     6     7     8

Plot the geometry with the edge labels.

figure
pdegplot(gm,"EdgeLabels","on","FaceAlpha",0.2)

Find edges belonging to two faces of the L-shaped membrane.

Create a model and include this geometry. The geometry of the L-shaped membrane is described in the file lshapeg.

model = createpde();
gm = geometryFromEdges(model,@lshapeg)
gm =
AnalyticGeometry with properties:

NumCells: 0
NumFaces: 3
NumEdges: 10
NumVertices: 8
Vertices: [8x2 double]

Plot the geometry with the face labels.

pdegplot(gm,"FaceLabels","on")

Find edges belonging to faces 1 and 2.

edgeIDs = faceEdges(gm,[1 2])
edgeIDs = 1×8

1     2     3     6     7     8     9    10

Plot the geometry with the edge labels.

figure
pdegplot(gm,"EdgeLabels","on")

Find edges belonging to the side face of the inner cuboid in a geometry consisting of two nested cuboids.

Create a geometry that consists of two nested cuboids of the same height.

gm = multicuboid([2 5],[4 10],3)
gm =
DiscreteGeometry with properties:

NumCells: 2
NumFaces: 12
NumEdges: 24
NumVertices: 16
Vertices: [16x3 double]

Plot the geometry with the face labels.

pdegplot(gm,"FaceLabels","on","FaceAlpha",0.2)

Find all edges belonging to the side face of the inner cuboid.

edgeIDs = faceEdges(gm,6)
edgeIDs = 1×4

1     5    10    12

From all edges belonging to that face, return the edges belonging to only the internal faces. Internal faces are faces shared between multiple cells.

edgeIDs = faceEdges(gm,6,"internal")
edgeIDs = 1×2

10    12

From all edges belonging to that face, return the edges belonging to the external faces.

edgeIDs = faceEdges(gm,6,"external")
edgeIDs = 1×2

1     5

Plot the geometry with the edge labels.

pdegplot(gm,"EdgeLabels","on","FaceAlpha",0.2)

## Input Arguments

collapse all

Geometry, specified as an fegeometry object, a DiscreteGeometry object, or an AnalyticGeometry object.

Face ID, specified as a positive number or a vector of positive numbers. Each number represents a face ID.

Type of edges to return, specified as "internal", "external", or "all". Depending on this argument, faceEdges returns these types of faces for a 3-D geometry:

• "internal" — Edges belonging to only internal faces. Internal faces are faces shared between multiple cells.

• "external" — Edges belonging to only external faces. External faces are faces not shared between multiple cells.

• "all" — All edges belonging to the specified cells.

## Output Arguments

collapse all

IDs of edges belonging to the specified faces, returned as a positive number or a vector of positive numbers.

## Version History

Introduced in R2021a

expand all