Gradient_Scalar3D_t Subroutine

public subroutine Gradient_Scalar3D_t(this, df)

Arguments

TypeIntentOptionalAttributesName
class(Scalar3D_t), intent(in) :: this
real(kind=prec), intent(out) :: df(1:this%N+1,1:this%N+1,1:this%N+1,1:this%nelem,1:this%nvar,1:3)

Contents

Source Code


Source Code

  subroutine Gradient_Scalar3D_t(this,df)
    implicit none
    class(Scalar3D_t),intent(in) :: this
    real(prec),intent(out) :: df(1:this%N+1,1:this%N+1,1:this%N+1,1:this%nelem,1:this%nvar,1:3)
    ! Local
    integer    :: i,j,k,ii,iel,ivar
    real(prec) :: df1,df2,df3

    do concurrent(i=1:this%N+1,j=1:this%N+1, &
                  k=1:this%N+1,iel=1:this%nelem,ivar=1:this%nvar)

      df1 = 0.0_prec
      df2 = 0.0_prec
      df3 = 0.0_prec
      do ii = 1,this%N+1
        df1 = df1+this%interp%dMatrix(ii,i)*this%interior(ii,j,k,iel,ivar)
        df2 = df2+this%interp%dMatrix(ii,j)*this%interior(i,ii,k,iel,ivar)
        df3 = df3+this%interp%dMatrix(ii,k)*this%interior(i,j,ii,iel,ivar)
      enddo
      df(i,j,k,iel,ivar,1) = df1
      df(i,j,k,iel,ivar,2) = df2
      df(i,j,k,iel,ivar,3) = df3

    enddo

  endsubroutine Gradient_Scalar3D_t