Afivo
0.3
|
This module contains routines related to the filling of ghost cells. Note that corner ghost cells are not used in Afivo. More...
Functions/Subroutines | |
subroutine, public | af_gc_tree (tree, ivs, corners, leaves_only) |
Fill ghost cells for variables ivs on the sides of all boxes, using subr_rb on refinement boundaries and subr_bc on physical boundaries. More... | |
subroutine, public | af_gc_lvl (tree, lvl, ivs, corners) |
Fill ghost cells for variables ivs on the sides of all boxes. More... | |
subroutine, public | af_gc_box (tree, id, ivs, corners) |
Fill ghost cells for variables ivs. More... | |
subroutine | af_gc_box_corner (boxes, id, ivs) |
Fill corner ghost cells for variable iv on corners/edges of a box. If there is no box to copy the data from, use linear extrapolation. This routine assumes ghost cells on the sides of the box are available. More... | |
subroutine | bc_to_gc (box, nb, iv, bc_val, bc_type) |
Convert a boundary condition to ghost cell data. More... | |
subroutine | bc_to_gc2 (nc, cc, nb, bc_val, bc_type, dr) |
Convert a boundary condition to two layers of ghost cell data. More... | |
subroutine, public | af_gc_prolong_copy (boxes, id, nb, iv, op_mask) |
Partial prolongation to the ghost cells of box id from parent. More... | |
subroutine, public | af_gc_interp (boxes, id, nb, iv, op_mask) |
Interpolate between fine points and coarse neighbors to fill ghost cells near refinement boundaries. More... | |
subroutine, public | af_gc_interp_lim (boxes, id, nb, iv, op_mask) |
Interpolate between fine points and coarse neighbors to fill ghost cells near refinement boundaries. The ghost values are less than twice the coarse values. More... | |
subroutine, public | af_bc_neumann_zero (box, nb, iv, coords, bc_val, bc_type) |
This fills ghost cells near physical boundaries using Neumann zero. More... | |
subroutine, public | af_bc_dirichlet_zero (box, nb, iv, coords, bc_val, bc_type) |
This fills ghost cells near physical boundaries using Dirichlet zero. More... | |
subroutine, public | af_bc_set_continuous (box, nb, iv, coords, bc_val, bc_type) |
This fills ghost cells near physical boundaries using the same slope. More... | |
subroutine | copy_from_nb (box, box_nb, dnb, lo, hi, ivs) |
subroutine, public | af_gc2_box (tree, id, ivs, cc) |
Get array of cell-centered variables with multiple ghost cells, excluding corners. More... | |
subroutine | gc2_prolong_rb (tree, id, nb, iv, nc, cc) |
Conservative prolongation with a limited slope for ghost cells near refinement boundaries. More... | |
subroutine | af_corner_gc_extrap (box, ix, ivs) |
This fills corner ghost cells using linear extrapolation. The ghost cells on the sides already need to be filled. More... | |
subroutine | af_edge_gc_extrap (box, lo, dim, ivs) |
This fills edge ghost cells using linear extrapolation. The ghost cells on the sides already need to be filled. This routine basically performs the same operation as af_corner_gc_extrap does in 2D. More... | |
This module contains routines related to the filling of ghost cells. Note that corner ghost cells are not used in Afivo.
subroutine, public m_af_ghostcell::af_gc_tree | ( | type(af_t), intent(inout) | tree, |
integer, dimension(:), intent(in) | ivs, | ||
logical, intent(in), optional | corners, | ||
logical, intent(in), optional | leaves_only | ||
) |
Fill ghost cells for variables ivs on the sides of all boxes, using subr_rb on refinement boundaries and subr_bc on physical boundaries.
[in,out] | tree | Tree to fill ghost cells on |
[in] | ivs | Variables for which ghost cells are set |
[in] | corners | Fill corner ghost cells (default: yes) |
[in] | leaves_only | Fill only leaves' ghost cells (default: false) |
Definition at line 25 of file m_af_ghostcell.f90.
subroutine, public m_af_ghostcell::af_gc_lvl | ( | type(af_t), intent(inout) | tree, |
integer, intent(in) | lvl, | ||
integer, dimension(:), intent(in) | ivs, | ||
logical, intent(in), optional | corners | ||
) |
Fill ghost cells for variables ivs on the sides of all boxes.
[in,out] | tree | Tree to fill ghost cells on |
[in] | lvl | Fill on this refinement level |
[in] | ivs | Variables for which ghost cells are set |
[in] | corners | Fill corner ghost cells (default: yes) |
Definition at line 49 of file m_af_ghostcell.f90.
subroutine, public m_af_ghostcell::af_gc_box | ( | type(af_t), intent(inout) | tree, |
integer, intent(in) | id, | ||
integer, dimension(:), intent(in) | ivs, | ||
logical, intent(in), optional | corners | ||
) |
Fill ghost cells for variables ivs.
[in,out] | tree | Tree to fill ghost cells on |
[in] | id | Id of box for which we set ghost cells |
[in] | ivs | Variables for which ghost cells are set |
[in] | corners | Fill corner ghost cells (default: yes) |
Definition at line 64 of file m_af_ghostcell.f90.
|
private |
Fill corner ghost cells for variable iv on corners/edges of a box. If there is no box to copy the data from, use linear extrapolation. This routine assumes ghost cells on the sides of the box are available.
[in,out] | boxes | List of all the boxes |
[in] | id | Id of box for which we set ghost cells |
[in] | ivs | Variable for which ghost cells are set |
Definition at line 125 of file m_af_ghostcell.f90.
|
private |
Convert a boundary condition to ghost cell data.
[in] | iv | Variable to fill |
[in] | nb | Neighbor direction |
[in] | bc_type | Type of b.c. |
Definition at line 173 of file m_af_ghostcell.f90.
|
private |
Convert a boundary condition to two layers of ghost cell data.
[in] | nc | Number of cells |
[in,out] | cc | Cell-centered data |
[in] | nb | Neighbor direction |
[in] | bc_val | Boundary condition |
[in] | bc_type | Type of b.c. |
[in] | dr | Grid spacing |
Definition at line 282 of file m_af_ghostcell.f90.
subroutine, public m_af_ghostcell::af_gc_prolong_copy | ( | type(box_t), dimension(:), intent(inout) | boxes, |
integer, intent(in) | id, | ||
integer, intent(in) | nb, | ||
integer, intent(in) | iv, | ||
integer, intent(in) | op_mask | ||
) |
Partial prolongation to the ghost cells of box id from parent.
[in,out] | boxes | List of all boxes |
[in] | id | Id of child |
[in] | iv | Variable to fill |
[in] | nb | Neighbor to get data from |
[in] | op_mask | Multigrid operator mask |
Definition at line 378 of file m_af_ghostcell.f90.
subroutine, public m_af_ghostcell::af_gc_interp | ( | type(box_t), dimension(:), intent(inout) | boxes, |
integer, intent(in) | id, | ||
integer, intent(in) | nb, | ||
integer, intent(in) | iv, | ||
integer, intent(in) | op_mask | ||
) |
Interpolate between fine points and coarse neighbors to fill ghost cells near refinement boundaries.
[in,out] | boxes | List of all boxes |
[in] | id | Id of box |
[in] | nb | Ghost cell direction |
[in] | iv | Ghost cell variable |
[in] | op_mask | Multigrid operator mask |
Definition at line 394 of file m_af_ghostcell.f90.
subroutine, public m_af_ghostcell::af_gc_interp_lim | ( | type(box_t), dimension(:), intent(inout) | boxes, |
integer, intent(in) | id, | ||
integer, intent(in) | nb, | ||
integer, intent(in) | iv, | ||
integer, intent(in) | op_mask | ||
) |
Interpolate between fine points and coarse neighbors to fill ghost cells near refinement boundaries. The ghost values are less than twice the coarse values.
[in,out] | boxes | List of all boxes |
[in] | id | Id of box |
[in] | nb | Ghost cell direction |
[in] | iv | Ghost cell variable |
[in] | op_mask | Multigrid operator mask |
Definition at line 503 of file m_af_ghostcell.f90.
subroutine, public m_af_ghostcell::af_bc_neumann_zero | ( | type(box_t), intent(in) | box, |
integer, intent(in) | nb, | ||
integer, intent(in) | iv, | ||
real(dp), dimension(ndim, box%n_cell**(ndim-1)), intent(in) | coords, | ||
real(dp), dimension(box%n_cell**(ndim-1)), intent(out) | bc_val, | ||
integer, intent(out) | bc_type | ||
) |
This fills ghost cells near physical boundaries using Neumann zero.
Definition at line 615 of file m_af_ghostcell.f90.
subroutine, public m_af_ghostcell::af_bc_dirichlet_zero | ( | type(box_t), intent(in) | box, |
integer, intent(in) | nb, | ||
integer, intent(in) | iv, | ||
real(dp), dimension(ndim, box%n_cell**(ndim-1)), intent(in) | coords, | ||
real(dp), dimension(box%n_cell**(ndim-1)), intent(out) | bc_val, | ||
integer, intent(out) | bc_type | ||
) |
This fills ghost cells near physical boundaries using Dirichlet zero.
Definition at line 628 of file m_af_ghostcell.f90.
subroutine, public m_af_ghostcell::af_bc_set_continuous | ( | type(box_t), intent(in) | box, |
integer, intent(in) | nb, | ||
integer, intent(in) | iv, | ||
real(dp), dimension(ndim, box%n_cell**(ndim-1)), intent(in) | coords, | ||
real(dp), dimension(box%n_cell**(ndim-1)), intent(out) | bc_val, | ||
integer, intent(out) | bc_type | ||
) |
This fills ghost cells near physical boundaries using the same slope.
Definition at line 641 of file m_af_ghostcell.f90.
|
private |
[in,out] | box | Box on which to fill ghost cells |
[in] | box_nb | Neighbouring box |
[in] | dnb | Neighbor spatial index offset |
[in] | lo | Ghost cell low index |
[in] | hi | Ghost cell high index |
[in] | ivs | Ghost cell variable |
Definition at line 654 of file m_af_ghostcell.f90.
subroutine, public m_af_ghostcell::af_gc2_box | ( | type(af_t), intent(inout) | tree, |
integer, intent(in) | id, | ||
integer, dimension(:), intent(in) | ivs, | ||
real(dp), dimension(dtimes(-1:tree%n_cell+2), size(ivs)), intent(inout) | cc | ||
) |
Get array of cell-centered variables with multiple ghost cells, excluding corners.
[in,out] | tree | Tree to fill ghost cells on |
[in] | id | Id of box for which we set ghost cells |
[in] | ivs | Variables for which ghost cells are set |
Definition at line 672 of file m_af_ghostcell.f90.
|
private |
Conservative prolongation with a limited slope for ghost cells near refinement boundaries.
This method assumes that the ghost cells for leaves on a coarser level have already been set, which is typically the case.
[in] | id | Index of box to fill ghost cells for |
[in] | nb | Neighbor direction |
[in] | iv | Index of variable |
[in] | nc | Number of cells |
[in,out] | cc | Enlarged array |
Definition at line 753 of file m_af_ghostcell.f90.
subroutine m_af_ghostcell::af_corner_gc_extrap | ( | type(box_t), intent(inout) | box, |
integer, dimension(ndim), intent(in) | ix, | ||
integer, dimension(:), intent(in) | ivs | ||
) |
This fills corner ghost cells using linear extrapolation. The ghost cells on the sides already need to be filled.
[in,out] | box | Box to fill ghost cells for |
[in] | ix | Cell-index of corner |
[in] | ivs | Variable to fill |
Definition at line 860 of file m_af_ghostcell.f90.
|
private |
This fills edge ghost cells using linear extrapolation. The ghost cells on the sides already need to be filled. This routine basically performs the same operation as af_corner_gc_extrap does in 2D.
[in,out] | box | Box to operate on |
[in] | lo | Lowest index of edge ghost cells |
[in] | dim | Dimension parallel to edge |
[in] | ivs | Variable to fill |
Definition at line 885 of file m_af_ghostcell.f90.