Resize_MappedScalar2D Subroutine

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

Rebind to a new element count, reusing host pools and device buffers where they fit (AMR Stage 6b), and without uploading zeros the way Init does.

The mortar buffers are sized by mesh%nMortars, not nElem, and nMortars changes with the mesh independently of the element count, so they are invalidated here and lazily re-created at the right size by the next mortar exchange. Leaving a stale buffer in place would silently under-size that exchange.

Arguments

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

Calls

proc~~resize_mappedscalar2d~~CallsGraph proc~resize_mappedscalar2d Resize_MappedScalar2D proc~resize_mappedscalar2d_t Resize_MappedScalar2D_t proc~resize_mappedscalar2d->proc~resize_mappedscalar2d_t proc~gpucheck gpuCheck proc~resize_mappedscalar2d->proc~gpucheck interface~hipfree hipFree proc~resize_mappedscalar2d->interface~hipfree proc~ensuredevicebuffers_mappedscalar2d EnsureDeviceBuffers_MappedScalar2D proc~resize_mappedscalar2d->proc~ensuredevicebuffers_mappedscalar2d proc~resize_scalar2d_t Resize_Scalar2D_t proc~resize_mappedscalar2d_t->proc~resize_scalar2d_t ensuredevicebuffers_scalar2d ensuredevicebuffers_scalar2d proc~ensuredevicebuffers_mappedscalar2d->ensuredevicebuffers_scalar2d ensuredevicebuffer ensuredevicebuffer proc~ensuredevicebuffers_mappedscalar2d->ensuredevicebuffer

Contents

Source Code


Source Code

  subroutine Resize_MappedScalar2D(this,interp,nVar,nElem)
    !! Rebind to a new element count, reusing host pools and device buffers where they fit
    !! (AMR Stage 6b), and without uploading zeros the way Init does.
    !!
    !! The mortar buffers are sized by mesh%nMortars, not nElem, and nMortars changes with the
    !! mesh independently of the element count, so they are invalidated here and lazily
    !! re-created at the right size by the next mortar exchange. Leaving a stale buffer in place
    !! would silently under-size that exchange.
    implicit none
    class(MappedScalar2D),intent(inout) :: this
    type(Lagrange),intent(in),target :: interp
    integer,intent(in) :: nVar
    integer,intent(in) :: nElem

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

  endsubroutine Resize_MappedScalar2D