[Deprecated] since 23.08.18. Use fmesher::fm_evaluate() and fmesher::fm_evaluator() instead.

Calculate a lattice projection to/from an inla.mesh().

The call inla.mesh.project(mesh, loc, field=..., ...), is a shortcut to inla.mesh.project(inla.mesh.projector(mesh, loc), field).

inla.mesh.project(...)

inla.mesh.projector(...)

Arguments

...

Arguments passed on to fmesher::fm_evaluate() and fmesher::fm_evaluator().

Value

For inla.mesh.project(mesh, ...), a list with projection information. For inla.mesh.projector(mesh, ...), an inla.mesh.projector object. For inla.mesh.project(projector, field, ...), a field projected from the mesh onto the locations given by the projector object.

Author

Finn Lindgren finn.lindgren@gmail.com

Examples


n <- 20
loc <- matrix(runif(n * 2), n, 2)
mesh <- inla.mesh.create(loc, refine = list(max.edge = 0.05))
proj <- inla.mesh.projector(mesh)
field <- cos(mesh$loc[, 1] * 2 * pi * 3) * sin(mesh$loc[, 2] * 2 * pi * 7)
image(proj$x, proj$y, inla.mesh.project(proj, field))

# \donttest{
if (require(rgl)) {
  plot(mesh, rgl = TRUE, col = field, draw.edges = FALSE, draw.vertices = FALSE)
}
#> Error: The `rgl` argument of `plot.fm_mesh_2d()` was deprecated in fmesher
#> 0.1.0 and is now defunct.
#>  Please use `plot_rgl()` instead.
# }