Init_RefinementIndicator3D Subroutine

public subroutine Init_RefinementIndicator3D(this, interp, nElem, refineThreshold, coarsenThreshold)

Arguments

TypeIntentOptionalAttributesName
class(RefinementIndicator3D), intent(out) :: this
type(Lagrange), intent(in), target:: interp
integer, intent(in) :: nElem
real(kind=prec), intent(in) :: refineThreshold
real(kind=prec), intent(in) :: coarsenThreshold

Calls

proc~~init_refinementindicator3d~~CallsGraph proc~init_refinementindicator3d Init_RefinementIndicator3D proc~init_refinementindicator3d_t Init_RefinementIndicator3D_t proc~init_refinementindicator3d->proc~init_refinementindicator3d_t proc~gpucheck gpuCheck proc~init_refinementindicator3d->proc~gpucheck interface~hipmalloc hipMalloc proc~init_refinementindicator3d->interface~hipmalloc proc~buildmodaltransform BuildModalTransform proc~init_refinementindicator3d_t->proc~buildmodaltransform proc~normalizedlegendre NormalizedLegendre proc~buildmodaltransform->proc~normalizedlegendre proc~invertmatrix InvertMatrix proc~buildmodaltransform->proc~invertmatrix

Contents


Source Code

  subroutine Init_RefinementIndicator3D(this,interp,nElem,refineThreshold,coarsenThreshold)
    implicit none
    class(RefinementIndicator3D),intent(out) :: this
    type(Lagrange),intent(in),target :: interp
    integer,intent(in) :: nElem
    real(prec),intent(in) :: refineThreshold
    real(prec),intent(in) :: coarsenThreshold

    ! Reuse the portable host initialization (allocation + modal transform build).
    call Init_RefinementIndicator3D_t(this,interp,nElem,refineThreshold,coarsenThreshold)

    ! The device kernel uses per-block shared scratch sized to (N+1) <= 12 (AMR3D_MAXNP in
    ! SELF_Refinement.cpp; two (N+1)^3 shared buffers must fit the 48 KB static shared-memory
    ! limit in double precision). Fail early rather than overrun that bound on the device.
    if(interp%N+1 > 12) then
      print*,__FILE__,':',__LINE__, &
        ' : Error : GPU refinement indicator supports degree N <= 11 '// &
        '(raise AMR3D_MAXNP in SELF_Refinement.cpp to extend).'
      stop 1
    endif

    call gpuCheck(hipMalloc(this%Pmodal_gpu,sizeof(this%Pmodal)))
    call gpuCheck(hipMalloc(this%indicator_gpu,sizeof(this%indicator)))
    call gpuCheck(hipMalloc(this%flag_gpu,sizeof(this%flag)))
    call gpuCheck(hipMalloc(this%gate_gpu,sizeof(this%gate)))
    ! The gate weights are sized to the solution's variable count, which the first Estimate
    ! establishes; nothing is allocated for them here.
    this%energyWeight_gpu = c_null_ptr
    this%nVarWeights_gpu = 0

    call this%UpdateDevice()

  endsubroutine Init_RefinementIndicator3D