Resize_MappedVector2D Subroutine

public subroutine Resize_MappedVector2D(this, interp, nVar, nElem)

Rebind to a new element count, reusing host pools and device buffers where they fit (AMR Stage 6b). Inherits the Vector2D resize (host pools plus the five device buffers) and adds this class's mortar buffers, which are sized by mesh%nMortars rather than nElem: nMortars changes with the mesh independently of the element count, so a stale buffer would silently under-size the next mortar exchange. They are invalidated here and lazily re-created at the correct size on next use.

Arguments

TypeIntentOptionalAttributesName
class(MappedVector2D), intent(inout) :: this
type(Lagrange), intent(in), target:: interp
integer, intent(in) :: nVar
integer, intent(in) :: nElem

Calls

proc~~resize_mappedvector2d~~CallsGraph proc~resize_mappedvector2d Resize_MappedVector2D proc~resize_mappedvector2d_t Resize_MappedVector2D_t proc~resize_mappedvector2d->proc~resize_mappedvector2d_t interface~hipfree hipFree proc~resize_mappedvector2d->interface~hipfree proc~gpucheck gpuCheck proc~resize_mappedvector2d->proc~gpucheck ensuredevicebuffers_vector2d ensuredevicebuffers_vector2d proc~resize_mappedvector2d->ensuredevicebuffers_vector2d proc~resize_vector2d_t Resize_Vector2D_t proc~resize_mappedvector2d_t->proc~resize_vector2d_t

Contents

Source Code


Source Code

  subroutine Resize_MappedVector2D(this,interp,nVar,nElem)
    !! Rebind to a new element count, reusing host pools and device buffers where they fit (AMR
    !! Stage 6b). Inherits the Vector2D resize (host pools plus the five device buffers) and adds
    !! this class's mortar buffers, which are sized by mesh%nMortars rather than nElem: nMortars
    !! changes with the mesh independently of the element count, so a stale buffer would silently
    !! under-size the next mortar exchange. They are invalidated here and lazily re-created at
    !! the correct size on next use.
    implicit none
    class(MappedVector2D),intent(inout) :: this
    type(Lagrange),target,intent(in) :: interp
    integer,intent(in) :: nVar
    integer,intent(in) :: nElem

    call Resize_MappedVector2D_t(this,interp,nVar,nElem)
    call EnsureDeviceBuffers_Vector2D(this)
    if(c_associated(this%mortarBuff_gpu)) then
      call gpuCheck(hipFree(this%mortarBuff_gpu))
      this%mortarBuff_gpu = c_null_ptr
    endif

  endsubroutine Resize_MappedVector2D