MeshCellCount

MeshCellCount[mreg]

gives a list {c0,c1,} of counts cd of cells of dimension d in the mesh region mreg.

MeshCellCount[mreg,d]

gives the total count of cells of dimension d.

MeshCellCount[mreg,cellspec]

gives the total count of cells specified by cellspec.

Details

Examples

open allclose all

Basic Examples  (2)

Count the cells in each dimension for a MeshRegion in 2D:

Count only the 1D cells:

Count the cells in each dimension for a BoundaryMeshRegion in 3D:

Only the boundary surfaces are cells:

Scope  (8)

Count the cells in each dimension for a MeshRegion in 1D:

Count only the 0D cells:

Count the cells in each dimension for a MeshRegion in 2D:

Count only the 1D cells:

Count the cells in each dimension for a MeshRegion in 3D:

Count only 2D cells:

Count the cells in each dimension for a BoundaryMeshRegion in 1D:

Only the boundary points are cells:

Count the cells in each dimension for a BoundaryMeshRegion in 2D:

Only the boundary curves are cells:

Count the cells in each dimension for a BoundaryMeshRegion in 3D:

Only the boundary surfaces are cells:

Use All to count the number of cells regardless of dimension:

The number of cells is equal to the sum of the cells in each dimension:

Works with large mesh regions:

Properties & Relations  (5)

MeshCellCount corresponds to the lengths cell lists in MeshCells:

MeshCellCount is typically larger than the number of cells used in MeshRegion:

The additional cells are points and edges for the triangle:

An -dimensional simplex has cells in total:

In various dimensions:

MeshCellCount for a BoundaryMeshRegion in 2D:

The vertex and edge count satisfy :

Even with holes it satisfies the same relation:

MeshCellCount for a BoundaryMeshRegion in 3D satisfies Euler's formula :

With voids you have the relation :

Introduced in 2014
 (10.0)