sourcemethod_DGModel1D Subroutine

public subroutine sourcemethod_DGModel1D(this)

Arguments

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

Calls

proc~~sourcemethod_dgmodel1d~~CallsGraph proc~sourcemethod_dgmodel1d sourcemethod_DGModel1D interface~hipmemcpy hipMemcpy proc~sourcemethod_dgmodel1d->interface~hipmemcpy proc~gpucheck gpuCheck proc~sourcemethod_dgmodel1d->proc~gpucheck

Contents


Source Code

  subroutine sourcemethod_DGModel1D(this)
    implicit none
    class(DGModel1D),intent(inout) :: this
    ! Local
    integer :: iel
    integer :: i
    real(prec) :: f(1:this%solution%nvar),dfdx(1:this%solution%nvar)

    call gpuCheck(hipMemcpy(c_loc(this%solution%interior), &
                            this%solution%interior_gpu,sizeof(this%solution%interior), &
                            hipMemcpyDeviceToHost))

    call gpuCheck(hipMemcpy(c_loc(this%solutiongradient%interior), &
                            this%solutiongradient%interior_gpu,sizeof(this%solutiongradient%interior), &
                            hipMemcpyDeviceToHost))

    do concurrent(i=1:this%solution%N+1,iel=1:this%mesh%nElem)

      f = this%solution%interior(i,iel,1:this%solution%nvar)
      dfdx = this%solutionGradient%interior(i,iel,1:this%solution%nvar)

      this%source%interior(i,iel,1:this%solution%nvar) = &
        this%source1d(f,dfdx)

    enddo

    call gpuCheck(hipMemcpy(this%source%interior_gpu, &
                            c_loc(this%source%interior), &
                            sizeof(this%source%interior), &
                            hipMemcpyHostToDevice))

  endsubroutine sourcemethod_DGModel1D