Preserve the current solution ahead of a regrid, so that Regrid may release the storage it lives in. Pair with ApplyTransferPlan, which consumes the staged copy:
call model%StageSolutionForTransfer()
call model%Regrid(newMesh,newGeom)
call model%ApplyTransferPlan(plan,interp,eFirst,eLast)
This base implementation stages on the host, which on a GPU build means a device-to-host copy of the whole field; a device-resident staging override is the 3-D analogue of the 2-D Stage 6a optimization.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DGModel3D_t), | intent(inout) | :: | this |
subroutine StageSolutionForTransfer_DGModel3D_t(this)
!! Preserve the current solution ahead of a regrid, so that Regrid may release the storage
!! it lives in. Pair with ApplyTransferPlan, which consumes the staged copy:
!!
!! call model%StageSolutionForTransfer()
!! call model%Regrid(newMesh,newGeom)
!! call model%ApplyTransferPlan(plan,interp,eFirst,eLast)
!!
!! This base implementation stages on the host, which on a GPU build means a
!! device-to-host copy of the whole field; a device-resident staging override is the 3-D
!! analogue of the 2-D Stage 6a optimization.
implicit none
class(DGModel3D_t),intent(inout) :: this
! Local
integer :: Np,nEl
Np = this%solution%interp%N+1
nEl = this%solution%nElem
call this%solution%UpdateHost()
if(allocated(this%transferStage)) deallocate(this%transferStage)
allocate(this%transferStage(1:Np,1:Np,1:Np,1:nEl,1:this%nvar))
this%transferStage(1:Np,1:Np,1:Np,1:nEl,1:this%nvar) = &
this%solution%interior(1:Np,1:Np,1:Np,1:nEl,1:this%nvar)
endsubroutine StageSolutionForTransfer_DGModel3D_t