Module fd4_boundary_mod


Uses:
    module fd4_domain_mod
    module fd4_block_mod
    module fd4_globaldef_mod
    module fd4_vartab_mod
    module fd4_ghostlist_mod
Subroutines and functions:
    public subroutine fd4_boundary_zerograd (domain, idx, st, opt_dim, opt_dir)
    public subroutine fd4_boundary_zerograd_block (domain, b, idx, st, opt_dim, opt_dir)
    private subroutine fd4_boundary_zerograd_set (domain, b, bgb, idx, st)
    public subroutine fd4_boundary_spec (domain, idx, st, face, dir, values)
    public subroutine fd4_boundary_spec_block (domain, b, idx, st, face, dir, values)
    private subroutine fd4_boundary_spec_set (domain, bgb, idx, st, values)

Apply boundary conditions on a domain.

Currently we have zero gradient and a simple method to set specific values.

Author: Matthias Lieber

See also: module fd4_domain_mod


Description of Subroutines and Functions

fd4_boundary_zerograd

public subroutine fd4_boundary_zerograd (domain, idx, st, opt_dim, opt_dir)
    type (fd4_domain), intent(inout) :: domain
    integer (kind=i_k), intent(in), dimension (:) :: idx
    integer (kind=i_k), intent(in), dimension (:) :: st
    integer (kind=i_k), optional, intent(in) :: opt_dim
    integer (kind=i_k), optional, intent(in) :: opt_dir
end subroutine fd4_boundary_zerograd
Parameters:
domain the domain
idx array of field indices
st array of time step indices
opt_dim optional specification of spatial dimensions
opt_dir optional specification of boundary direction (1...lower, 2...upper)
Apply zero gradient boundary conditions on all blocks of a domain.

Sets the given cell-centered vars in the boundary ghost block to the same value as in the cells at domain boundary. Sets the value of the given face variables at domain boundary (within domain) to vnull.

Valid values for opt_dim are FD4_X, FD4_Y, FD4_Z, FD4_XY, FD4_XZ, FD4_YZ, and FD4_XYZ. If no dimensions are specified, than boundary conditions for all 3 spatial dimensions are set (FD4_XYZ).

If opt_dir is not given or is not 1 or 2, both lower and upper boundaries are set.


fd4_boundary_zerograd_block

public subroutine fd4_boundary_zerograd_block (domain, b, idx, st, opt_dim, opt_dir)
    type (fd4_domain), intent(inout) :: domain
    type (fd4_block), pointer :: b
    integer (kind=i_k), intent(in), dimension (:) :: idx
    integer (kind=i_k), intent(in), dimension (:) :: st
    integer (kind=i_k), optional, intent(in) :: opt_dim
    integer (kind=i_k), optional, intent(in) :: opt_dir
end subroutine fd4_boundary_zerograd_block
Parameters:
domain the domain
b the block
idx array of field indices
st array of time step indices
opt_dim optional specification of spatial dimensions
opt_dir optional specification of boundary direction (1...lower, 2...upper)
Apply zero gradient boundary conditions on specified block

Sets the given cell-centered vars in the boundary ghost block to the same value as in the cells at domain boundary. Sets the value of the given face variables at domain boundary (within domain) to vnull.

Valid values for opt_dim are FD4_X, FD4_Y, FD4_Z, FD4_XY, FD4_XZ, FD4_YZ, and FD4_XYZ. If no dimensions are specified, than boundary conditions for all 3 spatial dimensions are set (FD4_XYZ).

If opt_dir is not given or is not 1 or 2, both lower and upper boundaries are set.


fd4_boundary_zerograd_set

private subroutine fd4_boundary_zerograd_set (domain, b, bgb, idx, st)
    type (fd4_domain), intent(inout) :: domain
    type (fd4_block), pointer :: b
    type (fd4_block), pointer :: bgb
    integer (kind=i_k), intent(in), dimension (:) :: idx
    integer (kind=i_k), intent(in), dimension (:) :: st
end subroutine fd4_boundary_zerograd_set
Parameters:
domain the domain
b the block
bgb the boundary ghost block
idx array of field indices
st array of time step indices
Apply zero gradient boundary conditions on specified block/boundary ghost block pair.

Internal subroutine. Used by fd4_boundary_zerograd and fd4_boundary_zerograd_block.


fd4_boundary_spec

public subroutine fd4_boundary_spec (domain, idx, st, face, dir, values)
    type (fd4_domain), intent(inout) :: domain
    integer (kind=i_k), intent(in), dimension (:) :: idx
    integer (kind=i_k), intent(in), dimension (:) :: st
    integer (kind=i_k), intent(in) :: face
    integer (kind=i_k), intent(in) :: dir
    real (kind=r_k), intent(in), dimension (:) :: values
end subroutine fd4_boundary_spec
Parameters:
domain the domain
idx array of field indices
st array of time step indices
face dimension to process (1,2,3)
dir direction to process (1...lower face, 2... upper face)
values values for each ghost plane
Apply specific boundary conditions on all blocks of a domain.

values(1) is used for the first boundary layer, values(2) for the second etc. Does only process cell centered variables. Only one spatial dimension and direction (upper, lower) is processed. Sets all variables to the same value.


fd4_boundary_spec_block

public subroutine fd4_boundary_spec_block (domain, b, idx, st, face, dir, values)
    type (fd4_domain), intent(inout) :: domain
    type (fd4_block), pointer :: b
    integer (kind=i_k), intent(in), dimension (:) :: idx
    integer (kind=i_k), intent(in), dimension (:) :: st
    integer (kind=i_k), intent(in) :: face
    integer (kind=i_k), intent(in) :: dir
    real (kind=r_k), intent(in), dimension (:) :: values
end subroutine fd4_boundary_spec_block
Parameters:
domain the domain
b the block
idx array of field indices
st array of time step indices
face dimension to process (1,2,3)
dir direction to process (1...lower face, 2... upper face)
values values for each ghost plane
Apply specific boundary conditions to a single block b of a domain.

values(1) is used for the first boundary layer, values(2) for the second etc. Does only process cell centered variables. Only one spatial dimension and direction (upper, lower) is processed. Sets all variables to the same value.


fd4_boundary_spec_set

private subroutine fd4_boundary_spec_set (domain, bgb, idx, st, values)
    type (fd4_domain), intent(inout) :: domain
    type (fd4_block), pointer :: bgb
    integer (kind=i_k), intent(in), dimension (:) :: idx
    integer (kind=i_k), intent(in), dimension (:) :: st
    real (kind=r_k), target, intent(in), dimension (:) :: values
end subroutine fd4_boundary_spec_set
Parameters:
domain the domain
bgb the boundary ghost block
idx array of field indices
st array of time step indices
values values for each ghost plane
Apply specific boundary conditions on specified block/boundary ghost block pair.

Internal subroutine. Used by fd4_boundary_spec.