Set boundary conditions in GlobalA and GlobalB using two Dirchlet boundaries
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(:) | :: | points | Array of nodal coordinates |
|
| real(kind=wp), | intent(out), | dimension(:) | :: | GlobalB | Global RHS Vector |
|
| real(kind=wp), | intent(out), | dimension(:,:) | :: | GlobalA | Global Mass Matrix |
subroutine set_BCs(points, GlobalB, GlobalA)
!* Set boundary conditions in GlobalA and GlobalB using two
! Dirchlet boundaries
real(wp), intent(in), dimension(:) :: points !! Array of nodal coordinates
real(wp), intent(out), dimension(:) :: GlobalB !! Global RHS Vector
real(wp), intent(out), dimension(:,:) :: GlobalA !! Global Mass Matrix
integer, dimension(1) :: iloc !! Index variable to locate node numbers based on points
! Left Boundary Dirchlet BC
iloc = minloc(points)
GlobalA(iloc,:) = 0._wp
GlobalA(iloc,iloc) = 1._wp
GlobalB(iloc) = 0._wp
! Right Boundary Dirchlet BC
iloc = maxloc(points)
GlobalA(iloc,:) = 0._wp
GlobalA(iloc,iloc) = 1._wp
GlobalB(iloc) = 1._wp
! call r8mat_print(num_nodes, 1, GlobalB, 'Global RHS:')
! stop
return
end subroutine set_BCs