Resize_MappedVector2D_t Subroutine

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

Rebind to a new element count, reusing storage where it fits (AMR Stage 6b). See Resize_MappedScalar2D_t for why the mortar staging buffer is invalidated rather than resized.

Arguments

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

Calls

proc~~resize_mappedvector2d_t~~CallsGraph proc~resize_mappedvector2d_t Resize_MappedVector2D_t proc~resize_vector2d_t Resize_Vector2D_t proc~resize_mappedvector2d_t->proc~resize_vector2d_t

Called by

proc~~resize_mappedvector2d_t~~CalledByGraph proc~resize_mappedvector2d_t Resize_MappedVector2D_t proc~resize_mappedvector2d Resize_MappedVector2D proc~resize_mappedvector2d->proc~resize_mappedvector2d_t

Contents


Source Code

  subroutine Resize_MappedVector2D_t(this,interp,nVar,nElem)
    !! Rebind to a new element count, reusing storage where it fits (AMR Stage 6b). See
    !! Resize_MappedScalar2D_t for why the mortar staging buffer is invalidated rather than resized.
    implicit none
    class(MappedVector2D_t),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)
    if(allocated(this%mortarBuff)) deallocate(this%mortarBuff)

    ! The geometry binding refers to the PREVIOUS mesh's geometry, which the caller is
    ! about to destroy. It must be dropped here so the AssociateGeometry that follows a
    ! regrid actually rebinds: AssociateGeometry is a no-op when a geometry is already
    ! associated, so leaving the stale one in place silently kept every mapped operation
    ! reading freed metric terms - observed as NaN entropy on the first step after an
    ! adaptation. Free + Init used to hide this by nulling the pointer.
    call this%DissociateGeometry()

  endsubroutine Resize_MappedVector2D_t