subroutine MappedDGGradient_MappedScalar2D(this,df)
!!
implicit none
class(MappedScalar2D),intent(inout) :: this
type(c_ptr),intent(inout) :: df
call ContravariantWeight_2D_gpu(this%interior_gpu, &
this%geometry%dsdx%interior_gpu,this%jas_gpu, &
this%interp%N,this%nvar,this%nelem)
! Weak-form (DG) divergence of the contravariant-weighted field (jas)
call VectorDivergence_2D_gpu(this%interp%dgMatrix_gpu,this%jas_gpu,df, &
this%interp%N,2*this%nvar,this%nelem)
! Do the boundary terms
call NormalWeight_2D_gpu(this%avgBoundary_gpu, &
this%geometry%nhat%boundary_gpu,this%geometry%nscale%boundary_gpu, &
this%boundarynormal_gpu, &
this%interp%N,this%nvar,this%nelem)
call DG_BoundaryContribution_2D_gpu(this%interp%bmatrix_gpu,this%interp%qweights_gpu, &
this%boundarynormal_gpu,df,this%interp%N,2*this%nvar,this%nelem)
call JacobianWeight_2D_gpu(df,this%geometry%J%interior_gpu,this%N,2*this%nVar,this%nelem)
endsubroutine MappedDGGradient_MappedScalar2D