Rebind to a new element count, reusing host pools and device buffers where they fit. Deliberately does NOT call UpdateDevice: Init uploads freshly zeroed arrays, which in the adaptive loop is pure waste because the solution transfer overwrites them immediately.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Scalar2D), | intent(inout) | :: | this | |||
| type(Lagrange), | intent(in), | target | :: | interp | ||
| integer, | intent(in) | :: | nVar | |||
| integer, | intent(in) | :: | nElem |
subroutine Resize_Scalar2D(this,interp,nVar,nElem)
!! Rebind to a new element count, reusing host pools and device buffers where they fit.
!! Deliberately does NOT call UpdateDevice: Init uploads freshly zeroed arrays, which in the
!! adaptive loop is pure waste because the solution transfer overwrites them immediately.
implicit none
class(Scalar2D),intent(inout) :: this
type(Lagrange),intent(in),target :: interp
integer,intent(in) :: nVar
integer,intent(in) :: nElem
call Resize_Scalar2D_t(this,interp,nVar,nElem)
call EnsureDeviceBuffers_Scalar2D(this)
endsubroutine Resize_Scalar2D