BoundaryFlux_DGModel1D Subroutine

public subroutine BoundaryFlux_DGModel1D(this)

Arguments

TypeIntentOptionalAttributesName
class(DGModel1D), intent(inout) :: this

Calls

proc~~boundaryflux_dgmodel1d~~CallsGraph proc~boundaryflux_dgmodel1d BoundaryFlux_DGModel1D interface~hipmemcpy hipMemcpy proc~boundaryflux_dgmodel1d->interface~hipmemcpy proc~gpucheck gpuCheck proc~boundaryflux_dgmodel1d->proc~gpucheck

Contents


Source Code

  subroutine BoundaryFlux_DGModel1D(this)
    ! this method uses an linear upwind solver for the
    ! advective flux and the bassi-rebay method for the
    ! diffusive fluxes
    implicit none
    class(DGModel1D),intent(inout) :: this
    ! Local
    integer :: iel
    integer :: iside
    real(prec) :: fin(1:this%solution%nvar)
    real(prec) :: fout(1:this%solution%nvar)
    real(prec) :: dfdx(1:this%solution%nvar),nhat

    call gpuCheck(hipMemcpy(c_loc(this%solution%boundary), &
                            this%solution%boundary_gpu,sizeof(this%solution%boundary), &
                            hipMemcpyDeviceToHost))

    call gpuCheck(hipMemcpy(c_loc(this%solution%extboundary), &
                            this%solution%extboundary_gpu,sizeof(this%solution%extboundary), &
                            hipMemcpyDeviceToHost))

    call gpuCheck(hipMemcpy(c_loc(this%solutiongradient%avgboundary), &
                            this%solutiongradient%avgboundary_gpu,sizeof(this%solutiongradient%avgboundary), &
                            hipMemcpyDeviceToHost))

    do concurrent(iside=1:2,iel=1:this%mesh%nElem)

      ! set the normal velocity
      if(iside == 1) then
        nhat = -1.0_prec
      else
        nhat = 1.0_prec
      endif

      fin = this%solution%boundary(iside,iel,1:this%solution%nvar) ! interior solution
      fout = this%solution%extboundary(iside,iel,1:this%solution%nvar) ! exterior solution
      dfdx = this%solutionGradient%avgboundary(iside,iel,1:this%solution%nvar) ! average solution gradient (with direction taken into account)
      this%flux%boundarynormal(iside,iel,1:this%solution%nvar) = &
        this%riemannflux1d(fin,fout,dfdx,nhat)

    enddo

    call gpuCheck(hipMemcpy(this%flux%boundarynormal_gpu, &
                            c_loc(this%flux%boundarynormal), &
                            sizeof(this%flux%boundarynormal), &
                            hipMemcpyHostToDevice))

  endsubroutine BoundaryFlux_DGModel1D