imexQ_oc_initialize Subroutine

public subroutine imexQ_oc_initialize(this, lev)

Make space for rhs

Arguments

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

Contents

Source Code


Source Code

  subroutine imexQ_oc_initialize(this, lev)
    class(pf_imexQ_oc_t), intent(inout) :: this
    class(pf_level_t),    intent(inout) :: lev  
    
    integer    ::  Nnodes
    
    this%npieces = 2

    Nnodes = lev%nnodes
    allocate(this%QdiffE(Nnodes-1,Nnodes))  !  S-FE
    allocate(this%QdiffI(Nnodes-1,Nnodes))  !  S-BE
    allocate(this%QtilE(Nnodes-1,Nnodes))  !  S-FE
    allocate(this%QtilI(Nnodes-1,Nnodes))  !  S-BE
    
    this%QtilE = 0.0_pfdp
    this%QtilI = 0.0_pfdp

    this%dtsdc = lev%nodes(2:Nnodes) - lev%nodes(1:Nnodes-1)

    ! Implicit matrix
    if (this%use_LUq) then 
       ! Get the LU
       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_oc_initialize