Program: MKLSGRIDIDEXPANDTRI
mklsgrididexpand.......follows ID tree down to decendants with nodes
call: newidlist=mklsgrididexpandtri(lsopt,grid,idlist);
lsopt: (struct)
LOCSMITH options structure as returned by MKLSOPT
grid: (struct)
LOCSMITH search grid as returned by MKGRIDNEW
idlist: (struct array)
A struture variable that defines the layers and
triangles to be modified. The following fields are
expected:
.layer: (numeric)
layer ID, only one per element of IDLIST.
.triangle: (numeric array)
list of triangle IDs
If this is the empty matrix [], all
triangles with node-children will be
returned in NEWIDLIST.
IDLIST is not allowed to be an array: it may define
only one layer. Handling multiple layers must be
done in an external loop.
result: newidlist: (struct array)
structure variable of the same kind as IDLIST, but the
triangles specified here all have node as children.
.layer: (numeric)
The same ID as in idlist.layer.
.triangle: (numeric array)
IDs of triangles that have nodes as children
are copied directly from idlist.triangle.
IDs of triangles that have other triangles as
children are replaced by the IDs of those
triangles that are at the end of the triangle
tree and also have only nodes as children.
This routine transforms a list of triangles of both types into a list of
triangles to which iteration may be applied directly by constructing new
nodes. This routine in non-recursive, although the problem suggests to
write a reursive algorithm.
Martin Knapmeyer, 24.09.2004
Read M-File Source Code
eof.