Adds a new variable to region.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(region_obj), | intent(inout) | :: | this |
A boundary region object |
||
| character(len=*), | intent(in) | :: | name |
Region name |
||
| integer, | intent(in) | :: | type |
Type of boundary condition |
||
| type(extent_obj), | intent(in) | :: | extents |
Region extents |
pure subroutine region_obj_Add(this,name,type,extents) !> Adds a new variable to region. class(region_obj), intent(inout) :: this !! A boundary region object character(len=*), intent(in) :: name !! Region name integer, intent(in) :: type !! Type of boundary condition type(extent_obj), intent(in) :: extents !! Region extents ! First resize arrays to accomodate a new element call this%Expand() ! Add to hash table call this%tbl%Put(key=this%tbl%HashString(name),val=this%count) ! Store the new BC this%BC(this%count)%name = name this%BC(this%count)%type = type select case(type) case (BC_DIRICHLET, BC_NEUMANN) ! Allocate val associate(lo => extents%lo, hi => extents%hi) allocate(this%BC(this%count)%val(lo(1):hi(1),lo(2):hi(2),lo(3):hi(3))) this%BC(this%count)%val = 0.0_wp end associate case default ! Do not allocate end select return end subroutine region_obj_Add