SABER
tools_stripack Module Reference

Subroutines/functions list. More...

Data Types

interface  addnod
 
interface  area
 
interface  bdyadd
 
interface  bnodes
 
interface  covsph
 
interface  det
 
interface  insert
 
interface  intadd
 
interface  jrand
 
interface  left
 
interface  lstptr
 
interface  swap
 
interface  swptst
 
interface  trfind
 
interface  trmesh
 

Functions/Subroutines

subroutine stripack_addnod (mpl, nst, k, x, y, z, list, lptr, lend, lnew)
 Add a node to a triangulation. More...
 
subroutine stripack_area (v1, v2, v3, area)
 Compute the area of a spherical triangle. More...
 
subroutine stripack_bdyadd (kk, i1, i2, list, lptr, lend, lnew)
 Add a boundary node to a triangulation. More...
 
subroutine stripack_bnodes (n, list, lptr, lend, nodes, nb)
 Return the boundary nodes of a triangulation. More...
 
subroutine stripack_covsph (kk, n0, list, lptr, lend, lnew)
 Connect an exterior node to boundary nodes, covering the sphere. More...
 
subroutine stripack_det (x1, y1, z1, x2, y2, z2, x0, y0, z0, output)
 Compute 3D determinant. More...
 
subroutine stripack_insert (k, lp, list, lptr, lnew)
 Insert K as a neighbor of N1. More...
 
subroutine stripack_intadd (kk, i1, i2, i3, list, lptr, lend, lnew)
 Add an interior node to a triangulation. More...
 
subroutine stripack_jrand (n, ix, iy, iz, output)
 Return a random integer between 1 and N. More...
 
subroutine stripack_left (x1, y1, z1, x2, y2, z2, x0, y0, z0, output)
 Determine whether a node is to the left of a plane through the origin. More...
 
subroutine stripack_lstptr (lpl, nb, list, lptr, output)
 Return the index of NB in the adjacency list. More...
 
subroutine stripack_swap (in1, in2, io1, io2, list, lptr, lend, lp21)
 Replace the diagonal arc of a quadrilateral with the other diagonal. More...
 
subroutine stripack_swptst (n1, n2, n3, n4, x, y, z, output)
 Decide whether to replace a diagonal arc by the other. More...
 
subroutine stripack_trfind (nst, p, n, x, y, z, list, lptr, lend, b1, b2, b3, i1, i2, i3)
 Locate a point relative to a triangulation. More...
 
subroutine stripack_trmesh (mpl, n, x, y, z, list, lptr, lend, lnew, near, next, dist)
 Create a Delaunay triangulation on the unit sphere. More...
 

Detailed Description

Subroutines/functions list.

Instrumentation functions STRIPACK routines

Function/Subroutine Documentation

◆ stripack_addnod()

subroutine tools_stripack::stripack_addnod ( type(mpl_type), intent(inout)  mpl,
integer, intent(in)  nst,
integer, intent(in)  k,
real(kind_real), dimension(k), intent(in)  x,
real(kind_real), dimension(k), intent(in)  y,
real(kind_real), dimension(k), intent(in)  z,
integer, dimension(*), intent(inout)  list,
integer, dimension(*), intent(inout)  lptr,
integer, dimension(k), intent(inout)  lend,
integer, intent(inout)  lnew 
)
private

Add a node to a triangulation.

Parameters
[in,out]mplMPI data
[in]nstIndex of a node at which TRFIND, begins its search.Search time depends on the proximity of this node to K. If NST<1, the search is begun at node K-1.
[in]kNodal index (index for X, Y, Z, and LEND) of the new node to be added. 4<=K.
[in]xX-coordinates of the nodes
[in]yY-coordinates of the nodes
[in]zZ-coordinates of the nodes
[in,out]listOn input, the data structure associated with the triangulation of nodes 1 to K-1. On output, the data has been updated to include node K. The array lengths are assumed to be large enough to add node K. Refer to TRMESH.
[in,out]lptrcf. list
[in,out]lendcf. list
[in,out]lnewcf. list

