Skip to contents

Create mesh object

Usage

Mesh(domain)

# S4 method for list
Mesh(domain)

# S4 method for triangulation
Mesh(domain)

Arguments

domain

could be a triangulation returned by triangulate or a named list containing:

  • nodes, a #nodes-by-2 matrix containing the x and y coordinates of the mesh nodes;

  • elements, a #elements-by-3 matrix specifiying the triangles giving the row's indices in nodes of the triangles' vertices;

  • boundary, a #nodes-by-1 matrix, with entries either '1' or '0'. An entry '1' indicates that the corresponding node is a boundary node; an entry '0' indicates that the corresponding node is not a boundary node.

Value

A R6 class representing a Mesh.

Examples

if (FALSE) {
library(RTriangle)
library(femR)
p <- pslg(P=rbind(c(0, 0), c(1, 0), c(1, 1), c(0, 1)),
S=rbind(c(1, 2), c(2, 3), c(3, 4), c(4,1)))
unit_square <- triangulate(p, a = 0.00125, q=30)
mesh <- Mesh(unit_square)
}