Learn R Programming

SpatialfdaR (version 1.0.0)

squareMesh: Generate a Triangulation of a Square.

Description

The square is subdivided into m internal squares. Within each internal square nodes are set at the corners and the middle. Each square is thus subdivided into four triangles.

Usage

squareMesh(m=1)

Value

A named list containing locations of nodes and which nodes define the edge segments and the triangles. The members are:

  • p: A two-column matrix specifying the nodes of the mesh.

  • e: A two-column matrix of integers specifying which nodes define each edge segment.

  • t: A three-column matrix of integers specifying which nodes define each triangle in anti-clockwise order.

Arguments

m

The number of squares within the outer square.

Author

Jim Ramsay

Details

The outer square has sides of length m. If another length $x > 0$ of the side is required, this can easily be achieved by the command p = p*x/m.

References

Sangalli, Laura M., Ramsay, James O., Ramsay, Timothy O. (2013), Spatial spline regression models, Journal of the Royal Statistical Society, Series B, 75, 681-703.

See Also

link{plotFEM.mesh}

Examples

Run this code
m <- 3
#  A square of size 3 with 9 internal squares, 
#  25 nodes, 12 edge segments and 36 triangles.
result = squareMesh(m)
pts    = result$pts
edg    = result$edg
tri    = result$tri
#  plot the mesh
plotFEM.mesh(pts,tri)

Run the code above in your browser using DataLab