Afivo
0.3
|
This module contains functionality for dealing with numerical stencils. More...
Data Types | |
interface | af_subr_stencil |
Subroutine for setting a stencil on a box. More... | |
Functions/Subroutines | |
subroutine, public | af_stencil_print_info (tree) |
Print statistics about the stencils in the tree. More... | |
pure integer function, public | af_stencil_index (box, key) |
Get index of a stencil, or af_stencil_none is not present. More... | |
subroutine, public | af_stencil_store (tree, key, set_stencil) |
Store a constant stencil. More... | |
subroutine, public | af_stencil_prepare_store (box, key, ix) |
Prepare to store a stencil. More... | |
subroutine, public | af_stencil_allocate_coeff (stencil, nc, use_f, n_sparse) |
Allocate storage for stencil coefficients. More... | |
subroutine, public | af_stencil_remove (tree, key) |
Remove a stencil. More... | |
subroutine, public | af_stencil_store_box (box, key, set_stencil) |
Store a stencil for a box. More... | |
subroutine | af_stencil_remove_box (box, key) |
Remove a stencil from a box. This will change the order of other stencils. More... | |
subroutine, public | af_stencil_check_box (box, key, ix) |
Check if a stencil was correctly stored for a box. More... | |
subroutine, public | af_stencil_apply (tree, key, iv, i_out) |
subroutine, public | af_stencil_apply_box (box, key, iv, i_out) |
subroutine | stencil_apply_357 (box, stencil, iv, i_out) |
Apply a 3/5/7-point stencil in 1D/2D/3D. More... | |
subroutine, public | af_stencil_prolong_box (box_p, box_c, key, iv, iv_to, add) |
subroutine | stencil_prolong_234 (box_p, box_c, stencil, iv, iv_to, add) |
Linear prolongation using nearest NDIM+1 neighbors. More... | |
subroutine | stencil_prolong_248 (box_p, box_c, stencil, iv, iv_to, add) |
(Bi-/tri-)linear prolongation using nearest 2**NDIM neighbors More... | |
subroutine, public | af_stencil_gsrb_box (box, key, redblack, iv, i_rhs) |
Perform Gauss-Seidel red-black on a stencil. More... | |
subroutine | stencil_gsrb_357 (box, stencil, redblack, iv, i_rhs) |
Perform Gauss-Seidel red-black on a 3/5/7-point stencil in 1D/2D/3D. More... | |
subroutine, public | af_stencil_try_constant (box, ix, abs_tol, success) |
Convert a variable stencil to constant one if possible. More... | |
subroutine, public | af_stencil_get_box (box, key, v) |
Get the stencil for a box. More... | |
subroutine | stencil_get_357 (box, stencil, v) |
Get the stencil for all cells in a box. More... | |
Variables | |
integer, parameter | stencil_list_initial_size = 10 |
Initial size of stencil list. More... | |
integer, parameter, public | stencil_constant = 1 |
Constant stencil. More... | |
integer, parameter, public | stencil_variable = 2 |
Variable stencil. More... | |
integer, parameter, public | stencil_sparse = 3 |
Sparse stencil. More... | |
integer, parameter, private | num_shapes = 5 |
Number of predefined stencil shapes. More... | |
integer, parameter, public | af_stencil_357 = 1 |
3/5/7 point stencil in 1D/2D/3D More... | |
integer, parameter, public | af_stencil_p234 = 2 |
Prolongation stencil using nearest 2, 3, 4 neighbors in 1D-3D. More... | |
integer, parameter, public | af_stencil_p248 = 3 |
Prolongation stencil using nearest 2, 4, 8 neighbors in 1D-3D. More... | |
integer, parameter, public | af_stencil_246 = 4 |
Stencil for direct neighbors. More... | |
integer, parameter, public | af_stencil_mask = 5 |
Stencil for masking. More... | |
integer, dimension(num_shapes), parameter, public | af_stencil_sizes = [2*NDIM+1, NDIM+1, 2**NDIM, 2*NDIM, 1] |
Number of coefficients in the stencils. More... | |
This module contains functionality for dealing with numerical stencils.
subroutine, public m_af_stencil::af_stencil_print_info | ( | type(af_t), intent(in) | tree | ) |
Print statistics about the stencils in the tree.
Definition at line 65 of file m_af_stencil.f90.
pure integer function, public m_af_stencil::af_stencil_index | ( | type(box_t), intent(in) | box, |
integer, intent(in) | key | ||
) |
Get index of a stencil, or af_stencil_none is not present.
Definition at line 109 of file m_af_stencil.f90.
subroutine, public m_af_stencil::af_stencil_store | ( | type(af_t), intent(inout) | tree, |
integer, intent(in) | key, | ||
procedure(af_subr_stencil) | set_stencil | ||
) |
Store a constant stencil.
[in] | key | Stencil key |
set_stencil | Method to set a stencil |
Definition at line 124 of file m_af_stencil.f90.
subroutine, public m_af_stencil::af_stencil_prepare_store | ( | type(box_t), intent(inout) | box, |
integer, intent(in) | key, | ||
integer, intent(out) | ix | ||
) |
Prepare to store a stencil.
[in] | key | Stencil key |
[out] | ix | Index to store stencil |
Definition at line 144 of file m_af_stencil.f90.
subroutine, public m_af_stencil::af_stencil_allocate_coeff | ( | type(stencil_t), intent(inout) | stencil, |
integer, intent(in) | nc, | ||
logical, intent(in), optional | use_f, | ||
integer, intent(in), optional | n_sparse | ||
) |
Allocate storage for stencil coefficients.
[in] | nc | Number of cells per box dimension |
[in] | use_f | Whether storage for the extra arrays f and bc_correction is required (only for variable stencils) |
[in] | n_sparse | Number of entries for sparse stencil |
Definition at line 171 of file m_af_stencil.f90.
subroutine, public m_af_stencil::af_stencil_remove | ( | type(af_t), intent(inout) | tree, |
integer, intent(in) | key | ||
) |
subroutine, public m_af_stencil::af_stencil_store_box | ( | type(box_t), intent(inout) | box, |
integer, intent(in) | key, | ||
procedure(af_subr_stencil) | set_stencil | ||
) |
Store a stencil for a box.
[in] | key | Stencil key |
set_stencil | Method to set a stencil |
Definition at line 263 of file m_af_stencil.f90.
|
private |
Remove a stencil from a box. This will change the order of other stencils.
[in] | key | Stencil key |
Definition at line 275 of file m_af_stencil.f90.
subroutine, public m_af_stencil::af_stencil_check_box | ( | type(box_t), intent(in) | box, |
integer, intent(in) | key, | ||
integer, intent(in) | ix | ||
) |
Check if a stencil was correctly stored for a box.
[in] | key | Stencil key |
[in] | ix | Stencil index |
Definition at line 296 of file m_af_stencil.f90.
subroutine, public m_af_stencil::af_stencil_apply | ( | type(af_t), intent(inout) | tree, |
integer, intent(in) | key, | ||
integer, intent(in) | iv, | ||
integer, intent(in) | i_out | ||
) |
[in,out] | tree | Operate on this box |
[in] | key | Stencil key |
[in] | iv | Input variable |
[in] | i_out | Output variable |
Definition at line 328 of file m_af_stencil.f90.
subroutine, public m_af_stencil::af_stencil_apply_box | ( | type(box_t), intent(inout) | box, |
integer, intent(in) | key, | ||
integer, intent(in) | iv, | ||
integer, intent(in) | i_out | ||
) |
[in,out] | box | Operate on this box |
[in] | key | Stencil key |
[in] | iv | Input variable |
[in] | i_out | Output variable |
Definition at line 348 of file m_af_stencil.f90.
|
private |
Apply a 3/5/7-point stencil in 1D/2D/3D.
[in,out] | box | Operate on this box |
[in] | iv | Input variable |
[in] | i_out | Output variable |
Definition at line 367 of file m_af_stencil.f90.
subroutine, public m_af_stencil::af_stencil_prolong_box | ( | type(box_t), intent(in) | box_p, |
type(box_t), intent(inout) | box_c, | ||
integer, intent(in) | key, | ||
integer, intent(in) | iv, | ||
integer, intent(in) | iv_to, | ||
logical, intent(in), optional | add | ||
) |
[in] | box_p | Parent box |
[in,out] | box_c | Child box |
[in] | key | Stencil key |
[in] | iv | Input variable |
[in] | iv_to | Destination variable |
[in] | add | Add to old values |
Definition at line 552 of file m_af_stencil.f90.
|
private |
Linear prolongation using nearest NDIM+1 neighbors.
[in] | box_p | Parent box |
[in,out] | box_c | Child box |
[in] | iv | Input variable |
[in] | iv_to | Destination variable |
[in] | add | Add to old values |
Definition at line 582 of file m_af_stencil.f90.
|
private |
(Bi-/tri-)linear prolongation using nearest 2**NDIM neighbors
[in] | box_p | Parent box |
[in,out] | box_c | Child box |
[in] | iv | Input variable |
[in] | iv_to | Destination variable |
[in] | add | Add to old values |
Definition at line 695 of file m_af_stencil.f90.
subroutine, public m_af_stencil::af_stencil_gsrb_box | ( | type(box_t), intent(inout) | box, |
integer, intent(in) | key, | ||
integer, intent(in) | redblack, | ||
integer, intent(in) | iv, | ||
integer, intent(in) | i_rhs | ||
) |
Perform Gauss-Seidel red-black on a stencil.
[in,out] | box | Operate on this box |
[in] | key | Stencil key |
[in] | redblack | Even or odd integer |
[in] | iv | Solve for variable |
[in] | i_rhs | Right-hand side |
Definition at line 818 of file m_af_stencil.f90.
|
private |
Perform Gauss-Seidel red-black on a 3/5/7-point stencil in 1D/2D/3D.
[in,out] | box | Operate on this box |
[in] | redblack | Even or odd integer |
[in] | iv | Solve for variable |
[in] | i_rhs | Right-hand side |
Definition at line 838 of file m_af_stencil.f90.
subroutine, public m_af_stencil::af_stencil_try_constant | ( | type(box_t), intent(inout) | box, |
integer, intent(in) | ix, | ||
real(dp), intent(in) | abs_tol, | ||
logical | success | ||
) |
Convert a variable stencil to constant one if possible.
[in] | ix | Stencil index |
[in] | abs_tol | Absolute tolerance |
success | Whether the stencil was converted |
Definition at line 1001 of file m_af_stencil.f90.
subroutine, public m_af_stencil::af_stencil_get_box | ( | type(box_t), intent(inout) | box, |
integer, intent(in) | key, | ||
real(dp), dimension(:, dtimes(:)), intent(inout) | v | ||
) |
Get the stencil for a box.
[in,out] | box | Operate on this box |
[in] | key | Stencil key |
[in,out] | v | Stencil coefficients |
Definition at line 1031 of file m_af_stencil.f90.
|
private |
Get the stencil for all cells in a box.
[in,out] | v | Stencil coefficients |
Definition at line 1050 of file m_af_stencil.f90.
|
private |
Initial size of stencil list.
Definition at line 10 of file m_af_stencil.f90.
integer, parameter, public m_af_stencil::stencil_constant = 1 |
Constant stencil.
Definition at line 12 of file m_af_stencil.f90.
integer, parameter, public m_af_stencil::stencil_variable = 2 |
Variable stencil.
Definition at line 13 of file m_af_stencil.f90.
integer, parameter, public m_af_stencil::stencil_sparse = 3 |
Sparse stencil.
Definition at line 14 of file m_af_stencil.f90.
|
private |
Number of predefined stencil shapes.
Definition at line 17 of file m_af_stencil.f90.
integer, parameter, public m_af_stencil::af_stencil_357 = 1 |
3/5/7 point stencil in 1D/2D/3D
Definition at line 20 of file m_af_stencil.f90.
integer, parameter, public m_af_stencil::af_stencil_p234 = 2 |
Prolongation stencil using nearest 2, 3, 4 neighbors in 1D-3D.
Definition at line 23 of file m_af_stencil.f90.
integer, parameter, public m_af_stencil::af_stencil_p248 = 3 |
Prolongation stencil using nearest 2, 4, 8 neighbors in 1D-3D.
Definition at line 26 of file m_af_stencil.f90.
integer, parameter, public m_af_stencil::af_stencil_246 = 4 |
Stencil for direct neighbors.
Definition at line 29 of file m_af_stencil.f90.
integer, parameter, public m_af_stencil::af_stencil_mask = 5 |
Stencil for masking.
Definition at line 32 of file m_af_stencil.f90.
integer, dimension(num_shapes), parameter, public m_af_stencil::af_stencil_sizes = [2*NDIM+1, NDIM+1, 2**NDIM, 2*NDIM, 1] |
Number of coefficients in the stencils.
Definition at line 35 of file m_af_stencil.f90.