delaunay_tri_2d Derived Type

type, public :: delaunay_tri_2d

Provides a container for a 2D Delaunay triangulation.


Contents


Type-Bound Procedures

procedure, public :: create => d2d_init

  • private subroutine d2d_init(this, x, y, err)

    Creates an unconstrained 2D Delaunay triangulation given a set of x-y points.

    Arguments

    Type IntentOptional Attributes Name
    class(delaunay_tri_2d), intent(inout) :: this

    The delaunay_tri_2d object.

    real(kind=real64), intent(in), dimension(:) :: x

    An N-element array containing the x-coordinates of each data point.

    real(kind=real64), intent(in), dimension(:) :: y

    An N-element array containing the y-coordinates of each data point.

    class(errors), intent(inout), optional, target :: err

    An error handling object.

procedure, public :: find_triangle => d2d_get_tri_with_pt

  • private pure function d2d_get_tri_with_pt(this, x, y) result(rst)

    Finds the triangle that contains the specified point.

    Arguments

    Type IntentOptional Attributes Name
    class(delaunay_tri_2d), intent(in) :: this

    The delaunay_tri_2d object.

    real(kind=real64), intent(in) :: x

    The x-coordinate of the point.

    real(kind=real64), intent(in) :: y

    The y-coordinate of the point.

    Return Value integer(kind=int32)

    Returns the index of the triangle containing the specified point. If no triangle contains the specified point, a value of -1 is returned.

procedure, public :: get_indices => d2d_get_tris

  • private pure function d2d_get_tris(this) result(rst)

    Gets a list of the indices of each triangle vertex.

    Arguments

    Type IntentOptional Attributes Name
    class(delaunay_tri_2d), intent(in) :: this

    The delaunay_tri_2d object.

    Return Value integer(kind=int32), allocatable, dimension(:,:)

    An N-by-3 matrix with each column containing the index of the vertex of each triangle where N is the number of triangles.

procedure, public :: get_point_count => d2d_get_pt_count

  • private pure function d2d_get_pt_count(this) result(rst)

    Gets the number of points in the triangulation.

    Arguments

    Type IntentOptional Attributes Name
    class(delaunay_tri_2d), intent(in) :: this

    The delaunay_tri_2d object.

    Return Value integer(kind=int32)

    The number of points in the triangulation.

procedure, public :: get_points_x => d2d_get_x_pts

  • private pure function d2d_get_x_pts(this) result(rst)

    Gets the x-coordinates of each point.

    Arguments

    Type IntentOptional Attributes Name
    class(delaunay_tri_2d), intent(in) :: this

    The delaunay_tri_2d object.

    Return Value real(kind=real64), allocatable, dimension(:)

    An array of the x-coordinates of each point.

procedure, public :: get_points_y => d2d_get_y_pts

  • private pure function d2d_get_y_pts(this) result(rst)

    Gets the y-coordinates of each point.

    Arguments

    Type IntentOptional Attributes Name
    class(delaunay_tri_2d), intent(in) :: this

    The delaunay_tri_2d object.

    Return Value real(kind=real64), allocatable, dimension(:)

    An array of the y-coordinates of each point.

procedure, public :: get_triangle_count => d2d_get_tri_count

  • private pure function d2d_get_tri_count(this) result(rst)

    Gets the number of triangles in the triangulation.

    Arguments

    Type IntentOptional Attributes Name
    class(delaunay_tri_2d), intent(in) :: this

    The delaunay_tri_2d object.

    Return Value integer(kind=int32)

    The number of triangles in the triangulation.