setboundarycondition_LinearEuler3D Subroutine

public subroutine setboundarycondition_LinearEuler3D(this)

Boundary conditions are set to periodic boundary conditions

Arguments

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

Calls

proc~~setboundarycondition_lineareuler3d~~CallsGraph proc~setboundarycondition_lineareuler3d setboundarycondition_LinearEuler3D interface~hipmemcpy hipMemcpy proc~setboundarycondition_lineareuler3d->interface~hipmemcpy interface~setboundarycondition_lineareuler3d_gpu setboundarycondition_LinearEuler3D_gpu proc~setboundarycondition_lineareuler3d->interface~setboundarycondition_lineareuler3d_gpu proc~gpucheck gpuCheck proc~setboundarycondition_lineareuler3d->proc~gpucheck

Contents


Source Code

  subroutine setboundarycondition_LinearEuler3D(this)
    !! Boundary conditions are set to periodic boundary conditions
    implicit none
    class(LinearEuler3D),intent(inout) :: this
    ! local
    integer :: i,iEl,j,k,e2,bcid
    real(prec) :: x(1:3)

    if(this%prescribed_bcs_enabled) then
      call gpuCheck(hipMemcpy(c_loc(this%solution%extboundary), &
                              this%solution%extboundary_gpu,sizeof(this%solution%extboundary), &
                              hipMemcpyDeviceToHost))

      ! Prescribed boundaries are still done on the CPU
      do iEl = 1,this%solution%nElem ! Loop over all elements
        do k = 1,6 ! Loop over all sides

          bcid = this%mesh%sideInfo(5,j,iEl) ! Boundary Condition ID
          e2 = this%mesh%sideInfo(3,j,iEl) ! Neighboring Element ID

          if(e2 == 0) then
            if(bcid == SELF_BC_PRESCRIBED) then

              do j = 1,this%solution%interp%N+1 ! Loop over quadrature points
                do i = 1,this%solution%interp%N+1 ! Loop over quadrature points
                  x = this%geometry%x%boundary(i,j,k,iEl,1,1:3)

                  this%solution%extBoundary(i,j,k,iEl,1:this%nvar) = &
                    this%hbc3D_Prescribed(x,this%t)
                enddo
              enddo

            endif
          endif

        enddo
      enddo

      call gpuCheck(hipMemcpy(this%solution%extBoundary_gpu, &
                              c_loc(this%solution%extBoundary), &
                              sizeof(this%solution%extBoundary), &
                              hipMemcpyHostToDevice))
    endif
    call setboundarycondition_LinearEuler3D_gpu(this%solution%extboundary_gpu, &
                                                this%solution%boundary_gpu, &
                                                this%mesh%sideInfo_gpu, &
                                                this%geometry%nhat%boundary_gpu, &
                                                this%solution%interp%N, &
                                                this%solution%nelem)

  endsubroutine setboundarycondition_LinearEuler3D