sourcemethod_DGModel2D Subroutine

public subroutine sourcemethod_DGModel2D(this)

Arguments

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

Calls

proc~~sourcemethod_dgmodel2d~~CallsGraph proc~sourcemethod_dgmodel2d sourcemethod_DGModel2D interface~hipmemcpy hipMemcpy proc~sourcemethod_dgmodel2d->interface~hipmemcpy proc~gpucheck gpuCheck proc~sourcemethod_dgmodel2d->proc~gpucheck

Contents


Source Code

  subroutine sourcemethod_DGModel2D(this)
    implicit none
    class(DGModel2D),intent(inout) :: this
    ! Local
    integer :: iel
    integer :: i
    integer :: j
    real(prec) :: s(1:this%nvar),dsdx(1:this%nvar,1:2)

    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,j=1:this%solution%N+1, &
                  iel=1:this%mesh%nElem)

      s = this%solution%interior(i,j,iel,1:this%nvar)
      dsdx = this%solutionGradient%interior(i,j,iel,1:this%nvar,1:2)
      this%source%interior(i,j,iel,1:this%nvar) = this%source2d(s,dsdx)

    enddo

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

  endsubroutine sourcemethod_DGModel2D