CalculateEntropy_DGModel2D Subroutine

public subroutine CalculateEntropy_DGModel2D(this)

Arguments

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

Calls

proc~~calculateentropy_dgmodel2d~~CallsGraph proc~calculateentropy_dgmodel2d CalculateEntropy_DGModel2D interface~hipmemcpy hipMemcpy proc~calculateentropy_dgmodel2d->interface~hipmemcpy proc~gpucheck gpuCheck proc~calculateentropy_dgmodel2d->proc~gpucheck mpi_allreduce mpi_allreduce proc~calculateentropy_dgmodel2d->mpi_allreduce

Contents


Source Code

  subroutine CalculateEntropy_DGModel2D(this)
    implicit none
    class(DGModel2D),intent(inout) :: this
    ! Local
    integer :: iel,i,j,ierror
    real(prec) :: e,jac
    real(prec) :: s(1:this%nvar)

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

    e = 0.0_prec
    do iel = 1,this%geometry%nelem
      do j = 1,this%solution%interp%N+1
        do i = 1,this%solution%interp%N+1
          jac = abs(this%geometry%J%interior(i,j,iel,1))
          s = this%solution%interior(i,j,iel,1:this%nvar)
          e = e+this%entropy_func(s)*jac
        enddo
      enddo
    enddo

    if(this%mesh%decomp%mpiEnabled) then
      call mpi_allreduce(e, &
                         this%entropy, &
                         1, &
                         this%mesh%decomp%mpiPrec, &
                         MPI_SUM, &
                         this%mesh%decomp%mpiComm, &
                         iError)
    else
      this%entropy = e
    endif

  endsubroutine CalculateEntropy_DGModel2D