GRIDMAN
grid managment library
Functions/Subroutines
triang.f File Reference

Triangulation of 2D grid. More...

Go to the source code of this file.

Functions/Subroutines

subroutine gridman_grid2d_triang (TRIA, GRID, IERR)
 Triangulation of 2D grid. More...
 

Detailed Description

Triangulation of 2D grid.

Definition in file triang.f.

Function/Subroutine Documentation

subroutine gridman_grid2d_triang ( type(gridman_grid)  TRIA,
type(gridman_grid)  GRID,
integer, intent(out)  IERR 
)

Triangulation of 2D grid.

WARNING: if the object GRID already exist it will be overwritten! Same is true for mapping tables.

The algorithm works iteratively. On each iteration one new edge is added to the cells with number of vertices > 3. Iterations stop when all cells have only 3 vertices.

The edge is added in the following way. For each vertex a triangle is built by connecting its both neighbour vertices. Triangles are rejected for which:

  1. New added edge intersect other edges of the cells
  2. Basis vertex is concave
  3. Triangle area is larger than 0.51*(total cell area)

For each triangle which is not rejected the smallest angle is calculated. Triangle with the largest smallest angle is finally accepted.

Condition 3 is required to avoid the following situation:

       B         Here the algorithm may choose triangle ABC 
      / \        which leads to "flat" triangle ACD on the other side. 
     /   \       Condition S<0.51S_tot forces the algorithm to chose
    /     \      triangle ABD or BDC which leaves "non flat" rest 
   /___ ___\     of the cell
  A    D    C
Parameters
triaResulting triangular grid
gridInitial grid which is divided into triangles
[out]ierrError code

Definition at line 55 of file triang.f.

References gridman::gridman_dp, gridman_grid2d_chains(), gridman_grid2d_check(), gridman_grid_allocate(), gridman_grid_cells(), gridman_grid_check(), gridman_grid_take(), gridman_index_allocate(), gridman_index_copy(), gridman_indlist_allocate(), gridman_indlist_deallocate(), gridman_intersect2d(), gridman::gridman_sp, and gridman::gridman_unit.

Here is the call graph for this function: