Scan the mesh boundary condition IDs and populate the elements/sides arrays for each registered boundary condition.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel1D_t), | intent(inout) | :: | this |
subroutine MapBoundaryConditions_DGModel1D_t(this)
!! Scan the mesh boundary condition IDs and populate the elements/sides
!! arrays for each registered boundary condition.
implicit none
class(DGModel1D_t),intent(inout) :: this
! Local
type(BoundaryCondition),pointer :: bc
integer :: nelem,count,n
integer :: elems(2),sds(2)
nelem = this%mesh%nElem
! Map hyperbolic BCs
bc => this%hyperbolicBCs%head
do while(associated(bc))
count = 0
if(this%mesh%bcid(1) == bc%bcid) count = count+1
if(this%mesh%bcid(2) == bc%bcid) count = count+1
if(count > 0) then
n = 0
if(this%mesh%bcid(1) == bc%bcid) then
n = n+1
elems(n) = 1
sds(n) = 1
endif
if(this%mesh%bcid(2) == bc%bcid) then
n = n+1
elems(n) = nelem
sds(n) = 2
endif
call this%hyperbolicBCs%PopulateBoundaries(bc%bcid,count, &
elems(1:count),sds(1:count))
endif
bc => bc%next
enddo
! Map parabolic BCs
bc => this%parabolicBCs%head
do while(associated(bc))
count = 0
if(this%mesh%bcid(1) == bc%bcid) count = count+1
if(this%mesh%bcid(2) == bc%bcid) count = count+1
if(count > 0) then
n = 0
if(this%mesh%bcid(1) == bc%bcid) then
n = n+1
elems(n) = 1
sds(n) = 1
endif
if(this%mesh%bcid(2) == bc%bcid) then
n = n+1
elems(n) = nelem
sds(n) = 2
endif
call this%parabolicBCs%PopulateBoundaries(bc%bcid,count, &
elems(1:count),sds(1:count))
endif
bc => bc%next
enddo
endsubroutine MapBoundaryConditions_DGModel1D_t