inla.mesh.segment {INLA}R Documentation

Constraint segments for inla.mesh

Description

[Deprecated] Use fmesher::fm_segm() instead.

Constructs inla.mesh.segment objects that can be used to specify boundary and interior constraint edges in calls to inla.mesh().

Usage

inla.mesh.segment(...)

inla.contour.segment(
  x = seq(0, 1, length.out = nrow(z)),
  y = seq(0, 1, length.out = ncol(z)),
  z,
  nlevels = 10,
  levels = pretty(range(z, na.rm = TRUE), nlevels),
  groups = seq_len(length(levels)),
  positive = TRUE,
  eps = NULL,
  crs = NULL
)

Arguments

...

Additional parameters. When joining segments, a list of inla.mesh.segment objects.

x, y, z, nlevels, levels

Parameters specifying a set of surface contours, with syntax described in contour().

groups

Vector of group ID:s, one for each contour level.

positive

TRUE if the contours should encircle positive level excursions in a counter clockwise direction.

eps

Tolerance for inla.simplify.curve().

crs

An optional CRS or inla.CRS object

loc

Matrix of point locations, or SpatialPoints, or sf/sfc point object.

idx

Segment index sequence vector or index pair matrix. The indices refer to the rows of loc. If loc==NULL, the indices will be interpreted as indices into the point specification supplied to inla.mesh.create(). If is.bnd==TRUE, defaults to linking all the points in loc, as c(1:nrow(loc),1L), otherwise 1:nrow(loc).

grp

Vector of group labels for each segment. Set to NULL to let the labels be chosen automatically in a call to inla.mesh.create().

is.bnd

TRUE if the segments are boundary segments, otherwise FALSE.

grp.default

When joining segments, use this group label for segments that have grp=NULL.

Value

An inla.mesh.segment object.

Functions

Author(s)

Finn Lindgren finn.lindgren@gmail.com

See Also

inla.mesh.create(), inla.mesh.2d()

Examples


## Create a square boundary and a diagonal interior segment
loc.bnd <- matrix(c(0, 0, 1, 0, 1, 1, 0, 1), 4, 2, byrow = TRUE)
loc.int <- matrix(c(0.9, 0.1, 0.1, 0.6), 2, 2, byrow = TRUE)
segm.bnd <- inla.mesh.segment(loc.bnd)
segm.int <- inla.mesh.segment(loc.int, is.bnd = FALSE)

## Points to be meshed
loc <- matrix(runif(10 * 2), 10, 2) * 0.9 + 0.05
mesh <- inla.mesh.create(loc,
  boundary = segm.bnd,
  interior = segm.int,
  refine = list()
)
plot(mesh)

mesh <- inla.mesh.create(loc, interior = fm_segm_join(segm.bnd, segm.int))
plot(mesh)


[Package INLA version 24.11.07-4 Index]