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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ECDGModel3D_t), | intent(inout) | :: | this | |||
| type(Mesh3D), | intent(in), | target | :: | mesh | ||
| type(SEMHex), | intent(in), | target | :: | geometry |
subroutine Regrid_ECDGModel3D_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(ECDGModel3D_t),intent(inout) :: this
type(Mesh3D),intent(in),target :: mesh
type(SEMHex),intent(in),target :: geometry
if(mesh%nMortars > 0) then
print*,__FILE__,' : Error : EC-DGSEM models do not support 2x2 nonconforming (mortar) faces.'
error stop 1
endif
#ifdef ENABLE_GPU
if(mesh%nAnisoMortars > 0) then
print*,__FILE__,' : Error : EC-DGSEM models on GPU do not support anisotropic mortar faces 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%DGModel3D%Regrid) is not polymorphic, so inside it
! AdditionalFree, AdditionalInit and SetMetadata would resolve to the DGModel3D defaults
! and the concrete model's hooks (its boundary conditions, for one) would not run.
#ifdef ENABLE_GPU
call Regrid_DGModel3D(this,mesh,geometry)
#else
call Regrid_DGModel3D_t(this,mesh,geometry)
#endif
call this%twoPointFlux%Init(geometry%x%interp,this%nvar,mesh%nElem)
call this%twoPointFlux%AssociateGeometry(geometry)
if(mesh%nAnisoMortars > 0) then
call this%mortarNormal%Init(geometry%x%interp,3,mesh%nElem)
call this%mortarNormal%AssociateGeometry(geometry)
this%mortarNormalReady = .true.
endif
endsubroutine Regrid_ECDGModel3D_t