DiracDelta_2D_Points Subroutine

public subroutine DiracDelta_2D_Points(this, geometry, scalar)

GPU override of DiracDelta_2D_Points_t. When the scalar is a device-resident MappedScalar2D, the kernel writes scalar%interior_gpu directly (host array left stale; caller may UpdateHost). For non-GPU scalar subtypes, defers to the inherited host implementation.

Requires the per-point basis cache to be in sync with scalar%interp%N (LocatePoints + UpdateDevice).

Arguments

TypeIntentOptionalAttributesName
class(Points), intent(in) :: this
type(SEMQuad), intent(in) :: geometry
class(MappedScalar2D_t), intent(inout) :: scalar

Calls

proc~~diracdelta_2d_points~~CallsGraph proc~diracdelta_2d_points DiracDelta_2D_Points interface~diracdelta_2d_gpu DiracDelta_2D_gpu proc~diracdelta_2d_points->interface~diracdelta_2d_gpu

Contents

Source Code


Source Code

  subroutine DiracDelta_2D_Points(this,geometry,scalar)
    !! GPU override of DiracDelta_2D_Points_t. When the scalar is a
    !! device-resident MappedScalar2D, the kernel writes scalar%interior_gpu
    !! directly (host array left stale; caller may UpdateHost). For non-GPU
    !! scalar subtypes, defers to the inherited host implementation.
    !!
    !! Requires the per-point basis cache to be in sync with scalar%interp%N
    !! (LocatePoints + UpdateDevice).
    implicit none
    class(Points),intent(in) :: this
    type(SEMQuad),intent(in) :: geometry
    class(MappedScalar2D_t),intent(inout) :: scalar
    ! Local
    integer :: N

    select type(scalar)
    type is(MappedScalar2D)

      if(this%nDim /= 2) then
        print*,"SELF_Points (gpu)::DiracDelta (2D): nDim must be 2"
        stop 1
      endif
      if(scalar%nVar /= this%nPoints) then
        print*,"SELF_Points (gpu)::DiracDelta (2D): scalar%nVar (",scalar%nVar, &
          ") must equal nPoints (",this%nPoints,")"
        stop 1
      endif
      N = scalar%interp%N
      if(this%nCached /= N .or. .not. c_associated(this%lS_cache_gpu) .or. &
         .not. c_associated(this%lT_cache_gpu)) then
        print*,"SELF_Points (gpu)::DiracDelta (2D): basis cache not synchronized; ", &
          "call LocatePoints (or UpdateDevice) first. nCached=", &
          this%nCached," scalar%N=",N
        stop 1
      endif

      call DiracDelta_2D_gpu(scalar%interior_gpu, &
                             geometry%J%interior_gpu, &
                             this%lS_cache_gpu,this%lT_cache_gpu, &
                             scalar%interp%qWeights_gpu, &
                             this%elements_gpu, &
                             N,this%nPoints,scalar%nElem,scalar%nVar)

    class default
      ! Host-only scalar subtype: fall back to the inherited base impl.
      call this%Points_t%DiracDelta_2D_Points_t(geometry,scalar)
    endselect

  endsubroutine DiracDelta_2D_Points