This function creates a mesh based on a given grid. While mesh construction and validation should ideally be done manually, this function provides a convenient default interface between a grid and inla.mesh.2d. It is designed to support usage with sim_ays_covar_spde(), and the default parameters are tuned for use with the default grid setup.

make_mesh(
  grid = make_grid(),
  max.edge = 50,
  bound.outer = 150,
  cutoff = 10,
  offset = c(max.edge, bound.outer),
  ...
)

Arguments

grid

A grid object to generate a mesh from.

max.edge

The maximum allowed triangle edge length. One or two numeric values. Passed to inla.mesh.2d.

bound.outer

Optional outer extension value passed to offset.

cutoff

Minimum distance allowed between mesh points.

offset

Automatic extension distance used by inla.mesh.2d.

...

Additional options passed to inla.mesh.2d.

Value

An object of class inla.mesh.

Examples

# \donttest{
if (requireNamespace("INLA")) {
  basic_mesh <- make_mesh()
  plot(basic_mesh)
}
#> Loading required namespace: INLA

# }