| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RefinementIndicator2D), | 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 |
subroutine Init_RefinementIndicator2D(this,interp,nElem,refineThreshold,coarsenThreshold)
implicit none
class(RefinementIndicator2D),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_RefinementIndicator2D_t(this,interp,nElem,refineThreshold,coarsenThreshold)
! The device kernel uses per-thread scratch sized to (N+1) <= 16 (AMR2D_MAXNP in
! SELF_Refinement.cpp). Fail early rather than overrun that bound on the device.
if(interp%N+1 > 16) then
print*,__FILE__,':',__LINE__, &
' : Error : GPU refinement indicator supports degree N <= 15 '// &
'(raise AMR2D_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 this%UpdateDevice()
endsubroutine Init_RefinementIndicator2D