setboundarycondition_DGModel1D_t Subroutine

public subroutine setboundarycondition_DGModel1D_t(this)

Apply boundary conditions for the solution. Periodic boundaries are set as the default; registered boundary conditions overwrite specific endpoints.

Arguments

TypeIntentOptionalAttributesName
class(DGModel1D_t), intent(inout) :: this

Called by

proc~~setboundarycondition_dgmodel1d_t~~CalledByGraph proc~setboundarycondition_dgmodel1d_t setboundarycondition_DGModel1D_t proc~setboundarycondition_dgmodel1d setboundarycondition_DGModel1D proc~setboundarycondition_dgmodel1d->proc~setboundarycondition_dgmodel1d_t

Contents


Source Code

  subroutine setboundarycondition_DGModel1D_t(this)
    !! Apply boundary conditions for the solution.
    !! Periodic boundaries are set as the default; registered
    !! boundary conditions overwrite specific endpoints.
    implicit none
    class(DGModel1D_t),intent(inout) :: this
    ! Local
    type(BoundaryCondition),pointer :: bc
    procedure(SELF_bcMethod),pointer :: apply_bc
    integer :: nelem

    nelem = this%mesh%nElem

    ! Default: periodic boundary conditions
    this%solution%extBoundary(1,1,1:this%nvar) = &
      this%solution%boundary(2,nelem,1:this%nvar)
    this%solution%extBoundary(2,nelem,1:this%nvar) = &
      this%solution%boundary(1,1,1:this%nvar)

    ! Apply registered boundary conditions
    bc => this%hyperbolicBCs%head
    do while(associated(bc))
      apply_bc => bc%bcMethod
      call apply_bc(bc,this)
      bc => bc%next
    enddo

  endsubroutine setboundarycondition_DGModel1D_t