MeshCellIndex

MeshCellIndex[mreg,d]

gives the cell indices for cells of dimension d in the mesh region mreg.

MeshCellIndex[mreg,cellspec]

gives the cell indices for the cells specified by cellspec.

Details

  • MeshCellIndex is often used to get the cell index {d,i} from a symbolic cell h[{i1,}].
  • The cell indices returned have the form {d,i}, where d is dimension and i a positive integer.
  • The mesh region mreg can be either MeshRegion or BoundaryMeshRegion.
  • The cell specification cellspec follows the standard form described for MeshRegion and BoundaryMeshRegion.
  • MeshCellCount can be used to find the maximum number of cell indices for each dimension.

Examples

open allclose all

Basic Examples  (1)

Find the cell index for different symbolic cells:

The 2D cell indices:

The 1D cell indices:

The 0D cell indices:

Scope  (8)

Get the cell indices for a MeshRegion in 1D:

Indices of 0D cells:

Index of the line segment:

Get the cell indices for a MeshRegion in 2D:

Indices of 1D cells:

Index of the top line segment:

Use it to highlight just that segment:

Get the cell indices for a MeshRegion in 3D:

Indices of the 2D cells:

Index of the top point:

Get the cell indices for a BoundaryMeshRegion in 1D:

Only the boundary points are cells:

Get the cell indices for a BoundaryMeshRegion in 2D:

Indices of the 1D cells:

Get the cell indices for a BoundaryMeshRegion in 3D:

Indices of the 2D cells:

Use All to get indices for cells of all dimensions:

Works with large mesh regions:

Properties & Relations  (4)

MeshCells gives the cells corresponding to cell indices:

The corresponding mesh cells:

MeshCellIndex gives the cell indices corresponding to MeshCells:

The corresponding cell indices:

HighlightMesh can use cell indices as input:

The length of a MeshCellIndex output is MeshCellCount evaluated with the same input:

Possible Issues  (1)

When coordinates are unused, they are removed from the MeshRegion representation:

Use the indices as if the third coordinate was never given:

Wolfram Research (2014), MeshCellIndex, Wolfram Language function, https://reference.wolfram.com/language/ref/MeshCellIndex.html.

Text

Wolfram Research (2014), MeshCellIndex, Wolfram Language function, https://reference.wolfram.com/language/ref/MeshCellIndex.html.

CMS

Wolfram Language. 2014. "MeshCellIndex." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MeshCellIndex.html.

APA

Wolfram Language. (2014). MeshCellIndex. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MeshCellIndex.html

BibTeX

@misc{reference.wolfram_2024_meshcellindex, author="Wolfram Research", title="{MeshCellIndex}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/MeshCellIndex.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_meshcellindex, organization={Wolfram Research}, title={MeshCellIndex}, year={2014}, url={https://reference.wolfram.com/language/ref/MeshCellIndex.html}, note=[Accessed: 22-December-2024 ]}