Create a triangular mesh
Description
This function is a wrapper of the Triangle library (http://www.cs.cmu.edu/~quake/triangle.html). It can be used
to create a triangulation of the domain of interest starting from a list of points, to be used as triangles' vertices, and a list of segments, that define the domain boundary. The resulting
mesh is a Constrained Delaunay triangulation. This is constructed in a way to preserve segments provided in the input segments
without splitting them. This imput can be used to define the boundaries
of the domain. If this imput is NULL, it generates a triangulation over the
convex hull of the points.
Usage
1 2 
Arguments
nodes 
A #nodesby2 matrix containing the x and y coordinates of the mesh nodes. 
nodesattributes 
A matrix with #nodes rows containing nodes' attributes. These are passed unchanged to the output. If a node is added during the triangulation process or mesh refinement, its attributes are computed by linear interpolation using the attributes of neighboring nodes. This functionality is for instance used to compute the value of a Dirichlet boundary condition at boundary nodes added during the triangulation process. 
segments 
A #segmentsby2 matrix. Each row contains the row's indices in 
holes 
A #holesby2 matrix containing the x and y coordinates of a point internal to each hole of the mesh. These points are used to carve holes in the triangulation, when the domain has holes. 
triangles 
A #trianglesby3 (when 
order 
Either '1' or '2'. It specifies wether each mesh triangle should be represented by 3 nodes (the triangle' vertices) or by 6 nodes (the triangle's vertices and midpoints).
These are
respectively used for linear (order = 1) and quadratic (order = 2) Finite Elements. Default is 
verbosity 
This can be '0', '1' or '2'. It indicates the level of verbosity in the triangulation process. When 
Value
An object of the class MESH2D with the following output:

A #nodesby2 matrix containing the x and y coordinates of the mesh nodes. 

A vector of length #nodes, 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. 

nodesattributes A matrix with #nodes rows containing nodes' attributes. These are passed unchanged to the output. If a node is added during the triangulation process or mesh refinement, its attributes are computed by linear interpolation using the attributes of neighboring nodes. This functionality is for instance used to compute the value of a Dirichlet boundary condition at boundary nodes added during the triangulation process. 

A #trianglesby3 (when 

A vector of length #segments with entries either '1' or '0'. An entry '1' indicates that the corresponding element in 

A #edgesby2 matrix containing all the edges of the triangles in the output triangulation. Each row contains the row's indices in 

A vector of lenght #edges with entries either '1' or '0'. An entry '1' indicates that the corresponding element in 

A #trianglesby3 matrix. Each row contains the indices of the three neighbouring triangles. An entry '1' indicates that one edge of the triangle is a boundary edge. 

A #holesby2 matrix containing the x and y coordinates of a point internal to each hole of the mesh. These points are used to carve holes in the triangulation, when the domain has holes. 

Either '1' or '2'. It specifies wether each mesh triangle should be represented by 3 nodes (the triangle' vertices) or by 6 nodes (the triangle's vertices and midpoints).
These are respectively used for linear (order = 1) and quadratic (order = 2) Finite Elements. Default is 
See Also
refine.MESH.2D
, create.FEM.basis
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14  ## Upload the Meuse data
data(MeuseData)
## Create a triangulation on the convex hull of these data,
## where each data location is a triangle vertex
mesh < create.MESH.2D(nodes = MeuseData[,c(2,3)], order = 1)
## Plot the mesh
plot(mesh)
## Upload a domain boundary for these data
data(MeuseBorder)
## Create a constrained Delaunay triangulation with the provided boundary
## where each datalocation is a triangle vertex
mesh < create.MESH.2D(nodes = MeuseData[,c(2,3)], segments = MeuseBorder, order = 1)
## Plot the mesh
plot(mesh)
