inla.mesh.create.Rd since
23.08.18
in favour of fmesher::fm_rcdt_2d_inla().
Create a constrained refined Delaunay triangulation (CRDT) for a set of spatial locations.
inla.mesh.create generates triangular meshes on subsets of
\(R^2\) and \(S^2\). Use the higher level wrapper function
inla.mesh.2d() for greater control over mesh resolution and
coarser domain extensions.
inla.delaunay is a wrapper function for obtaining the convex hull of
a point set and calling inla.mesh.create to generate the classical
Delaunay tringulation.
inla.mesh.create(
loc = NULL,
tv = NULL,
boundary = NULL,
interior = NULL,
extend = (missing(tv) || is.null(tv)),
refine = FALSE,
lattice = NULL,
globe = NULL,
cutoff = 1e-12,
plot.delay = NULL,
data.dir = NULL,
keep = (!missing(data.dir) && !is.null(data.dir)),
timings = FALSE,
quality.spec = NULL,
crs = NULL
)
inla.delaunay(loc, ...)Matrix of point locations. Can alternatively be a
SpatialPoints or SpatialPointsDataFrame object.
A triangle-vertex index matrix, specifying an existing triangulation.
A list of inla.mesh.segment objects, generated by
inla.mesh.segment(), specifying boundary constraint segments.
A list of inla.mesh.segment objects, generated by
inla.mesh.segment(), specifying interior constraint segments.
logical or list specifying whether to extend the
data region, with parameters
the number of edges in the extended boundary (default=8)
the extension distance. If negative, interpreted as a factor relative to the approximate data diameter (default=-0.10)
Setting to FALSE is only useful in
combination lattice or boundary.
logical or list specifying whether to refine the
triangulation, with parameters
the
minimum allowed interior angle in any triangle. The algorithm is guaranteed
to converge for min.angle at most 21 (default=21)
the maximum allowed edge length in any triangle. If
negative, interpreted as a relative factor in an ad hoc formula depending on
the data density (default=Inf)
the
maximum number of vertices allowed, overriding min.angle and
max.edge (default=-1, meaning no limit)
the
maximum number of vertices allowed, overriding max.edge only
(default=-1, meaning no limit)
An inla.mesh.lattice object, generated by
inla.mesh.lattice(), specifying points on a regular lattice.
Subdivision resolution for a semi-regular spherical triangulation with equidistant points along equidistant latitude bands.
The minimum allowed distance between points. Point at most as far apart as this are replaced by a single vertex prior to the mesh refinement step.
On Linux (and Mac if appropriate X11 libraries are
installed), specifying a numeric value activates a rudimentary plotting
system in the underlying fmesher program, showing the triangulation
algorithm at work.
Where to store the fmesher data files. Defaults to
tempdir() if keep is FALSE, otherwise
"inla.mesh.data".
TRUE if the data files should be kept in data.dir
or deleted afterwards. Defaults to true if data.dir is specified,
otherwise false. Warning: If keep is false, data.dir and its
contents will be deleted (unless set to tempdir()).
If TRUE, obtain timings for the mesh construction.
List of vectors of per vertex max.edge target
specification for each location in loc, boundary/interior
(segm), and lattice. Only used if refining the mesh.
An optional CRS or inla.CRS object
Optional parameters passed on to inla.mesh.create.
An inla.mesh object.
inla.delaunay(): since
23.08.18.
Use fmesher::fm_delaunay_2d() instead.
loc <- matrix(runif(10 * 2), 10, 2)
mesh <- inla.delaunay(loc)
#> Warning: `inla.delaunay()` was deprecated in INLA 23.08.18.
#> ℹ Please use `fmesher::fm_delaunay_2d()` instead.
#> ℹ For more information, see
#> https://inlabru-org.github.io/fmesher/articles/inla_conversion.html
#> ℹ To silence these deprecation messages in old legacy code, set
#> `inla.setOption(fmesher.evolution.warn = FALSE)`.
#> ℹ To ensure visibility of these messages in package tests, also set
#> `inla.setOption(fmesher.evolution.verbosity = 'warn')`.
plot(mesh)
mesh <- inla.mesh.create(loc,
interior = inla.mesh.segment(idx = 1:2),
extend = TRUE,
refine = list(max.edge = 0.1)
)
#> Warning: `inla.mesh.create()` was deprecated in INLA 23.08.18.
#> ℹ Please use `fmesher::fm_rcdt_2d_inla()` instead.
#> ℹ For more information, see
#> https://inlabru-org.github.io/fmesher/articles/inla_conversion.html
#> ℹ To silence these deprecation messages in old legacy code, set
#> `inla.setOption(fmesher.evolution.warn = FALSE)`.
#> ℹ To ensure visibility of these messages in package tests, also set
#> `inla.setOption(fmesher.evolution.verbosity = 'warn')`.
#> Warning: `inla.mesh.segment()` was deprecated in INLA 23.08.18.
#> ℹ Please use `fmesher::fm_segm()` instead.
#> ℹ For more information, see
#> https://inlabru-org.github.io/fmesher/articles/inla_conversion.html
#> ℹ To silence these deprecation messages in old legacy code, set
#> `inla.setOption(fmesher.evolution.warn = FALSE)`.
#> ℹ To ensure visibility of these messages in package tests, also set
#> `inla.setOption(fmesher.evolution.verbosity = 'warn')`.
plot(mesh)
loc2 <- matrix(c(0, 1, 1, 0, 0, 0, 1, 1), 4, 2)
mesh2 <- inla.mesh.create(
loc = loc,
boundary = inla.mesh.segment(loc2),
interior = inla.mesh.segment(idx = 1:2),
quality.spec = list(segm = 0.2, loc = 0.05),
refine = list(min.angle = 26)
)
plot(mesh2)