fm_subdivide: Split triangles of a mesh into subtriangles

View source: R/mesh.R

fm_subdivideR Documentation

Split triangles of a mesh into subtriangles

Description

[Experimental] Splits each mesh triangle into (n + 1)^2 subtriangles. The current version drops any edge constraint information from the mesh.

Usage

fm_subdivide(mesh, n = 1)

Arguments

mesh

an fm_mesh_2d object

n

number of added points along each edge. Default is 1.

Value

A refined fm_mesh_2d object

Author(s)

Finn Lindgren finn.lindgren@gmail.com

Examples

mesh <- fm_rcdt_2d_inla(
  loc = rbind(c(0, 0), c(1, 0), c(0, 1)),
  tv = rbind(c(1, 2, 3))
)
mesh_sub <- fm_subdivide(mesh, 3)
mesh
mesh_sub

plot(mesh_sub, edge.color = 2)

plot(fm_subdivide(fmexample$mesh, 3), edge.color = 2)
plot(fmexample$mesh, add = TRUE, edge.color = 1)

fmesher documentation built on July 1, 2024, 5:07 p.m.