This module provides the description of the evolving tree, as it is built up to match the given geometry.
The concept used here, is a proposal for an algorithm, following a level-wise iterative approach instead of an recursive one. This is better suited for parallel processing. Also it tries to follow more closely the principals from tem_construction and the solver layout. That is, treating seeder more like a solver in itself.
For flooding a concept of wet sides on coarser levels is used, all elements need to track just a single neighbor in each direction in this case. And the coarse ghost elements take care of flooding their children accordingly themselves.
The protoTree is used to describe the preliminary tree, before it is actually extended to the full information of the mesh.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private | :: | nLevels | Keep track of the deepest level in the tree. |
|||
integer, | private | :: | nLeafNodes | Number of leaf nodes. |
|||
integer, | private | :: | nFloodedLeaves | Number of flooded leaves. |
|||
type(sdr_node_type), | private | :: | node | List of all nodes in the tree, each node contains a list of the objects it is intersecting and a property bit mask. It is identified by its treeID. |
|||
integer, | private | :: | levelNode_first(0:globalMaxLevels) | The index of the first node on a given level in node%treeID%sorted. |
|||
integer, | private | :: | levelNode_last(0:globalMaxLevels) | The index of the last node on a given level in node%treeID%sorted. |
|||
type(grw_intarray_type), | private | :: | child_intersected_object | Temporary array intersected objects of 8 children which will later be copied to intersected_object in node_type. |
Auxilary data type to provide data on the current level iteration.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=long_k), | private | :: | ID_offset | First treeID on current level |
|||
real(kind=rk), | private | :: | dx | Node cube length on current level |
|||
integer, | private | :: | level | Number of the level itself. |
This routine identifies the 6 direct neighbors of a node in the prototree
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sdr_protoTree_type), | intent(in) | :: | me | neighbors are identified for this tree and neighbor of each node are stored at link_pos of each node in node_data type |
||
integer(kind=long_k), | intent(in), | optional | :: | level_offset | First treeID on level |
|
integer, | intent(in) | :: | iNode | Node position in protoTree |
||
integer, | intent(in), | optional | :: | coord(4) | if coord is present, no need to compute using tem_coordOfID |
Find the neighbor position in protoTree for iDir on the same level or on any one above.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sdr_protoTree_type), | intent(in) | :: | proto | preliminary tree |
||
integer, | intent(in) | :: | coord(4) | |||
integer, | intent(in) | :: | iDir | |||
integer, | intent(out) | :: | neighbor_level |
Small helping routine to get the variable data from a leaf.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | node_pos | |||
type(sdr_protoTree_type), | intent(in) | :: | proto | |||
type(sdr_geometry_type), | intent(in) | :: | geometry | |||
integer, | intent(in) | :: | level |
This routine builds the preliminary tree with geometry intersection and neighbor identification
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sdr_protoTree_type), | intent(out) | :: | me | preliminary tree created by this routine |
||
type(sdr_geometry_type), | intent(inout) | :: | geometry | type which contains all geometry object infos |
||
type(sdr_confHead_type), | intent(inout) | :: | header | some global information on solver name and version |
Write current leaves of the prototree as treelm restart.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sdr_protoTree_type), | intent(in) | :: | proto | The prototree to output. |
||
type(sdr_geometry_type), | intent(in) | :: | geometry | Bounding cube, the prototree lives in. |
||
integer, | intent(in) | :: | itime | wave number in character format to prepend to filenames and timestamp |
||
type(sdr_confHead_type), | intent(in) | :: | header | some global information on solver name and version |
||
character(len=*), | intent(in), | optional | :: | prefix | prefix for filenames |
This routine creates children for each parent if children intersect with boundary object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sdr_protoTree_type), | intent(inout) | :: | me | preliminary tree on which childern are created |
||
integer, | intent(in) | :: | parent | Position of parent node on the growing array of node_treeID and node_data in preliminary tree |
||
type(sdr_geometry_type), | intent(in) | :: | geometry | type which contains all geometry object infos |
||
type(levelValues_type), | intent(in) | :: | leVal | contains information on current level on which children are created |
||
logical, | intent(in) | :: | testAll | testAll objects only for root node |
||
integer, | intent(in) | :: | minlevel |
Small helping routine to keep track of leaf nodes.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sdr_protoTree_type), | intent(inout) | :: | me | Property bit mask to set the leaf bit in |
||
integer, | intent(in) | :: | node_pos |
This routine marks 26 direct neighbors as has boundary bit
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sdr_protoTree_type), | intent(inout) | :: | proto | neighbors are identified for this tree and neighbors as marked with hasBoundary_bit |
||
integer, | intent(in) | :: | coord(4) | Coordinate of current node |
Small helping routine to write leaves in order into a treelmesh formatted file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | meshunit | |||
integer, | intent(in) | :: | restunit | |||
integer, | intent(inout) | :: | iLeaf | |||
integer, | intent(in) | :: | node_pos | |||
type(sdr_protoTree_type), | intent(in) | :: | proto | |||
type(sdr_geometry_type), | intent(in) | :: | geometry | |||
integer, | intent(in) | :: | level |