sdr_node_type Derived Type

type, public :: sdr_node_type

This data type describes a node in the tree to be created.


Inherits

type~~sdr_node_type~~InheritsGraph type~sdr_node_type sdr_node_type type~grw_int2darray_type grw_int2darray_type type~sdr_node_type->type~grw_int2darray_type PropertyBits type~grw_intarray_type grw_intarray_type type~sdr_node_type->type~grw_intarray_type hasBndBits, minBCID, intersected_object, intersected_distance, minLevel, linkpos, sublevel type~grw_intersectobjposarray_type grw_intersectobjposarray_type type~sdr_node_type->type~grw_intersectobjposarray_type userObjPos, distObjPos type~dyn_longarray_type dyn_longarray_type type~sdr_node_type->type~dyn_longarray_type treeID type~sdr_intersectobjpos_type sdr_intersectObjPos_type type~grw_intersectobjposarray_type->type~sdr_intersectobjpos_type val

Inherited by

type~~sdr_node_type~~InheritedByGraph type~sdr_node_type sdr_node_type type~sdr_prototree_type sdr_protoTree_type type~sdr_prototree_type->type~sdr_node_type node

Contents


Components

TypeVisibilityAttributesNameInitial
integer, private :: nNodes =0

Number of nodes in this list.

integer, private :: propLength =1

Number of integers to encode the properties. This depends on the number of colors and defines the size of the the first dimension (width) in the grw_int2dArray propertyBits.

integer, private :: bytes_per_int

Auxilary value to provide the number of bytes available per integer in the propertybits.

integer, private :: lastbyte_pos

Indicator for the starting bit of the last byte in the propertybits.

integer, private :: nColors

Counter for the number of colors in the mesh.

integer, private :: none_color_id

Id of the 'none' color, this color will not be considered in the final color information for treelm.

If there is no 'none' color this will be -1, otherwise it is the id of the color with the label 'none' in the unique list of color labels.

integer, private :: nColorChars

Number of characters needed to hold all colors.

integer, private :: subelement_resolution

Number of levels, that need to be further refined for colors with subelement resolution.

If there are no colors with subelement resolution at all, this setting is 0.

logical, private :: distanceRefine =.false.

True if distance refine objects are created for boundary attribute.

If there is no distance refine object then no need to append distance_first and distance_last for every node

type(dyn_longarray_type), private :: treeID

List of treeIDs for all the nodes in the built tree.

We are exploiting here the fact, that new nodes are created in order level by level. Therefore, it is not necessary to use an additional index list to maintain the ranking of the entries, as it is done in the dyn_arrays.

type(grw_int2darray_type), private :: PropertyBits

The property bits can be used to attach various information to the element. They can span multiple integers (width of the 2d growing array) and all bytes except the very last one are used to encode colors (1 byte per color).

In the last byte other properties are encoded (Bits 0-7) of last byte. (The last byte is given by ibits(PropertyBits%val(propLength,iNode), pos=bit_size(int)-8, len=8)) The following bits are used: Bit 0: NoSolidification is set, if solidification is not allowed for node Bit 1: isLeaf Bit is set, if there are no further descendants Bit 2: IntersectsBoundaries, is set, if the element intersects boundaries Bit 3: IntersectsAll Set, if all objects are seperate intersected_object Bit 4: isFluidifyable is set, if the node is fluidifyable. Bit 5: isFlooded is set, if node is flooded by any color. Bit 6: isColored is set, if there is another than the none color in the node. Bit 7: isTarget is set, if this node should be in the final mesh, even so it has further children.

To encode a color, we need a representation for each of the 6 sides and one for the volume, resulting in a total of 7 bits for each color. Thus, a complete Byte is used for each color. The first color is stored in the first Byte of the first integer and the other follow consecutively. Ordering of the sides as given by the definition described for the linkPos component. We also need to store intersections on a per color basis, as we want to get the flooding stopped by differently colored boundaries. The layout of the bits for each color ar therefore: Bit 0: intersects a relevant geometry (same color or geom. color = -1) Bit 1: node is flooded with this color Bit 2-7: colored wetness of the 6 node sides

type(grw_intarray_type), private :: hasBndBits

Store which of 26 directions of node has boundary. Uses first 26 bits of the integer with each bit corresponds to treelm direction given by qOffset in tem_param_module

type(grw_intarray_type), private :: minBCID

Minimum boundary ID intersect by the node

Used to set boundaryID based on thuming rule when a node is intersected by more than one boundary object

type(grw_intarray_type), private :: intersected_object

List of all objects intersecting this node.

If children are created for this node, the number of children with intersected objects thats fits in to the memory of its parent starting from child with highest number of intersected object will be copied to the memory position of its parent to save memory.

type(grw_intersectobjposarray_type), private :: userObjPos

First and last position of this node's intersected objects in growing array of intersected_object

type(grw_intarray_type), private :: intersected_distance

List of all sphere_distance objects intersecting this node

type(grw_intersectobjposarray_type), private :: distObjPos

First and last position of this node's intersected distance refine objects in growing array of intersected_distance

integer, private :: memLeft_userObj

Memory unused by children from parent intersected object list

integer, private :: memLeft_distObj

Memory unused by children from parent intersected distance list

type(grw_intarray_type), private :: minLevel

minLevel for each node. Used in refineleaf and inherit distance refine object. If intersected object level is <= minLevel then that object is not added to intersected object list for children. This should reduce memory to inHerit lot of intersected objects to children

type(grw_intarray_type), private :: linkpos(6)

This is used to store the location of the 6 neighbors for leaf nodes and the first child for virtual nodes at linkpos(1).

1: neighbor x-1 / first child node 2: neighbor x+1 3: neighbor y-1 4: neighbor y+1 5: neighbor z-1 6: neighbor z+1

type(grw_intarray_type), private :: sublevel

If subelement resolution is required, the sublevel keeps track of how deep the subelement resolution is below the target element.

For nodes above isTarget nodes it is set to a negative value. In the target node it is set to the subelement_resolution. On each level this counter is decreased by 1, when passing it on to the children. Boundaries, that require subelement resolution will stop in refinement, when sublevel has reached 0, or if a total level of 20 is reached. If subelement_resolution is 0, this array is not used (and not allocated).