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 is pure waste in the adaptive loop because the fields are rewritten immediately after.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Vector2D), | intent(inout) | :: | this | |||
| type(Lagrange), | intent(in), | target | :: | interp | ||
| integer, | intent(in) | :: | nVar | |||
| integer, | intent(in) | :: | nElem |
subroutine Resize_Vector2D(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 is
!! pure waste in the adaptive loop because the fields are rewritten immediately after.
implicit none
class(Vector2D),intent(inout) :: this
type(Lagrange),target,intent(in) :: interp
integer,intent(in) :: nVar
integer,intent(in) :: nElem
call Resize_Vector2D_t(this,interp,nVar,nElem)
call EnsureDeviceBuffers_Vector2D(this)
endsubroutine Resize_Vector2D