GPU path: one device thread per element computes the modal transform and energy ratios, writes the indicator and flag on device, then copies both back to the host so the (host-side) mesh-adaptation logic can consume them directly.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(RefinementIndicator2D), | intent(inout) | :: | this | |||
| class(Scalar2D), | intent(in) | :: | solution | |||
| integer, | intent(in) | :: | ivar |
subroutine Estimate_RefinementIndicator2D(this,solution,ivar)
!! GPU path: one device thread per element computes the modal transform and energy
!! ratios, writes the indicator and flag on device, then copies both back to the host so
!! the (host-side) mesh-adaptation logic can consume them directly.
implicit none
class(RefinementIndicator2D),intent(inout) :: this
class(Scalar2D),intent(in) :: solution
integer,intent(in) :: ivar
if(solution%N /= this%N) then
print*,__FILE__,':',__LINE__, &
' : Error : solution degree does not match indicator degree.'
stop 1
endif
if(solution%nElem /= this%nElem) then
print*,__FILE__,':',__LINE__, &
' : Error : solution element count does not match indicator element count.'
stop 1
endif
if(ivar < 0 .or. ivar > solution%nVar) then
print*,__FILE__,':',__LINE__, &
' : Error : driving-variable index out of range.'
stop 1
endif
call RefinementIndicator_2D_gpu(this%Pmodal_gpu,solution%interior_gpu, &
this%indicator_gpu,this%flag_gpu, &
this%refineThreshold,this%coarsenThreshold, &
this%N,solution%nVar,ivar,this%nElem)
call this%UpdateHost()
endsubroutine Estimate_RefinementIndicator2D