imexQ_initialize Subroutine

public subroutine imexQ_initialize(this, lev)

Uses

  • proc~~imexq_initialize~~UsesGraph proc~imexq_initialize imexQ_initialize module~pf_mod_quadrature pf_mod_quadrature proc~imexq_initialize->module~pf_mod_quadrature module~pf_mod_dtype pf_mod_dtype module~pf_mod_quadrature->module~pf_mod_dtype iso_c_binding iso_c_binding module~pf_mod_quadrature->iso_c_binding module~pf_mod_dtype->iso_c_binding

Subroutine to initialize matrices and space for sweeper Array of substep sizes

Make space for rhs

Arguments

Type IntentOptional AttributesName
class(pf_imexQ_t), intent(inout) :: this
class(pf_level_t), intent(inout) :: lev

Current level


Contents

Source Code


Source Code

  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