MPI-AMRVAC  3.1
The MPI - Adaptive Mesh Refinement - Versatile Advection Code (development version)
mod_forest.t
Go to the documentation of this file.
1 !> Module with basic grid data structures
2 module mod_forest
3  implicit none
4 
5  !> Pointer to a tree_node
7  type(tree_node), pointer :: node
8  end type tree_node_ptr
9 
10  !> The data structure that contains information about a tree node/grid block
11  type tree_node
12  integer :: ig^d !< Spatial indices of the grid block
13  integer :: level !< Refinement level
14  integer :: igrid !< Index of grid on processor's grid-array
15  integer :: ipe !< On which processor the grid is stored
16  !> Extra integer, not set by default. Is used to go from pointer to array
17  !> for coupling with a multigrid solver.
18  integer :: id
19  logical :: leaf !< Is the grid a leaf (no further refinement)
20  logical :: active
21  type(tree_node_ptr) :: parent !< Pointer to parent grid
22  type(tree_node_ptr) :: child(2^d&) !< Pointer to children
23  type(tree_node_ptr) :: neighbor(2,^nd) !< Pointer to neighbors
24  type(tree_node_ptr) :: next !< Next node at refinement level (linked list)
25  type(tree_node_ptr) :: prev !< Previous node at refinement level (linked list)
26  end type tree_node
27 
28  !> Pointers to the coarse grid
29  type(tree_node_ptr), dimension(:^D&), allocatable, save :: tree_root
30 
31  !> Array to go from an [igrid, ipe] index to a node pointer
32  type(tree_node_ptr), dimension(:,:), allocatable, save :: igrid_to_node
33 
34  !> The head pointer of the linked list per refinement level
35  type(tree_node_ptr), dimension(:), allocatable, save :: level_head
36 
37  !> The tail pointer of the linked list per refinement level
38  type(tree_node_ptr), dimension(:), allocatable, save :: level_tail
39 
40  !> Array to go from a Morton number to an igrid and processor index. Sfc(1:3,
41  !> MN) contains [igrid, ipe, active], where MN is a morton number and active
42  !> is 0 or 1.
43  integer, dimension(:,:), allocatable, save :: sfc
44 
45  !> Space filling curve for level 1 grid. sfc_iglevel1(^D, MN) gives ig^D (the
46  !> spatial index of the grid)
47  integer, dimension(:,:), allocatable, save :: sfc_iglevel1
48 
49  !> iglevel1_sfc(ig^D) gives the Morton number for grid ig^D
50  integer, dimension(:^D&), allocatable, save :: iglevel1_sfc
51 
52  !> Go from a Morton number to an igrid index (for a single processor)
53  integer, dimension(:), allocatable, save :: sfc_to_igrid
54 
55  !> Go from a grid index to Morton number (for a single processor)
56  integer, dimension(:), allocatable, save :: igrid_to_sfc
57 
58  !> Space filling curve used for physical boundary blocks
59  integer, dimension(:), allocatable, save :: sfc_phybound
60 
61  !> First Morton number per processor
62  integer, dimension(:), allocatable, save :: morton_start
63 
64  !> Last Morton number per processor
65  integer, dimension(:), allocatable, save :: morton_stop
66 
67  integer, dimension(:), allocatable, save :: morton_sub_start, morton_sub_stop
68 
69  !> AMR flags and grids-in-use identifier per processor (igrid,ipe)
70  logical, dimension(:,:), allocatable, save :: coarsen, refine, buffer, igrid_inuse
71 
72  !> Number of parent blocks
73  integer, save :: nparents
74 
75  !> Number of leaf block
76  integer, save :: nleafs
77 
79 
80  !> How many leaves are present per refinement level
81  integer, dimension(:), allocatable, save :: nleafs_level
82 
83 end module mod_forest
Module with basic grid data structures.
Definition: mod_forest.t:2
integer, dimension(:), allocatable, save nleafs_level
How many leaves are present per refinement level.
Definition: mod_forest.t:81
integer, dimension(:), allocatable, save sfc_to_igrid
Go from a Morton number to an igrid index (for a single processor)
Definition: mod_forest.t:53
logical, dimension(:,:), allocatable, save refine
Definition: mod_forest.t:70
integer evolvingboundary
Definition: mod_forest.t:78
integer nleafs_active
Definition: mod_forest.t:78
integer, dimension(:), allocatable, save sfc_phybound
Space filling curve used for physical boundary blocks.
Definition: mod_forest.t:59
integer, dimension(:), allocatable, save morton_start
First Morton number per processor.
Definition: mod_forest.t:62
integer, dimension(:), allocatable, save morton_sub_start
Definition: mod_forest.t:67
logical, dimension(:,:), allocatable, save buffer
Definition: mod_forest.t:70
logical, dimension(:,:), allocatable, save igrid_inuse
Definition: mod_forest.t:70
integer, save nleafs
Number of leaf block.
Definition: mod_forest.t:76
integer, dimension(:), allocatable, save igrid_to_sfc
Go from a grid index to Morton number (for a single processor)
Definition: mod_forest.t:56
integer nglev1
Definition: mod_forest.t:78
integer, dimension(:), allocatable, save morton_sub_stop
Definition: mod_forest.t:67
integer, dimension(:^d &), allocatable, save iglevel1_sfc
iglevel1_sfc(ig^D) gives the Morton number for grid ig^D
Definition: mod_forest.t:50
integer nphyboundblock
Definition: mod_forest.t:78
integer, dimension(:,:), allocatable, save sfc_iglevel1
Space filling curve for level 1 grid. sfc_iglevel1(^D, MN) gives ig^D (the spatial index of the grid)
Definition: mod_forest.t:47
logical, dimension(:,:), allocatable, save coarsen
AMR flags and grids-in-use identifier per processor (igrid,ipe)
Definition: mod_forest.t:70
type(tree_node_ptr), dimension(:), allocatable, save level_tail
The tail pointer of the linked list per refinement level.
Definition: mod_forest.t:38
integer ifdef
Definition: mod_forest.t:78
integer, dimension(:), allocatable, save morton_stop
Last Morton number per processor.
Definition: mod_forest.t:65
type(tree_node_ptr), dimension(:^d &), allocatable, save tree_root
Pointers to the coarse grid.
Definition: mod_forest.t:29
integer, dimension(:,:), allocatable, save sfc
Array to go from a Morton number to an igrid and processor index. Sfc(1:3, MN) contains [igrid,...
Definition: mod_forest.t:43
integer, save nparents
Number of parent blocks.
Definition: mod_forest.t:73
type(tree_node_ptr), dimension(:,:), allocatable, save igrid_to_node
Array to go from an [igrid, ipe] index to a node pointer.
Definition: mod_forest.t:32
type(tree_node_ptr), dimension(:), allocatable, save level_head
The head pointer of the linked list per refinement level.
Definition: mod_forest.t:35
Pointer to a tree_node.
Definition: mod_forest.t:6
The data structure that contains information about a tree node/grid block.
Definition: mod_forest.t:11