MappedDGGradient_MappedScalar2D Subroutine

public subroutine MappedDGGradient_MappedScalar2D(this, df)

Arguments

TypeIntentOptionalAttributesName
class(MappedScalar2D), intent(inout) :: this
type(c_ptr), intent(inout) :: df

Calls

proc~~mappeddggradient_mappedscalar2d~~CallsGraph proc~mappeddggradient_mappedscalar2d MappedDGGradient_MappedScalar2D interface~contravariantweight_2d_gpu ContravariantWeight_2D_gpu proc~mappeddggradient_mappedscalar2d->interface~contravariantweight_2d_gpu interface~dg_boundarycontribution_2d_gpu DG_BoundaryContribution_2D_gpu proc~mappeddggradient_mappedscalar2d->interface~dg_boundarycontribution_2d_gpu self_blas_matrixop_dim2_2d self_blas_matrixop_dim2_2d proc~mappeddggradient_mappedscalar2d->self_blas_matrixop_dim2_2d self_blas_matrixop_dim1_2d self_blas_matrixop_dim1_2d proc~mappeddggradient_mappedscalar2d->self_blas_matrixop_dim1_2d interface~normalweight_2d_gpu NormalWeight_2D_gpu proc~mappeddggradient_mappedscalar2d->interface~normalweight_2d_gpu interface~jacobianweight_2d_gpu JacobianWeight_2D_gpu proc~mappeddggradient_mappedscalar2d->interface~jacobianweight_2d_gpu

Contents


Source Code

  subroutine MappedDGGradient_MappedScalar2D(this,df)
    !!
    implicit none
    class(MappedScalar2D),intent(inout) :: this
    type(c_ptr),intent(inout) :: df
    ! Local
    real(prec),pointer :: f_p(:,:,:,:,:)
    type(c_ptr) :: fc

    call ContravariantWeight_2D_gpu(this%interior_gpu, &
                                    this%geometry%dsdx%interior_gpu,this%jas_gpu, &
                                    this%interp%N,this%nvar,this%nelem)

    ! From Vector divergence
    call c_f_pointer(this%jas_gpu,f_p,[this%interp%N+1,this%interp%N+1,this%nelem,2*this%nvar,2])

    fc = c_loc(f_p(1,1,1,1,1))
    call self_blas_matrixop_dim1_2d(this%interp%dgMatrix_gpu,fc,df, &
                                    this%interp%N,this%interp%N,2*this%nvar,this%nelem,this%blas_handle)

    fc = c_loc(f_p(1,1,1,1,2))
    call self_blas_matrixop_dim2_2d(this%interp%dgMatrix_gpu,fc,df, &
                                    1.0_c_prec,this%interp%N,this%interp%N,2*this%nvar,this%nelem,this%blas_handle)

    f_p => null()

    ! 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