Skip to content

fossil_aabb_tree_object

FOSSIL, Axis-Aligned Bounding Box (AABB) tree class definition.

@note The tree is assumed to be an octree.

Source: src/lib/fossil_aabb_tree_object.f90

Dependencies

Contents

Variables

NameTypeAttributesDescription
TREE_RATIOinteger(kind=I4P)parameterTree refinement ratio, it is assumed to be an octree.
octree_fsmtype(ofsm)

Derived Types

ofsm

Octree Finite State Machine class for efficient searching of neiighbors.

Components

NameTypeAttributesDescription
octantinteger(kind=I4P)Octant ID, [1,2,3,4,5,6,7,8].
directioninteger(kind=I4P)Direction, 0=Halt, 1=X+, 2=X-, 3=Y+, 4=Y-, 5=Z+, 6=Z-.

aabb_tree_object

FOSSIL Axis-Aligned Bounding Box (AABB) tree class.

@note The tree is assumed to be an octree. The octree uses a breath-leaf counting, with the following convention:


#### Components

| Name | Type | Attributes | Description |
|------|------|------------|-------------|
| `refinement_levels` | integer(kind=[I4P](/api/src/third_party/PENF/src/lib/penf_global_parameters_variables)) |  | +----+----+ |
| `nodes_number` | integer(kind=[I4P](/api/src/third_party/PENF/src/lib/penf_global_parameters_variables)) |  | Total number of tree nodes. |
| `node` | type([aabb_node_object](/api/src/lib/fossil_aabb_node_object#aabb-node-object)) | allocatable | AABB tree nodes [0:nodes_number-1]. |
| `is_initialized` | logical |  | Sentinel to check is AABB tree is initialized. |

#### Type-Bound Procedures

| Name | Attributes | Description |
|------|------------|-------------|
| `compute_vertices_nearby` | pass(self) | Compute vertices nearby. |
| `destroy` | pass(self) | Destroy AABB tree. |
| `distance` | pass(self) | Return the (minimum) distance from point to triangulated surface. |
| `distance_tree` | pass(self) | Return the (minimum) distance from point to triangulated surface. |
| `distribute_facets` | pass(self) | Distribute facets into AABB nodes. |
| `distribute_facets_tree` | pass(self) | Distribute facets into AABB nodes. |
| `has_children` | pass(self) | Return true if node has at least one child allocated. |
| `initialize` | pass(self) | Initialize AABB tree. |
| `loop_node` | pass(self) | Loop over all nodes. |
| `ray_intersections_number` | pass(self) | Return ray intersections number. |
| `save_geometry_tecplot_ascii` | pass(self) | Save AABB tree boxes geometry into Tecplot ascii file. |
| `translate` | pass(self) | Translate AABB tree by delta. |
| `assignment(=)` |  | Overload `=`. |
| `aabb_tree_assign_aabb_tree` | pass(lhs) | Operator `=`. |
| `distance_node` | pass(self) | Return the (minimum) distance from point to node AABB tree. |
| `ray_intersections_number_node` | pass(self) | Return ray intersections number into a node of AABB tree. |

## Subroutines

### compute_vertices_nearby

Compute vertices nearby.

**Attributes**: pure

```fortran
subroutine compute_vertices_nearby(self, facet, tolerance_to_be_identical, tolerance_to_be_nearby)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_tree_object)inAABB tree.
facettype(facet_object)inoutFacets list.
tolerance_to_be_identicalreal(kind=R8P)inTolerance to identify identical vertices.
tolerance_to_be_nearbyreal(kind=R8P)inTolerance to identify nearby vertices.

Call graph

destroy

Destroy AABB tree.

Attributes: elemental

fortran
subroutine destroy(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_tree_object)inoutAABB tree.

Call graph

distribute_facets

Distribute facets into AABB nodes.

Attributes: pure

fortran
subroutine distribute_facets(self, facet, is_exclusive, do_update_extents)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_tree_object)inoutAABB tree.
facettype(facet_object)inFacets list.
is_exclusivelogicalinoptionalSentinel to enable/disable exclusive addition.
do_update_extentslogicalinoptionalSentinel to enable/disable AABB extents update.

Call graph

distribute_facets_tree

Distribute facets into AABB nodes.

Attributes: pure

fortran
subroutine distribute_facets_tree(self, facet)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_tree_object)inoutAABB tree.
facettype(facet_object)inFacets list.

Call graph

initialize

Initialize AABB tree.

Attributes: pure

fortran
subroutine initialize(self, refinement_levels, facet, largest_edge_len, bmin, bmax, do_facets_distribute, is_exclusive, do_update_extents)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_tree_object)inoutAABB tree.
refinement_levelsinteger(kind=I4P)inoptionalAABB refinement levels.
facettype(facet_object)inoptionalFacets list.
largest_edge_lenreal(kind=R8P)inoptionalLargest edge lenght.
bmintype(vector_R8P)inoptionalMinimum point of AABB.
bmaxtype(vector_R8P)inoptionalMaximum point of AABB.
do_facets_distributelogicalinoptionalSentinel to enable/disable facets distribution.
is_exclusivelogicalinoptionalSentinel to enable/disable exclusive addition.
do_update_extentslogicalinoptionalSentinel to enable/disable AABB extents update.

Call graph

save_geometry_tecplot_ascii

Save AABB tree boxes geometry into Tecplot ascii file.

fortran
subroutine save_geometry_tecplot_ascii(self, file_name)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_tree_object)inAABB tree.
file_namecharacter(len=*)inFile name.

Call graph

translate

Translate AABB tree by delta.

Attributes: elemental

fortran
subroutine translate(self, delta)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_tree_object)inoutAABB.
deltatype(vector_R8P)inDelta of translation.

Call graph

aabb_tree_assign_aabb_tree

Operator =.

Attributes: pure

fortran
subroutine aabb_tree_assign_aabb_tree(lhs, rhs)

Arguments

NameTypeIntentAttributesDescription
lhsclass(aabb_tree_object)inoutLeft hand side.
rhstype(aabb_tree_object)inRight hand side.

Call graph

next_location_code

Return the node next along a given direction.

Attributes: pure

fortran
subroutine next_location_code(location_code, direction, next_code, next_direction)

Arguments

NameTypeIntentAttributesDescription
location_codeinteger(kind=I4P)inLocation code queried.
directioninteger(kind=I4P)inDirection, 0=Halt, 1=X+, 2=X-, 3=Y+, 4=Y-, 5=Z+, 6=Z-.
next_codeinteger(kind=I4P)outallocatableNext location code of node along given direction.
next_directioninteger(kind=I4P)outNext direction.

Functions

distance

Compute the (minimum) distance from a point to the triangulated surface.

Attributes: pure

Returns: real(kind=R8P)

fortran
function distance(self, facet, point)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_tree_object)inAABB tree.
facettype(facet_object)inFacets list.
pointtype(vector_R8P)inPoint coordinates.

Call graph

distance_tree

Compute the (minimum) distance from a point to the triangulated surface.

Returns: real(kind=R8P)

fortran
function distance_tree(self, facet, point) result(distance)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_tree_object)inAABB tree.
facettype(facet_object)inFacets list.
pointtype(vector_R8P)inPoint coordinates.

Call graph

has_children

Return true if node has at least one child allocated.

Attributes: pure

Returns: logical

fortran
function has_children(self, node)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_tree_object)inAABB tree.
nodeinteger(kind=I4P)inNode queried.

Call graph

loop_node

Loop over all nodes.

@note Impure function: return data of each allocated node exploiting saved local counter.

Returns: logical

fortran
function loop_node(self, facet, aabb_facet, b, l) result(again)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_tree_object)inAABB tree.
facettype(facet_object)inoptionalWhole facets list.
aabb_facettype(facet_object)outallocatable, optionalAABB facets list.
binteger(kind=I4P)outoptionalCurrent AABB ID.
linteger(kind=I4P)outoptionalCurrent AABB level.

Call graph

ray_intersections_number

Return ray intersections number.

Returns: integer(kind=I4P)

fortran
function ray_intersections_number(self, facet, ray_origin, ray_direction) result(intersections_number)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_tree_object)inAABB tree.
facettype(facet_object)inFacets list.
ray_origintype(vector_R8P)inRay origin.
ray_directiontype(vector_R8P)inRay direction.

Call graph

distance_node

Return the (minimum) distance from a point to a node of AABB tree.

Attributes: recursive

Returns: real(kind=R8P)

fortran
function distance_node(self, n, facet, point) result(distance)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_tree_object)inAABB tree.
ninteger(kind=I4P)inCurrent AABB node.
facettype(facet_object)inFacets list.
pointtype(vector_R8P)inPoint coordinates.

Call graph

ray_intersections_number_node

Return ray intersections number into a node of AABB tree.

Attributes: recursive

Returns: integer(kind=I4P)

fortran
function ray_intersections_number_node(self, n, facet, ray_origin, ray_direction) result(intersections_number)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_tree_object)inAABB tree.
ninteger(kind=I4P)inCurrent AABB node.
facettype(facet_object)inFacets list.
ray_origintype(vector_R8P)inRay origin.
ray_directiontype(vector_R8P)inRay direction.

Call graph

first_child_node

Return first child tree node.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function first_child_node(node)

Arguments

NameTypeIntentAttributesDescription
nodeinteger(kind=I4P)inNode queried.

Call graph

first_node

Return first tree node at a given level.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function first_node(level)

Arguments

NameTypeIntentAttributesDescription
levelinteger(kind=I4P)inRefinement level queried.

Call graph

last_node

Return last tree node at a given level.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function last_node(level)

Arguments

NameTypeIntentAttributesDescription
levelinteger(kind=I4P)inRefinement level queried.

Call graph

level

Return level given a node id.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function level(node)

Arguments

NameTypeIntentAttributesDescription
nodeinteger(kind=I4P)inNode queried.

local_id

Return local ID of node.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function local_id(node)

Arguments

NameTypeIntentAttributesDescription
nodeinteger(kind=I4P)inNode queried.

Call graph

location_code

Return location code of node.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function location_code(node)

Arguments

NameTypeIntentAttributesDescription
nodeinteger(kind=I4P)inNode queried.

Call graph

global_id

Return node ID given a location code.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function global_id(location_code) result(node)

Arguments

NameTypeIntentAttributesDescription
location_codeinteger(kind=I4P)inLocation code.

Call graph

nodes_number

Return total number of tree nodes given the total number refinement levels used.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function nodes_number(refinement_levels)

Arguments

NameTypeIntentAttributesDescription
refinement_levelsinteger(kind=I4P)inTotal number of refinement levels used.

Call graph

nodes_number_at_level

Return number of tree nodes at a given level.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function nodes_number_at_level(level) result(nodes_number)

Arguments

NameTypeIntentAttributesDescription
levelinteger(kind=I4P)inRefinement level queried.

Call graph

parent_at_level

Return parent tree node at a given level.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function parent_at_level(node, parent_level) result(parent)

Arguments

NameTypeIntentAttributesDescription
nodeinteger(kind=I4P)inNode.
parent_levelinteger(kind=I4P)inLevel.

parent_node

Return parent tree node.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function parent_node(node)

Arguments

NameTypeIntentAttributesDescription
nodeinteger(kind=I4P)inNode queried.

Call graph

siblings

Return siblings of a given node.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function siblings(node) result(sbs)

Arguments

NameTypeIntentAttributesDescription
nodeinteger(kind=I4P)inNode queried.

Call graph

str_location_code

Return string of location code of node.

Attributes: pure

Returns: character(len=:)

fortran
function str_location_code(code)

Arguments

NameTypeIntentAttributesDescription
codeinteger(kind=I4P)inNode location code.

Call graph