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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MappedVector2D_t), | intent(inout) | :: | this | |||
| type(Lagrange), | intent(in), | target | :: | interp | ||
| integer, | intent(in) | :: | nVar | |||
| integer, | intent(in) | :: | nElem |
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