Definition at line 99 of file tools_stripack.F90.

◆ stripack_area()

subroutine tools_stripack::stripack_area ( real(kind_real), dimension(3), intent(in)  v1,
real(kind_real), dimension(3), intent(in)  v2,
real(kind_real), dimension(3), intent(in)  v3,
real(kind_real), intent(out)  area 
)
private

Compute the area of a spherical triangle.

Parameters
[in]v1First point cartesian coordinates
[in]v2Second point cartesian coordinates
[in]v3Third point cartesian coordinates
[out]areaArea on the unit sphere

Definition at line 207 of file tools_stripack.F90.

◆ stripack_bdyadd()

subroutine tools_stripack::stripack_bdyadd ( integer, intent(in)  kk,
integer, intent(in)  i1,
integer, intent(in)  i2,
integer, dimension(*), intent(inout)  list,
integer, dimension(*), intent(inout)  lptr,
integer, dimension(*), intent(inout)  lend,
integer, intent(inout)  lnew 
)
private

Add a boundary node to a triangulation.

Parameters
[in]kkIndex of a node to be connected to the sequence of all visible boundary nodes. 1<=KK and KK must not be equal to I1 or I2.
[in]i1First (rightmost as viewed from KK) boundary node in the triangulation that is visible from node KK (the line segment KK-I1 intersects no arcs.
[in]i2Last (leftmost) boundary node that is visible from node KK. I1 and I2 may be determined by TRFIND.
[in,out]listTriangulation data structure created by TRMESH. Nodes I1 and I2 must be included in the triangulation. On output, the data structure is updated with the addition of node KK. Node KK is connected to I1, I2, and all boundary nodes in between.
[in,out]lptrcf. list
[in,out]lendcf. list
[in,out]lnewcf. list

Definition at line 288 of file tools_stripack.F90.

◆ stripack_bnodes()

subroutine tools_stripack::stripack_bnodes ( integer, intent(in)  n,
integer, dimension(6*(n-2)), intent(in)  list,
integer, dimension(6*(n-2)), intent(in)  lptr,
integer, dimension(n), intent(in)  lend,
integer, dimension(n), intent(out)  nodes,
integer, intent(out)  nb 
)
private

Return the boundary nodes of a triangulation.

Parameters
[in]nNumber of nodes in the triangulation. 3 <= N.
[in]listThe data structure defining the triangulation, created by TRMESH.
[in]lptrcf. list
[in]lendcf. list
[out]nodesOrdered sequence of NB boundary node indexes in the range 1 to N.
[out]nbNumber of boundary nodes.

Definition at line 364 of file tools_stripack.F90.

◆ stripack_covsph()

subroutine tools_stripack::stripack_covsph ( integer, intent(in)  kk,
integer, intent(in)  n0,
integer, dimension(*), intent(inout)  list,
integer, dimension(*), intent(inout)  lptr,
integer, dimension(*), intent(inout)  lend,
integer, intent(inout)  lnew 
)
private

Connect an exterior node to boundary nodes, covering the sphere.

Parameters
[in]kkIndex of the node to be connected to the set of all boundary nodes. 4<=KK.
[in]n0Index of a boundary node (in the range 1 to KK-1). N0 may be determined by TRFIND.
[in,out]listTriangulation data structure created by TRMESH. Node N0 must be included in the triangulation. On output, updated with the addition of node KK as the last entry. The updated triangulation contains no boundary nodes.
[in,out]lptrcf. list
[in,out]lendcf. list
[in,out]lnewcf. list

Definition at line 439 of file tools_stripack.F90.

◆ stripack_det()

subroutine tools_stripack::stripack_det ( real(kind_real), intent(in)  x1,
real(kind_real), intent(in)  y1,
real(kind_real), intent(in)  z1,
real(kind_real), intent(in)  x2,
real(kind_real), intent(in)  y2,
real(kind_real), intent(in)  z2,
real(kind_real), intent(in)  x0,
real(kind_real), intent(in)  y0,
real(kind_real), intent(in)  z0,
real(kind_real), intent(out)  output 
)
private

Compute 3D determinant.

Parameters
[in]x1X-coordinate, term 1
[in]y1Y-coordinate, term 1
[in]z1Z-coordinate, term 1
[in]x2X-coordinate, term 2
[in]y2Y-coordinate, term 2
[in]z2Z-coordinate, term 2
[in]x0X-coordinate, term 0
[in]y0Y-coordinate, term 0
[in]z0Z-coordinate, term 0
[out]outputDeterminant

Definition at line 496 of file tools_stripack.F90.

◆ stripack_insert()

subroutine tools_stripack::stripack_insert ( integer, intent(in)  k,
integer, intent(in)  lp,
integer, dimension(*), intent(inout)  list,
integer, dimension(*), intent(inout)  lptr,
integer, intent(inout)  lnew 
)
private

Insert K as a neighbor of N1.

Parameters
[in]kIndex of the node to be inserted.
[in]lpLIST pointer of N2 as a neighbor of N1.
[in,out]listTriangulation data structure created by TRMESH. On output, updated with the addition of node K.
[in,out]lptrcf. list
[in,out]lnewcf. list

Definition at line 541 of file tools_stripack.F90.

◆ stripack_intadd()

subroutine tools_stripack::stripack_intadd ( integer, intent(in)  kk,
integer, intent(in)  i1,
integer, intent(in)  i2,
integer, intent(in)  i3,
integer, dimension(*), intent(inout)  list,
integer, dimension(*), intent(inout)  lptr,
integer, dimension(*), intent(inout)  lend,
integer, intent(inout)  lnew 
)
private

Add an interior node to a triangulation.

Parameters
[in]kkIndex of the node to be inserted. 1<=KK and KK must not be equal to I1, I2, or I3.
[in]i1First index of the counterclockwise-ordered sequence of vertices of a triangle which contains node KK.
[in]i2Second index.
[in]i3Third index.
[in,out]listTriangulation data structure created by TRMESH. Triangle (I1,I2,I3) must be included in the triangulation. On output, updated with the addition of node KK. KK will be connected to nodes I1, I2, and I3.
[in,out]lptrcf. list
[in,out]lendcf. list
[in,out]lnewcf. list

Definition at line 576 of file tools_stripack.F90.

◆ stripack_jrand()

subroutine tools_stripack::stripack_jrand ( integer, intent(in)  n,
integer, intent(inout)  ix,
integer, intent(inout)  iy,
integer, intent(inout)  iz,
integer, intent(out)  output 
)
private

Return a random integer between 1 and N.

Parameters
[in]nMaximum value to be returned.
[in,out]ixFirst seed initialized to values in the range 1 to 30,000 before the first call to JRAND, and not altered between subsequent calls (unless a sequence of random numbers is to be repeated by reinitializing the seeds).
[in,out]iySecond seed.
[in,out]izThird seed.
[out]outputA random integer in the range 1 to N.

Definition at line 632 of file tools_stripack.F90.

◆ stripack_left()

subroutine tools_stripack::stripack_left ( real(kind_real), intent(in)  x1,
real(kind_real), intent(in)  y1,
real(kind_real), intent(in)  z1,
real(kind_real), intent(in)  x2,
real(kind_real), intent(in)  y2,
real(kind_real), intent(in)  z2,
real(kind_real), intent(in)  x0,
real(kind_real), intent(in)  y0,
real(kind_real), intent(in)  z0,
logical, intent(out)  output 
)
private

Determine whether a node is to the left of a plane through the origin.

Parameters
[in]x1X-coordinate, term 1
[in]y1Y-coordinate, term 1
[in]z1Z-coordinate, term 1
[in]x2X-coordinate, term 2
[in]y2Y-coordinate, term 2
[in]z2Z-coordinate, term 2
[in]x0X-coordinate, term 0
[in]y0Y-coordinate, term 0
[in]z0Z-coordinate, term 0
[out]outputTRUE if and only if N0 is in the closed left hemisphere.

Definition at line 677 of file tools_stripack.F90.

◆ stripack_lstptr()

subroutine tools_stripack::stripack_lstptr ( integer, intent(in)  lpl,
integer, intent(in)  nb,
integer, dimension(*), intent(in)  list,
integer, dimension(*), intent(in)  lptr,
integer, intent(out)  output 
)
private

Return the index of NB in the adjacency list.

Parameters
[in]lplEqual to LEND(N0).
[in]nbIndex of the node whose pointer is to be returned. NB must be connected to N0.
[in]listTriangulation data structure created by TRMESH. Triangle (I1,I2,I3) must be included in the triangulation. On output, updated with the addition of node KK. KK will be connected to nodes I1, I2, and I3.
[in]lptrcf. list
[out]outputPointer such that LIST(output) = NB or LIST(output) = -NB, unless NB is not a neighbor of N0, in which case output = LPL.

Definition at line 715 of file tools_stripack.F90.

◆ stripack_swap()

subroutine tools_stripack::stripack_swap ( integer, intent(in)  in1,
integer, intent(in)  in2,
integer, intent(in)  io1,
integer, intent(in)  io2,
integer, dimension(*), intent(inout)  list,
integer, dimension(*), intent(inout)  lptr,
integer, dimension(*), intent(inout)  lend,
integer, intent(out)  lp21 
)
private

Replace the diagonal arc of a quadrilateral with the other diagonal.

Parameters
[in]in1First nodal index of the vertices of the quadrilateral. IO1-IO2 is replaced by IN1-IN2. (IO1,IO2,IN1) and (IO2,IO1,IN2) must be triangles on input.
[in]in2Second nodal index.
[in]io1Third nodal index.
[in]io2Fourth nodal index.
[in,out]listTriangulation data structure created by TRMESH. On output, updated with the swap; triangles (IO1,IO2,IN1) an (IO2,IO1,IN2) are replaced by (IN1,IN2,IO2) and (IN2,IN1,IO1) unless LP21 = 0.
[in,out]lptrcf. list
[in,out]lendcf. list
[out]lp21Index of IN1 as a neighbor of IN2 after the swap is performed unless IN1 and IN2 are adjacent on input, in which case LP21 = 0.

Definition at line 755 of file tools_stripack.F90.

◆ stripack_swptst()

subroutine tools_stripack::stripack_swptst ( integer, intent(in)  n1,
integer, intent(in)  n2,
integer, intent(in)  n3,
integer, intent(in)  n4,
real(kind_real), dimension(*), intent(in)  x,
real(kind_real), dimension(*), intent(in)  y,
real(kind_real), dimension(*), intent(in)  z,
logical, intent(out)  output 
)
private

Decide whether to replace a diagonal arc by the other.

Parameters
[in]n1First index of the four nodes defining the quadrilateral with N1 adjacent to N2, and (N1,N2,N3) in counterclockwise order. The arc connecting N1 to N2 should be replaced by an arc connecting N3 to N4 if SWPTST = TRUE. Refer to subroutine SWAP.
[in]n2Second index.
[in]n3Third index.
[in]n4Fourth index.
[in]xX-coordinate of the nodes.
[in]yY-coordinate of the nodes.
[in]zZ-coordinate of the nodes.
[out]outputTRUE if and only if the arc connecting N1 and N2 should be swapped for an arc connecting N3 and N4.

Definition at line 826 of file tools_stripack.F90.

◆ stripack_trfind()

subroutine tools_stripack::stripack_trfind ( integer, intent(in)  nst,
real(kind_real), dimension(3)  p,
integer, intent(in)  n,
real(kind_real), dimension(n), intent(in)  x,
real(kind_real), dimension(n), intent(in)  y,
real(kind_real), dimension(n), intent(in)  z,
integer, dimension(*), intent(in)  list,
integer, dimension(*), intent(in)  lptr,
integer, dimension(*), intent(in)  lend,
real(kind_real), intent(out)  b1,
real(kind_real), intent(out)  b2,
real(kind_real), intent(out)  b3,
integer, intent(out)  i1,
integer, intent(out)  i2,
integer, intent(out)  i3 
)
private

Locate a point relative to a triangulation.

Parameters
[in]nstIndex of a node at which TRFIND begins its search. Search time depends on the proximity of this node to P.
pX, Y, and Z coordinates (in that order) of the point P to be located.
[in]nNumber of nodes in the triangulation 3<=N.
[in]xX-coordinate of the triangulation nodes (unit vector).
[in]yY-coordinate of the triangulation nodes (unit vector).
[in]zZ-coordinate of the triangulation nodes (unit vector).
[in]listTriangulation data structure created by TRMESH.
[in]lptrcf. list
[in]lendcf. list
[out]b1First unnormalized barycentric coordinate of the central projection of P onto the underlying planar triangle if P is in the convex hull of the nodes. These parameters are not altered if I1 = 0.
[out]b2Second unnormalized barycentric coordinate.
[out]b3Third unnormalized barycentric coordinate.
[out]i1First counterclockwise-ordered vertex index of a triangle containing P if P is contained in a triangle. If P is not in the convex hull of the nodes, I1 and I2 are the rightmost and leftmost (boundary) nodes that are visible from P, and I3 = 0. (If all boundary nodes are visible from P, then I1 and I2 coincide.) I1 = I2 = I3 = 0 if P and all of the nodes are coplanar (lie on a common great circle).
[out]i2Second counterclockwise-ordered vertex index.
[out]i3Third counterclockwise-ordered vertex index.

Definition at line 875 of file tools_stripack.F90.

◆ stripack_trmesh()

subroutine tools_stripack::stripack_trmesh ( type(mpl_type), intent(inout)  mpl,
integer, intent(in)  n,
real(kind_real), dimension(n), intent(in)  x,
real(kind_real), dimension(n), intent(in)  y,
real(kind_real), dimension(n), intent(in)  z,
integer, dimension(6*(n-2)), intent(out)  list,
integer, dimension(6*(n-2)), intent(out)  lptr,
integer, dimension(n), intent(out)  lend,
integer, intent(out)  lnew,
integer, dimension(n), intent(inout)  near,
integer, dimension(n), intent(inout)  next,
real(kind_real), dimension(n), intent(inout)  dist 
)
private

Create a Delaunay triangulation on the unit sphere.

Parameters
[in,out]mplMPI data
[in]nNumber of nodes in the triangulation. 3<=N.
[in]xX-coordinate of distinct nodes. (X(K),Y(K), Z(K)) is referred to as node K, and K is referred to as a nodal index. It is required that X(K)**2+Y(K)**2+Z(K)**2 = 1 for all K. The first three nodes must not be colinear (lie on a common great circle).
[in]yY-coordinate of distinct nodes.
[in]zZ-coordinate of distinct nodes.
[out]listNodal indexes which, along with LPTR, LEND, and LNEW, define the triangulation as a set of N adjacency lists; counterclockwise-ordered sequences of neighboring nodes such that the first and last neighbors of a boundary node are boundary nodes (the first neighbor of an interior node is arbitrary). In order to distinguish between interior and boundary nodes, the last neighbor of each boundary node is represented by the negative of its index.
[out]lptrSet of pointers (LIST indexes) in one-to-one correspondence with the elements of LIST. LIST(LPTR(I)) indexes the node which follows LIST(I) in cyclical counterclockwise order (the first neighbor follows the last neighbor).
[out]lendPointers to adjacency lists. LEND(K) points to the last neighbor of node K. LIST(LEND(K))<0 if and only if K is a boundary node.
[out]lnewPointer to the first empty location in LIST and LPTR (list length plus one).
[in,out]nearWorkspace used to efficiently determine the nearest triangulation node to each unprocessed node for use by ADDNOD.
[in,out]nextWorkspace used to efficiently determine the nearest triangulation node to each unprocessed node for use by ADDNOD.
[in,out]distWorkspace used to efficiently determine the nearest triangulation node to each unprocessed node for use by ADDNOD.

Definition at line 1157 of file tools_stripack.F90.