cellFaces
Description
Examples
Faces Belonging to Specified Cells
Find faces belonging to two cuboids in a geometry consisting of four stacked cuboids.
Create a geometry that consists of four stacked cuboids.
gm = multicuboid(5,10,[1 2 3 4],"ZOffset",[0 1 3 6])
gm = DiscreteGeometry with properties: NumCells: 4 NumFaces: 21 NumEdges: 36 NumVertices: 20 Vertices: [20x3 double]
Plot the geometry with the cell labels.
pdegplot(gm,"CellLabels","on","FaceAlpha",0.2)
Find faces belonging to cells 1 and 3.
faceIDs = cellFaces(gm,[1 3])
faceIDs = 1×12
1 2 3 4 5 6 7 12 13 14 15 16
Plot the geometry with the face labels.
pdegplot(gm,"FaceLabels","on","FaceAlpha",0.2)
Internal and External Faces Belonging to Specified Cells
Find faces belonging 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)
Find all faces belonging to the outer cell.
faceIDs = cellFaces(gm,2)
faceIDs = 1×10
3 4 5 6 7 8 9 10 11 12
Find only the internal faces belonging to the outer cell. Internal faces are faces shared between multiple cells.
faceIDs_int = cellFaces(gm,2,"internal")
faceIDs_int = 1×4
3 4 5 6
Find only the external faces belonging to the outer cell.
faceIDs_ext = cellFaces(gm,2,"external")
faceIDs_ext = 1×6
7 8 9 10 11 12
Plot the geometry with the face labels.
pdegplot(gm,"FaceLabels","on","FaceAlpha",0.2)
Input Arguments
g
— 3-D geometry
fegeometry
object | DiscreteGeometry
object
3-D geometry, specified as an fegeometry
object
or a DiscreteGeometry
object.
RegionID
— Cell ID
positive number | vector of positive numbers
Cell ID, specified as a positive number or a vector of positive numbers. Each number represents a cell ID.
FilterType
— Type of faces to return
"all"
(default) | "internal"
| "external"
Type of faces to return, specified as "internal"
,
"external"
, or "all"
. Depending on this
argument, cellFaces
returns these types of faces:
"internal"
— Internal faces, that is, faces shared between multiple cells."external"
— External faces, that is, faces not shared between multiple cells."all"
— All faces belonging to the specified cells.
Output Arguments
FaceID
— IDs of faces belonging to specified cells
positive number | vector of positive numbers
IDs of faces belonging to the specified cells, returned as a positive number or a vector of positive numbers.
Version History
Introduced in R2021aR2023a: Finite element model
cellFaces
now accepts geometries specified by fegeometry
objects.
See Also
Functions
Objects
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)