Contenuto principale

faceEdges

R2026b

Find edges belonging to specified faces

    Description

    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.

    example

    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: [8×3 double]
    
    

    Plot the geometry with the face labels.

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

    Block geometry with face labels F1 through F6

    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)

    Block geometry with edge labels E1 through E12

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

    Create a geometry representing the L-shaped membrane by using lshapeg.

    gm = fegeometry(@lshapeg)
    gm = 
      fegeometry with properties:
    
            NumCells: 0
            NumFaces: 3
            NumEdges: 10
         NumVertices: 8
            Vertices: [8×2 double]
        FeatureAngle: []
                Mesh: []
    
    

    Plot the geometry with the face labels.

    pdegplot(gm,FaceLabels="on")

    L-shaped membrane geometry with face labels F1, F2, and F3

    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.

    pdegplot(gm,EdgeLabels="on")

    L-shaped membrane geometry with edge labels E1 through E10

    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: [16×3 double]
    
    

    Plot the geometry with the face labels.

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

    Figure contains an axes object. The axes object contains 6 objects of type quiver, text, patch, line.

    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)

    Figure contains an axes object. The axes object contains 6 objects of type quiver, text, patch, line.

    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