Subroutine to initialize matrices and space for sweeper Array of substep sizes
Make space for rhs
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pf_imexQ_t), | intent(inout) | :: | this | |||
class(pf_level_t), | intent(inout) | :: | lev | Current level |
subroutine imexQ_initialize(this, lev)
use pf_mod_quadrature
class(pf_imexQ_t), intent(inout) :: this
class(pf_level_t), intent(inout) :: lev !! Current level
integer :: nnodes,ierr
this%npieces = 2
nnodes = lev%nnodes
allocate(this%QdiffE(nnodes-1,nnodes),stat=ierr)
if (ierr /=0) stop "allocate fail in imexQ_initialize for QdiffE"
allocate(this%QdiffI(nnodes-1,nnodes),stat=ierr)
if (ierr /=0) stop "allocate fail in imexQ_initialize for QdiffI"
allocate(this%QtilE(nnodes-1,nnodes),stat=ierr)
if (ierr /=0) stop "allocate fail in imexQ_initialize for QtilE"
allocate(this%QtilI(nnodes-1,nnodes),stat=ierr)
if (ierr /=0) stop "allocate fail in imexQ_initialize for QtilI"
allocate(this%dtsdc(nnodes-1),stat=ierr)
if (ierr /=0) stop "allocate fail in imexQ_initialize for dtsdc"
this%QtilE = 0.0_pfdp
this%QtilI = 0.0_pfdp
!> Array of substep sizes
this%dtsdc = lev%sdcmats%qnodes(2:nnodes) - lev%sdcmats%qnodes(1:nnodes-1)
! Implicit matrix
if (this%use_LUq) then
this%QtilI = lev%sdcmats%qmatLU
else
this%QtilI = lev%sdcmats%qmatBE
end if
! Explicit matrix
this%QtilE = lev%sdcmats%qmatFE
this%QdiffE = lev%sdcmats%qmat-this%QtilE
this%QdiffI = lev%sdcmats%qmat-this%QtilI
!> Make space for rhs
call lev%ulevel%factory%create_single(this%rhs, lev%index, lev%shape)
end subroutine imexQ_initialize