Main Content

cellEdges

Find edges attached to specified cells

    Description

    example

    EdgeID = cellEdges(g,RegionID) finds edges attached to the cells with ID numbers listed in RegionID.

    example

    EdgeID = cellEdges(g,RegionID,FilterType) returns internal, external, or all edges attached to the cells with ID numbers listed in RegionID.

    Examples

    collapse all

    Find edges attached to two middle cylinders in a geometry consisting of four stacked cylinders.

    Create a geometry that consists of four stacked cylinders.

    gm = multicylinder(5,[1 2 3 4],'ZOffset',[0 1 3 6])
    gm = 
      DiscreteGeometry with properties:
    
           NumCells: 4
           NumFaces: 9
           NumEdges: 5
        NumVertices: 5
           Vertices: [5x3 double]
    
    

    Plot the geometry with the cell and edge labels.

    pdegplot(gm,'CellLabels','on','EdgeLabels','on','FaceAlpha',0.2)

    Figure contains an axes. The axes contains 3 objects of type quiver, patch, line.

    Find edges attached to cells 2 and 3.

    edgeIDs = cellEdges(gm,[2 3])
    edgeIDs = 1×3
    
         2     3     4
    
    

    Find edges attached to the outer 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 cell labels.

    pdegplot(gm,'CellLabels','on','FaceAlpha',0.2)

    Figure contains an axes. The axes contains 3 objects of type quiver, patch, line.

    Find all edges attached to the outer cell.

    edgeIDs = cellEdges(gm,2)
    edgeIDs = 1×24
    
         1     2     3     4     5     6     7     8     9    10    11    12    13    14    15    16    17    18    19    20    21    22    23    24
    
    

    From all edges attached to the outer cell, return the edges attached to only the internal faces. Internal faces are faces shared between multiple cells.

    edgeIDs_int = cellEdges(gm,2,'internal')
    edgeIDs_int = 1×4
    
         9    10    11    12
    
    

    From all edges attached to the outer cell, return the edges attached to the external faces.

    edgeIDs_ext = cellEdges(gm,2,'external')
    edgeIDs_ext = 1×20
    
         1     2     3     4     5     6     7     8    13    14    15    16    17    18    19    20    21    22    23    24
    
    

    Input Arguments

    collapse all

    3-D geometry, specified as a DiscreteGeometry object.

    Cell ID, specified as a positive number or a vector of positive numbers. Each number represents a cell ID.

    Type of edges to return, specified as 'internal', 'external', or 'all'. Depending on this argument, cellEdges returns these types of faces:

    • 'internal' — Edges attached to only internal faces. Internal faces are faces shared between multiple cells.

    • 'external' — Edges attached to only external faces. External faces are faces not shared between multiple cells.

    • 'all' — All edges attached to the specified cells.

    Output Arguments

    collapse all

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

    Introduced in R2021a