For every edge on the boundary, adds a second degenerate triangle
Source:R/utils_initdata.R
add_exterior_triangles.RdEdges at the boundary will only border a single triangle. In order to deal with boundary conditions properly, this step ensures that every edge has two associated triangles (which use the edge) as well as two associated points (endpoints). The triangles that are added are degenerate triangles centered at the midpoint of each boundary edge.
Arguments
- data
A list containing the mesh data structures:
ptsis a V-by-M data table with columnsXandYcontaining the coordinates of cells and additional metadata.trisis a F-by-4 data table containing the X,Y coordinates of each triangle's centroid in the first two columns, and area and largest height of each triangle in the last two columns.edgesis a E-by-14 data table with columnsfrom_pt,to_pt,from_tri,to_tri,x0_pt,x1_pt,y0_pt,y1_pt,x0_tri,x1_tri,y0_tri,y1_tri,length_pt,length_tri. If only one triangle uses an edge, then thefrom_tri,x0_tri, andy0_trifields will contain NaN values.tri_to_ptis a F-by-V sparse matrix with value 1 at (i,j) if triangle i uses point j as a vertex.
Value
A list containing the mesh data structures with (possibly)
additional triangles. The tris table is updated to include the added
external triangles. The edge table is updated so that boundary edges
point to the newly added triangles. Also pts is unchanged, tri_to_pt
is updated. Because new external triangles only have 2 associated points,
tri_to_pt has rows that sum to either 2 or 3.