Main Content

cellEdges

Find edges belonging to boundaries of specified cells

Since R2021a

    Description

    example

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

    example

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

    Examples

    collapse all

    Find edges belonging to the boundaries of the 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 object. The axes object contains 6 objects of type quiver, text, patch, line.

    Find edges belonging to the boundaries of cells 2 and 3.

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

    Find edges belonging to the boundaries of 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 object. The axes object contains 6 objects of type quiver, text, patch, line.

    Find all edges belonging to the boundaries of the outer cell. Show the first 10 edges.

    edgeIDs = cellEdges(gm,2);
    edgeIDs(1:10)
    ans = 1×10
    
         1     2     3     4     5     6     7     8     9    10
    
    

    From all edges belonging to the boundaries of the outer cell, return the edges belonging 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 belonging to the boundaries of the outer cell, return the edges belonging to the external faces. Show the first 10 edges.

    edgeIDs_ext = cellEdges(gm,2,"external");
    edgeIDs_ext(1:10)
    ans = 1×10
    
         1     2     3     4     5     6     7     8    13    14
    
    

    Input Arguments

    collapse all

    3-D geometry, specified as an fegeometry object or 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 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 boundaries of specified cells, returned as a positive number or a vector of positive numbers.

    Version History

    Introduced in R2021a

    expand all