[Deprecated] Compute subsets of vertices and triangles in an inla.mesh object that are connected by edges. This function is deprecated from INLA 25.4.10 when fmesher version 0.3.0.9005 or later is installed, which had fm_mesh_components(), replaced from fmesher 0.4.0.9001 by fmesher::fm_components().

inla.mesh.components(mesh)

Arguments

mesh

An fm_mesh_2d object

Value

A list with elements vertex and triangle, vectors of integer labels for which connected component they belong, and info, a data.frame with columns

component

Connected component integer label.

nV

The number of vertices in the component.

nT

The number of triangles in the component.

area

The surface area associated with the component. Component labels are not comparable across different meshes, but some ordering stability is guaranteed by initiating each component from the lowest numbered triangle whenever a new component is initiated.

Author

Finn Lindgren finn.lindgren@gmail.com

Examples


# Construct two simple meshes:
library(fmesher)
loc <- matrix(c(0, 1, 0, 1), 2, 2)
mesh1 <- fm_mesh_2d(loc = loc, max.edge = 0.1)
bnd <- fm_nonconvex_hull(loc, 0.3)
mesh2 <- fm_mesh_2d(boundary = bnd, max.edge = 0.1)

# Compute connectivity information:
conn1 <- fm_components(mesh1)
conn2 <- fm_components(mesh2)
# One component, simply connected mesh
conn1$info
#>   component nV nT      area
#> 1         1 58 74 0.2165685
# Two disconnected components
conn2$info
#>   component nV  nT      area
#> 1         1 82 131 0.2761962
#> 2         2 86 138 0.2770083