CalculateEntropy_DGModel3D_t Subroutine

public subroutine CalculateEntropy_DGModel3D_t(this)

Arguments

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

Calls

proc~~calculateentropy_dgmodel3d_t~~CallsGraph proc~calculateentropy_dgmodel3d_t CalculateEntropy_DGModel3D_t mpi_allreduce mpi_allreduce proc~calculateentropy_dgmodel3d_t->mpi_allreduce

Contents


Source Code

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

    e = 0.0_prec
    do iel = 1,this%geometry%nelem
      do k = 1,this%solution%interp%N+1
        do j = 1,this%solution%interp%N+1
          do i = 1,this%solution%interp%N+1
            jac = abs(this%geometry%J%interior(i,j,k,iel,1))
            s = this%solution%interior(i,j,k,iel,1:this%nvar)
            e = e+this%entropy_func(s)*jac
          enddo
        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_DGModel3D_t