Free_AMRController3D Subroutine

public subroutine Free_AMRController3D(this)

Release the forest, the indicator, and any controller-emitted mesh/geometry. The caller-owned base mesh/geometry are untouched. A model still pointing at a controller-emitted mesh must not be used after this call.

Arguments

TypeIntentOptionalAttributesName
class(AMRController3D), intent(inout) :: this

Contents

Source Code


Source Code

  subroutine Free_AMRController3D(this)
    !! Release the forest, the indicator, and any controller-emitted mesh/geometry. The
    !! caller-owned base mesh/geometry are untouched. A model still pointing at a
    !! controller-emitted mesh must not be used after this call.
    implicit none
    class(AMRController3D),intent(inout) :: this

    call this%forest%Free()
    call this%indicator%Free()
    if(this%ownsActive) then
      call this%activeMesh%Free()
      deallocate(this%activeMesh)
    endif
    if(associated(this%geomA)) then
      call this%geomA%Free()
      deallocate(this%geomA)
    endif
    if(associated(this%geomB)) then
      call this%geomB%Free()
      deallocate(this%geomB)
    endif
    if(associated(this%genGeom)) then
      call this%genGeom%Free()
      deallocate(this%genGeom)
    endif
    this%baseMesh => null()
    this%activeMesh => null()
    this%activeGeom => null()
    this%geomA => null()
    this%geomB => null()
    this%genGeom => null()
    this%geomSlot = 0
    this%nGeomReused = 0
    this%nGeomGenerated = 0
    this%interp => null()
    this%ownsActive = .false.
    if(allocated(this%energyWeights)) deallocate(this%energyWeights)

  endsubroutine Free_AMRController3D