Regrid_ECDGModel2D_t Subroutine

public subroutine Regrid_ECDGModel2D_t(this, mesh, geometry)

Rebind the EC model to a new mesh/geometry pair (AMR regrid). The parent Regrid resizes the DG fields and rebuilds the boundary conditions; this adds the mesh-sized state of the split form, which the parent does not know about: the two-point flux, and the mortar-normal staging field, which exists only while the mesh has mortars. The backend's Regrid runs, so a GPU backend's device-buffer regrid is included. The same mortar restrictions as Init apply to the new mesh.

Arguments

TypeIntentOptionalAttributesName
class(ECDGModel2D_t), intent(inout) :: this
type(Mesh2D), intent(in), target:: mesh
type(SEMQuad), intent(in), target:: geometry

Calls

proc~~regrid_ecdgmodel2d_t~~CallsGraph proc~regrid_ecdgmodel2d_t Regrid_ECDGModel2D_t proc~regrid_dgmodel2d Regrid_DGModel2D proc~regrid_ecdgmodel2d_t->proc~regrid_dgmodel2d proc~regrid_dgmodel2d_t Regrid_DGModel2D_t proc~regrid_ecdgmodel2d_t->proc~regrid_dgmodel2d_t proc~regrid_dgmodel2d->proc~regrid_dgmodel2d_t interface~hipfree hipFree proc~regrid_dgmodel2d->interface~hipfree interface~hipmalloc hipMalloc proc~regrid_dgmodel2d->interface~hipmalloc proc~gpucheck gpuCheck proc~regrid_dgmodel2d->proc~gpucheck interface~hipmemcpy hipMemcpy proc~regrid_dgmodel2d->interface~hipmemcpy

Contents

Source Code


Source Code

  subroutine Regrid_ECDGModel2D_t(this,mesh,geometry)
    !! Rebind the EC model to a new mesh/geometry pair (AMR regrid). The parent Regrid
    !! resizes the DG fields and rebuilds the boundary conditions; this adds the mesh-sized
    !! state of the split form, which the parent does not know about: the two-point flux, and
    !! the mortar-normal staging field, which exists only while the mesh has mortars. The
    !! backend's Regrid runs, so a GPU backend's device-buffer regrid is included.
    !! The same mortar restrictions as Init apply to the new mesh.
    implicit none
    class(ECDGModel2D_t),intent(inout) :: this
    type(Mesh2D),intent(in),target :: mesh
    type(SEMQuad),intent(in),target :: geometry

#ifdef ENABLE_GPU
    if(mesh%nMortars > 0) then
      print*,__FILE__,' : Error : EC-DGSEM models on GPU do not support mortar edges yet.'
      error stop 1
    endif
#endif
    call this%twoPointFlux%DissociateGeometry()
    call this%twoPointFlux%Free()
    if(this%mortarNormalReady) then
      call this%mortarNormal%DissociateGeometry()
      call this%mortarNormal%Free()
      this%mortarNormalReady = .false.
    endif

    ! The backend's Regrid is called by its specific name with the polymorphic this. A call
    ! through the parent component (this%DGModel2D%Regrid) is not polymorphic, so inside it
    ! AdditionalFree, AdditionalInit and SetMetadata would resolve to the DGModel2D defaults
    ! and the concrete model's hooks (its boundary conditions, for one) would not run.
#ifdef ENABLE_GPU
    call Regrid_DGModel2D(this,mesh,geometry)
#else
    call Regrid_DGModel2D_t(this,mesh,geometry)
#endif

    call this%twoPointFlux%Init(geometry%x%interp,this%nvar,mesh%nElem)
    call this%twoPointFlux%AssociateGeometry(geometry)
    if(mesh%nMortars > 0) then
      call this%mortarNormal%Init(geometry%x%interp,2,mesh%nElem)
      call this%mortarNormal%AssociateGeometry(geometry)
      this%mortarNormalReady = .true.
    endif

  endsubroutine Regrid_ECDGModel2D_t