Appearance
adam_tree_bucket_object
ADAM, tree bucket class definition. The bucket is implemented as a dictionary based on a double linked list.
Source: src/lib/common/adam_tree_bucket_object.f90
Dependencies
Contents
- tree_bucket_object
- len
- add_node
- destroy
- remove_node
- traverse
- remove_by_pointer
- update_code
- tree_bucket_len
- has_code
- loop
- node
Derived Types
tree_bucket_object
tree bucket class definition.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
head | type(tree_node_object) | pointer | The first node in the tree bucket. |
tail | type(tree_node_object) | pointer | The last node in the tree bucket. |
nodes_number | integer(kind=I4P) | Number of nodes in the tree bucket. | |
code | integer(kind=I8P) | Minimum and maximum unique code values actually stored. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
add_node | pass(self) | Add a node pointer to the tree bucket. |
destroy | pass(self) | Destroy the tree bucket. |
has_code | pass(self) | Check if the code is present in the tree bucket. |
loop | pass(self) | Sentinel while-loop on nodes returning the code. |
node | pass(self) | Return a pointer to a node. |
remove_node | pass(self) | Remove a node from the tree bucket, given the code. |
traverse | pass(self) | Traverse tree bucket from head to tail calling the iterator procedure. |
remove_by_pointer | pass(self) | Remove node from tree bucket, given pointer to it. |
update_code | pass(self) | Update minimum and maximum unique code values. |
Interfaces
len
Overload len builtin for accepting a tree_bucket_object.
Module procedures: tree_bucket_len
Subroutines
add_node
Add a node pointer to the tree bucket.
@note If a node with the same code is already in the tree bucket, it is removed and the new one will replace it.
fortran
subroutine add_node(self, code, refinement_needed, myrank, block_index)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(tree_bucket_object) | inout | The tree bucket. | |
code | integer(kind=I8P) | in | The Morton code. | |
refinement_needed | integer(kind=I4P) | in | optional | Flag for refinement/derefinement algorithm. |
myrank | integer(kind=I4P) | in | optional | MPI rank process. |
block_index | integer(kind=I8P) | in | optional | Block index in the field array. |
Call graph
destroy
Destroy the tree bucket.
fortran
subroutine destroy(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(tree_bucket_object) | inout | The tree bucket. |
Call graph
remove_node
Remove a node from the tree bucket, given the code.
fortran
subroutine remove_node(self, code)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(tree_bucket_object) | inout | The tree bucket. | |
code | integer(kind=I8P) | in | The Morton code. |
Call graph
traverse
Traverse tree bucket from head to tail calling the iterator procedure.
fortran
subroutine traverse(self, iterator)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(tree_bucket_object) | in | The tree bucket. | |
iterator | procedure(iterator_interface) | The iterator procedure to call for each node. |
Call graph
remove_by_pointer
Remove node from tree bucket, given pointer to it.
fortran
subroutine remove_by_pointer(self, p)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(tree_bucket_object) | inout | The tree bucket. | |
p | type(tree_node_object) | inout | pointer | Pointer to the node to remove. |
Call graph
update_code
Update minimum and maximum unique code values.
fortran
subroutine update_code(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(tree_bucket_object) | inout | The tree bucket. |
Call graph
Functions
tree_bucket_len
Return the number of nodes of the tree bucket, namely the tree bucket length.
Attributes: elemental
Returns: integer(kind=I4P)
fortran
function tree_bucket_len(self) result(length)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | type(tree_bucket_object) | in | The tree bucket. |
has_code
Check if the code is present in the tree bucket.
Returns: logical
fortran
function has_code(self, code)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(tree_bucket_object) | in | The tree bucket. | |
code | integer(kind=I8P) | in | The Morton code. |
Call graph
loop
Sentinel while-loop on nodes returning the code (for tree bucket looping).
Returns: logical
fortran
function loop(self, code) result(again)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(tree_bucket_object) | in | The tree bucket. | |
code | integer(kind=I8P) | out | optional | The Morton code. |
Call graph
node
Return a pointer to a node in the tree bucket.
Returns: type(tree_node_object)
fortran
function node(self, code) result(p)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(tree_bucket_object) | in | The tree bucket. | |
code | integer(kind=I8P) | in | The Morton code. |
Call graph