bc_set_Add Subroutine

private impure subroutine bc_set_Add(this, name, xlo, xhi, normal)

Adds a new region to bc_set.

Type Bound

bc_set

Arguments

Type IntentOptional Attributes Name
class(bc_set), intent(inout) :: this

Boundary conditions utility

character(len=*), intent(in) :: name

Name of region

real(kind=wp), intent(in) :: xlo(3)

Position of lower left corner

real(kind=wp), intent(in) :: xhi(3)

Position of upper right corner

character(len=*), intent(in) :: normal

Oriented normal


Calls

proc~~bc_set_add~~CallsGraph proc~bc_set_add bc_set%bc_set_Add proc~bc_set_checkbounds bc_set%bc_set_CheckBounds proc~bc_set_add->proc~bc_set_checkbounds proc~bc_set_expand bc_set%bc_set_Expand proc~bc_set_add->proc~bc_set_expand proc~bc_set_getsidedirbynormal bc_set%bc_set_GetSideDirByNormal proc~bc_set_add->proc~bc_set_getsidedirbynormal proc~bc_set_updateextents bc_set%bc_set_UpdateExtents proc~bc_set_add->proc~bc_set_updateextents proc~hashtbl_obj_hashstring hashtbl_obj%hashtbl_obj_HashString proc~bc_set_add->proc~hashtbl_obj_hashstring proc~hashtbl_obj_put hashtbl_obj%hashtbl_obj_Put proc~bc_set_add->proc~hashtbl_obj_put proc~region_obj_init region_obj%region_obj_Init proc~bc_set_add->proc~region_obj_init proc~bc_set_getregionindex bc_set%bc_set_GetRegionIndex proc~bc_set_updateextents->proc~bc_set_getregionindex proc~sllist_obj_put sllist_obj%sllist_obj_Put proc~hashtbl_obj_put->proc~sllist_obj_put proc~hashtbl_obj_init hashtbl_obj%hashtbl_obj_Init proc~region_obj_init->proc~hashtbl_obj_init proc~bc_set_getregionindex->proc~hashtbl_obj_hashstring none~get~3 hashtbl_obj%Get proc~bc_set_getregionindex->none~get~3 proc~sllist_obj_put->proc~sllist_obj_put proc~hashtbl_obj_get_int4 hashtbl_obj%hashtbl_obj_Get_int4 none~get~3->proc~hashtbl_obj_get_int4 proc~hashtbl_obj_get_int8 hashtbl_obj%hashtbl_obj_Get_int8 none~get~3->proc~hashtbl_obj_get_int8 proc~hashtbl_obj_get_real_dp hashtbl_obj%hashtbl_obj_Get_real_dp none~get~3->proc~hashtbl_obj_get_real_dp proc~hashtbl_obj_get_real_sp hashtbl_obj%hashtbl_obj_Get_real_sp none~get~3->proc~hashtbl_obj_get_real_sp none~get~2 sllist_obj%Get proc~hashtbl_obj_get_int4->none~get~2 proc~hashtbl_obj_get_int8->none~get~2 proc~hashtbl_obj_get_real_dp->none~get~2 proc~hashtbl_obj_get_real_sp->none~get~2 proc~sllist_obj_get_int4 sllist_obj%sllist_obj_Get_int4 none~get~2->proc~sllist_obj_get_int4 proc~sllist_obj_get_int8 sllist_obj%sllist_obj_Get_int8 none~get~2->proc~sllist_obj_get_int8 proc~sllist_obj_get_real_dp sllist_obj%sllist_obj_Get_real_dp none~get~2->proc~sllist_obj_get_real_dp proc~sllist_obj_get_real_sp sllist_obj%sllist_obj_Get_real_sp none~get~2->proc~sllist_obj_get_real_sp proc~sllist_obj_get_int4->proc~sllist_obj_get_int4 proc~sllist_obj_get_int8->proc~sllist_obj_get_int8 proc~sllist_obj_get_real_dp->proc~sllist_obj_get_real_dp proc~sllist_obj_get_real_sp->proc~sllist_obj_get_real_sp

Called by

proc~~bc_set_add~~CalledByGraph proc~bc_set_add bc_set%bc_set_Add proc~bc_set_read bc_set%bc_set_Read proc~bc_set_read->proc~bc_set_add

Source Code

    impure subroutine bc_set_Add(this,name,xlo,xhi,normal)
      !> Adds a new region to bc_set.
      class(bc_set),    intent(inout) :: this                                  !! Boundary conditions utility
      character(len=*), intent(in)    :: name                                  !! Name of region
      real(wp),         intent(in)    :: xlo(3)                                !! Position of lower left corner
      real(wp),         intent(in)    :: xhi(3)                                !! Position of upper right corner
      character(len=*), intent(in)    :: normal                                !! Oriented normal
      ! Work variables
      integer :: side
      integer :: dir
      logical :: is_valid

      ! Check that region bounds are valid
      is_valid = this%CheckBounds(xlo,xhi)
      if (.not. is_valid) call this%parallel%Stop("Invalid boundary region: "//trim(adjustl(name)))

      ! First resize array to accomodate a new element
      call this%Expand()

      ! Get side and direction from normal
      call this%GetSideDirByNormal(normal,side,dir)

      ! Initialize new region
      call this%region(this%count)%Initialize(name, xlo, xhi, dir, side)

      ! Add to hash table
      call this%tbl%Put(key=this%tbl%HashString(name),val=this%count)

      ! Update the extents
      call this%UpdateExtents(name)

      return
    end subroutine bc_set_Add