fm_bary_simplex: Extract Simplex information for Barycentric coordinates

View source: R/bary.R

fm_bary_simplexR Documentation

Extract Simplex information for Barycentric coordinates

Description

Extract the simplex vertex information for a combination of a mesh and fm_bary coordinates.

Usage

fm_bary_simplex(mesh, bary = NULL, ...)

## S3 method for class 'fm_mesh_2d'
fm_bary_simplex(mesh, bary = NULL, ...)

## S3 method for class 'fm_mesh_3d'
fm_bary_simplex(mesh, bary = NULL, ...)

## S3 method for class 'fm_mesh_1d'
fm_bary_simplex(mesh, bary = NULL, ...)

## S3 method for class 'fm_lattice_2d'
fm_bary_simplex(mesh, bary = NULL, ...)

## S3 method for class 'fm_lattice_Nd'
fm_bary_simplex(mesh, bary = NULL, ...)

Arguments

mesh

A mesh object, e.g. fm_mesh_2d or fm_mesh_1d.

bary

An fm_bary object. If NULL, return the full simplex information for the mesh.

...

Further arguments potentially used by sub-methods.

Value

A matrix of vertex indices, one row per point in bary.

Methods (by class)

  • fm_bary_simplex(fm_mesh_2d): Extract the triangle vertex indices for a 2D mesh

  • fm_bary_simplex(fm_mesh_3d): Extract the tetrahedron vertex indices for a 3D mesh

  • fm_bary_simplex(fm_mesh_1d): Extract the edge vertex indices for a 1D mesh

  • fm_bary_simplex(fm_lattice_2d): Extract the cell vertex indices for a 2D lattice

  • fm_bary_simplex(fm_lattice_Nd): Extract the cell vertex indices for a ND lattice

See Also

fm_bary(), fm_bary_loc()

Examples

bary <- fm_bary(fmexample$mesh, fmexample$loc_sf)
fm_bary_simplex(fmexample$mesh, bary)
(m <- fm_mesh_3d(
  matrix(c(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0), 4, 3, byrow = TRUE),
  matrix(c(1, 2, 3, 4), 1, 4, byrow = TRUE)
))
(bary <- fm_bary(m, rbind(
  cbind(0.1, 0.2, 0.3),
  cbind(-0.1, 0.2, 0.3)
)))
fm_bary_simplex(m, bary)
mesh1 <- fm_mesh_1d(1:4)
(bary1 <- fm_bary(mesh1, seq(0, 5, by = 0.5)))
(bary1 <- fm_bary(mesh1, seq(0, 5, by = 0.5), restricted = TRUE))
fm_bary_simplex(mesh1, bary1)
m <- fm_lattice_2d(x = 1:3, y = 1:4)
bary <- fm_bary(m, cbind(1.5, 3.2))
fm_bary_simplex(m, bary)
m <- fm_lattice_Nd(list(x = 1:3, y = 1:4, z = 1:2))
(bary <- fm_bary(m, cbind(1.5, 3.2, 1.5)))
(fm_bary_simplex(m, bary))
fm_bary_loc(m, bary)

fmesher documentation built on June 12, 2025, 5:09 p.m.