Afivo
0.3
|
This module contains the basic types and constants that are used in the 3-dimensional version of Afivo, together with some basic routines. The dimension-independent types and constant are place in m_afivo_types. More...
Data Types | |
type | a3_cc_methods |
Collection of methods for a cell-centered variable. More... | |
type | a3_loc_t |
Type specifying the location of a cell. More... | |
interface | a3_subr |
Subroutine that gets a box. More... | |
interface | a3_subr_arg |
Subroutine that gets a box and an array of reals. More... | |
interface | a3_subr_bc |
To fill ghost cells near physical boundaries. More... | |
interface | a3_subr_boxes |
Subroutine that gets a list of boxes and a box id. More... | |
interface | a3_subr_boxes_arg |
Subroutine that gets a list of boxes, an id and an array of reals. More... | |
interface | a3_subr_egc |
Subroutine for getting extra ghost cell data (> 1) near physical boundaries. More... | |
interface | a3_subr_prolong |
Subroutine for prolongation. More... | |
interface | a3_subr_rb |
To fill ghost cells near refinement boundaries. More... | |
interface | a3_subr_ref |
Subroutine for setting refinement flags. More... | |
interface | a3_subr_restrict |
Subroutine for restriction. More... | |
type | a3_t |
Type which stores all the boxes and levels, as well as some information about the number of boxes, variables and levels. More... | |
type | box3_t |
The basic building block of afivo: a box with cell-centered and face centered data, and information about its position, neighbors, children etc. More... | |
Functions/Subroutines | |
subroutine | a3_print_info (tree) |
Get tree info. More... | |
pure integer function | a3_box_bytes (n_cell, n_var_cell, n_var_face) |
pure integer function | a3_num_boxes_used (tree) |
pure integer function | a3_num_leaves_used (tree) |
pure integer function | a3_num_cells_used (tree) |
pure real(dp) function | a3_total_volume (tree) |
elemental logical function | a3_has_children (box) |
Return .true. if a box has children. More... | |
pure logical function, dimension(size(nbs)) | a3_phys_boundary (boxes, id, nbs) |
Return .true. where there is a physical/periodic boundary. Detecting physical boundaries is straightforward (simply test whether neighbors(i) < af_no_box), but periodic boundaries require a comparison of their spatial index. More... | |
pure integer function, dimension(3) | a3_get_child_offset (box, nb) |
Get the offset of a box with respect to its parent (e.g. in 2d, there can be a child at offset 0,0, one at n_cell/2,0, one at 0,n_cell/2 and one at n_cell/2, n_cell/2) More... | |
pure integer function, dimension(3) | a3_get_ix_on_parent (box, ix) |
Given a cell index on box, get index of the closest cell at its parent. More... | |
pure integer function, dimension(3) | a3_get_ix_on_neighb (box, ix, nb) |
Given a cell index on box, get index on a neighbor. More... | |
pure integer function, dimension(3) | a3_neighb_offset (nbs) |
Given a list of neighbor directions, compute the index offset. More... | |
pure integer function | a3_ix_to_ichild (ix) |
Compute the 'child index' for a box with spatial index ix. With 'child index' we mean the index in the children(:) array of its parent. More... | |
pure integer function, dimension(3) | a3_cc_ix (box, r) |
Get the cell index in which r lies. This routine does not check whether r is actually located inside the box. More... | |
pure real(dp) function, dimension(3) | a3_r_cc (box, cc_ix) |
Get the location of the cell center with index cc_ix. More... | |
pure real(dp) function, dimension(3) | a3_r_fc (box, dim, fc_ix) |
Get the location of the face parallel to dim with index fc_ix. More... | |
pure real(dp) function, dimension(3) | a3_rr_cc (box, cc_ix) |
Get a general location with index cc_ix (like a3_r_cc but using reals) More... | |
pure real(dp) function, dimension(3) | a3_r_center (box) |
Return the coordinate of the center of a box. More... | |
pure real(dp) function | a3_min_dr (tree) |
Return finest dr that is used in the tree. More... | |
pure real(dp) function | a3_lvl_dr (tree, lvl) |
Return dr at lvl. More... | |
subroutine | a3_set_box_gc (box, nb, iv, gc_scalar, gc_array) |
Variables | |
integer, parameter | a3_num_children = 8 |
integer, parameter | a3_child_lowx_lowy_lowz = 1 |
integer, parameter | a3_child_highx_lowy_lowz = 2 |
integer, parameter | a3_child_lowx_highy_lowz = 3 |
integer, parameter | a3_child_highx_highy_lowz = 4 |
integer, parameter | a3_child_lowx_lowy_highz = 5 |
integer, parameter | a3_child_highx_lowy_highz = 6 |
integer, parameter | a3_child_lowx_highy_highz = 7 |
integer, parameter | a3_child_highx_highy_highz = 8 |
integer, dimension(3, 8), parameter | a3_child_dix = reshape( [0,0,0, 1,0,0, 0,1,0, 1,1,0, 0,0,1, 1,0,1, 0,1,1, 1,1,1], [3,8]) |
integer, dimension(4, 6), parameter | a3_child_adj_nb = reshape( [1,3,5,7, 2,4,6,8, 1,2,5,6, 3,4,7,8, 1,2,3,4, 5,6,7,8], [4,6]) |
integer, dimension(3, 8), parameter | a3_nb_adj_child = reshape( [1,3,5, 2,3,5, 1,4,5, 2,4,5, 1,3,6, 2,3,6, 1,4,6, 2,4,6], [3,8]) |
logical, dimension(3, 8), parameter | a3_child_low = reshape([ .true., .true., .true., .false., .true., .true., .true., .false., .true., .false., .false., .true., .true., .true., .false., .false., .true., .false., .true., .false., .false., .false., .false., .false.], [3, 8]) |
integer, dimension(3, 8), parameter | a3_child_high_01 = reshape([ 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1], [3, 8]) |
integer, parameter | a3_num_neighbors = 6 |
integer, parameter | a3_neighb_lowx = 1 |
integer, parameter | a3_neighb_highx = 2 |
integer, parameter | a3_neighb_lowy = 3 |
integer, parameter | a3_neighb_highy = 4 |
integer, parameter | a3_neighb_lowz = 5 |
integer, parameter | a3_neighb_highz = 6 |
integer, dimension(3, 6), parameter | a3_neighb_dix = reshape( [-1,0,0, 1,0,0, 0,-1,0, 0,1,0, 0,0,-1, 0,0,1], [3,6]) |
logical, dimension(6), parameter | a3_neighb_low = [.true., .false., .true., .false., .true., .false.] |
integer, dimension(3), parameter | a3_low_neighbs = [1, 3, 5] |
integer, dimension(3), parameter | a3_high_neighbs = [2, 4, 6] |
integer, dimension(6), parameter | a3_neighb_high_01 = [0, 1, 0, 1, 0, 1] |
integer, dimension(6), parameter | a3_neighb_high_pm = [-1, 1, -1, 1, -1, 1] |
integer, dimension(6), parameter | a3_neighb_rev = [2, 1, 4, 3, 6, 5] |
integer, dimension(6), parameter | a3_neighb_dim = [1, 1, 2, 2, 3, 3] |
integer, parameter | a3_num_edges = 12 |
integer, dimension(12), parameter | a3_edge_dim = [1,1,1,1, 2,2,2,2, 3,3,3,3] |
integer, dimension(3, 12), parameter | a3_edge_dir = reshape( [0,-1,-1, 0,1,-1, 0,-1,1, 0,1,1, -1,0,-1, 1,0,-1, -1,0,1, 1,0,1, -1,-1,0, 1,-1,0, -1,1,0, 1,1,0], [3, 12]) |
integer, dimension(2, 12), parameter | a3_nb_adj_edge = reshape( [3,5, 4,5, 3,6, 4,6, 1,5, 2,5, 1,6, 2,6, 1,3, 2,3, 1,4, 2,4], [2,12]) |
integer, dimension(3, 12), parameter | a3_edge_min_ix = reshape( [0,0,0, 0,1,0, 0,0,1, 0,1,1, 0,0,0, 1,0,0, 0,0,1, 1,0,1, 0,0,0, 1,0,0, 0,1,0, 1,1,0], [3,12]) |
This module contains the basic types and constants that are used in the 3-dimensional version of Afivo, together with some basic routines. The dimension-independent types and constant are place in m_afivo_types.
subroutine m_a3_types::a3_print_info | ( | type(a3_t), intent(in) | tree | ) |
pure integer function m_a3_types::a3_box_bytes | ( | integer, intent(in) | n_cell, |
integer, intent(in) | n_var_cell, | ||
integer, intent(in) | n_var_face | ||
) |
[in] | n_cell | number of cells per dimension |
[in] | n_var_cell | number of cell-centered variables |
[in] | n_var_face | number of face-centered variables |
Definition at line 291 of file m_a3_types.f90.
pure integer function m_a3_types::a3_num_boxes_used | ( | type(a3_t), intent(in) | tree | ) |
Definition at line 303 of file m_a3_types.f90.
pure integer function m_a3_types::a3_num_leaves_used | ( | type(a3_t), intent(in) | tree | ) |
Definition at line 313 of file m_a3_types.f90.
pure integer function m_a3_types::a3_num_cells_used | ( | type(a3_t), intent(in) | tree | ) |
Definition at line 323 of file m_a3_types.f90.
pure real(dp) function m_a3_types::a3_total_volume | ( | type(a3_t), intent(in) | tree | ) |
Definition at line 330 of file m_a3_types.f90.
elemental logical function m_a3_types::a3_has_children | ( | type(box3_t), intent(in) | box | ) |
Return .true. if a box has children.
Definition at line 353 of file m_a3_types.f90.
pure logical function, dimension(size(nbs)) m_a3_types::a3_phys_boundary | ( | type(box3_t), dimension(:), intent(in) | boxes, |
integer, intent(in) | id, | ||
integer, dimension(:), intent(in) | nbs | ||
) |
Return .true. where there is a physical/periodic boundary. Detecting physical boundaries is straightforward (simply test whether neighbors(i) < af_no_box), but periodic boundaries require a comparison of their spatial index.
[in] | boxes | List of boxes |
[in] | id | Box to inspect |
[in] | nbs | Neighbor directions |
Definition at line 365 of file m_a3_types.f90.
pure integer function, dimension(3) m_a3_types::a3_get_child_offset | ( | type(box3_t), intent(in) | box, |
integer, intent(in), optional | nb | ||
) |
Get the offset of a box with respect to its parent (e.g. in 2d, there can be a child at offset 0,0, one at n_cell/2,0, one at 0,n_cell/2 and one at n_cell/2, n_cell/2)
[in] | box | A child box |
[in] | nb | Optional: get index on parent neighbor |
Definition at line 407 of file m_a3_types.f90.
pure integer function, dimension(3) m_a3_types::a3_get_ix_on_parent | ( | type(box3_t), intent(in) | box, |
integer, dimension(3), intent(in) | ix | ||
) |
Given a cell index on box, get index of the closest cell at its parent.
[in] | box | A child box |
[in] | ix | Index on child box |
Definition at line 422 of file m_a3_types.f90.
pure integer function, dimension(3) m_a3_types::a3_get_ix_on_neighb | ( | type(box3_t), intent(in) | box, |
integer, dimension(3), intent(in) | ix, | ||
integer, intent(in) | nb | ||
) |
Given a cell index on box, get index on a neighbor.
[in] | box | A box |
[in] | ix | Index on box |
[in] | nb | Neighbor identifier |
Definition at line 430 of file m_a3_types.f90.
pure integer function, dimension(3) m_a3_types::a3_neighb_offset | ( | integer, dimension(:), intent(in) | nbs | ) |
Given a list of neighbor directions, compute the index offset.
[in] | nbs | List of neighbor directions |
Definition at line 442 of file m_a3_types.f90.
pure integer function m_a3_types::a3_ix_to_ichild | ( | integer, dimension(3), intent(in) | ix | ) |
Compute the 'child index' for a box with spatial index ix. With 'child index' we mean the index in the children(:) array of its parent.
[in] | ix | Spatial index of the box |
Definition at line 455 of file m_a3_types.f90.
pure integer function, dimension(3) m_a3_types::a3_cc_ix | ( | type(box3_t), intent(in) | box, |
real(dp), dimension(3), intent(in) | r | ||
) |
Get the cell index in which r lies. This routine does not check whether r is actually located inside the box.
Definition at line 464 of file m_a3_types.f90.
pure real(dp) function, dimension(3) m_a3_types::a3_r_cc | ( | type(box3_t), intent(in) | box, |
integer, dimension(3), intent(in) | cc_ix | ||
) |
Get the location of the cell center with index cc_ix.
Definition at line 472 of file m_a3_types.f90.
pure real(dp) function, dimension(3) m_a3_types::a3_r_fc | ( | type(box3_t), intent(in) | box, |
integer, intent(in) | dim, | ||
integer, dimension(3), intent(in) | fc_ix | ||
) |
Get the location of the face parallel to dim with index fc_ix.
Definition at line 480 of file m_a3_types.f90.
pure real(dp) function, dimension(3) m_a3_types::a3_rr_cc | ( | type(box3_t), intent(in) | box, |
real(dp), dimension(3), intent(in) | cc_ix | ||
) |
Get a general location with index cc_ix (like a3_r_cc but using reals)
Definition at line 490 of file m_a3_types.f90.
pure real(dp) function, dimension(3) m_a3_types::a3_r_center | ( | type(box3_t), intent(in) | box | ) |
Return the coordinate of the center of a box.
Definition at line 498 of file m_a3_types.f90.
pure real(dp) function m_a3_types::a3_min_dr | ( | type(a3_t), intent(in) | tree | ) |
Return finest dr that is used in the tree.
Definition at line 505 of file m_a3_types.f90.
pure real(dp) function m_a3_types::a3_lvl_dr | ( | type(a3_t), intent(in) | tree, |
integer, intent(in) | lvl | ||
) |
Return dr at lvl.
Definition at line 512 of file m_a3_types.f90.
subroutine m_a3_types::a3_set_box_gc | ( | type(box3_t), intent(inout) | box, |
integer, intent(in) | nb, | ||
integer, intent(in) | iv, | ||
real(dp), intent(in), optional | gc_scalar, | ||
real(dp), dimension(box%n_cell, box%n_cell), intent(in), optional | gc_array | ||
) |
[in,out] | box | Box to operate on |
[in] | nb | Ghost cell direction |
[in] | iv | Ghost cell variable |
[in] | gc_scalar | Scalar value for ghost cells |
[in] | gc_array | Array for ghost cells |
Definition at line 519 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_num_children = 8 |
Definition at line 14 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_child_lowx_lowy_lowz = 1 |
Definition at line 15 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_child_highx_lowy_lowz = 2 |
Definition at line 16 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_child_lowx_highy_lowz = 3 |
Definition at line 17 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_child_highx_highy_lowz = 4 |
Definition at line 18 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_child_lowx_lowy_highz = 5 |
Definition at line 19 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_child_highx_lowy_highz = 6 |
Definition at line 20 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_child_lowx_highy_highz = 7 |
Definition at line 21 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_child_highx_highy_highz = 8 |
Definition at line 22 of file m_a3_types.f90.
integer, dimension(3, 8), parameter m_a3_types::a3_child_dix = reshape( [0,0,0, 1,0,0, 0,1,0, 1,1,0, 0,0,1, 1,0,1, 0,1,1, 1,1,1], [3,8]) |
Definition at line 25 of file m_a3_types.f90.
integer, dimension(4, 6), parameter m_a3_types::a3_child_adj_nb = reshape( [1,3,5,7, 2,4,6,8, 1,2,5,6, 3,4,7,8, 1,2,3,4, 5,6,7,8], [4,6]) |
Definition at line 29 of file m_a3_types.f90.
integer, dimension(3, 8), parameter m_a3_types::a3_nb_adj_child = reshape( [1,3,5, 2,3,5, 1,4,5, 2,4,5, 1,3,6, 2,3,6, 1,4,6, 2,4,6], [3,8]) |
Definition at line 32 of file m_a3_types.f90.
logical, dimension(3, 8), parameter m_a3_types::a3_child_low = reshape([ .true., .true., .true., .false., .true., .true., .true., .false., .true., .false., .false., .true., .true., .true., .false., .false., .true., .false., .true., .false., .false., .false., .false., .false.], [3, 8]) |
Definition at line 35 of file m_a3_types.f90.
integer, dimension(3, 8), parameter m_a3_types::a3_child_high_01 = reshape([ 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1], [3, 8]) |
Definition at line 41 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_num_neighbors = 6 |
Definition at line 48 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_neighb_lowx = 1 |
Definition at line 49 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_neighb_highx = 2 |
Definition at line 50 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_neighb_lowy = 3 |
Definition at line 51 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_neighb_highy = 4 |
Definition at line 52 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_neighb_lowz = 5 |
Definition at line 53 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_neighb_highz = 6 |
Definition at line 54 of file m_a3_types.f90.
integer, dimension(3, 6), parameter m_a3_types::a3_neighb_dix = reshape( [-1,0,0, 1,0,0, 0,-1,0, 0,1,0, 0,0,-1, 0,0,1], [3,6]) |
Definition at line 56 of file m_a3_types.f90.
logical, dimension(6), parameter m_a3_types::a3_neighb_low = [.true., .false., .true., .false., .true., .false.] |
Definition at line 59 of file m_a3_types.f90.
integer, dimension(3), parameter m_a3_types::a3_low_neighbs = [1, 3, 5] |
Definition at line 62 of file m_a3_types.f90.
integer, dimension(3), parameter m_a3_types::a3_high_neighbs = [2, 4, 6] |
Definition at line 64 of file m_a3_types.f90.
integer, dimension(6), parameter m_a3_types::a3_neighb_high_01 = [0, 1, 0, 1, 0, 1] |
Definition at line 66 of file m_a3_types.f90.
integer, dimension(6), parameter m_a3_types::a3_neighb_high_pm = [-1, 1, -1, 1, -1, 1] |
Definition at line 68 of file m_a3_types.f90.
integer, dimension(6), parameter m_a3_types::a3_neighb_rev = [2, 1, 4, 3, 6, 5] |
Definition at line 70 of file m_a3_types.f90.
integer, dimension(6), parameter m_a3_types::a3_neighb_dim = [1, 1, 2, 2, 3, 3] |
Definition at line 72 of file m_a3_types.f90.
integer, parameter m_a3_types::a3_num_edges = 12 |
Definition at line 75 of file m_a3_types.f90.
integer, dimension(12), parameter m_a3_types::a3_edge_dim = [1,1,1,1, 2,2,2,2, 3,3,3,3] |
Definition at line 77 of file m_a3_types.f90.
integer, dimension(3, 12), parameter m_a3_types::a3_edge_dir = reshape( [0,-1,-1, 0,1,-1, 0,-1,1, 0,1,1, -1,0,-1, 1,0,-1, -1,0,1, 1,0,1, -1,-1,0, 1,-1,0, -1,1,0, 1,1,0], [3, 12]) |
Definition at line 80 of file m_a3_types.f90.
integer, dimension(2, 12), parameter m_a3_types::a3_nb_adj_edge = reshape( [3,5, 4,5, 3,6, 4,6, 1,5, 2,5, 1,6, 2,6, 1,3, 2,3, 1,4, 2,4], [2,12]) |
Definition at line 85 of file m_a3_types.f90.
integer, dimension(3, 12), parameter m_a3_types::a3_edge_min_ix = reshape( [0,0,0, 0,1,0, 0,0,1, 0,1,1, 0,0,0, 1,0,0, 0,0,1, 1,0,1, 0,0,0, 1,0,0, 0,1,0, 1,1,0], [3,12]) |
Definition at line 90 of file m_a3_types.f90.