!----------------------------------------------------------------------- ! Physical boundary conditions for 3d Euler equations. ! All sides periodic. ! Physical boundary conditions ! Interface: ! mx,my,mz := shape of grid ! ! u(,,) := grid ! ! lb(3) := lower bound for grid ! ub(3) := upper bound for grid ! lbbnd(3) := lower bound for boundary region ! ubnd(3) := upper bound for boundary region ! shapebnd(3) := shape of boundary region ! xc(3) := lower left corner of grid ! dx(3) := grid spacing ! dir := at which side of the grid is the boundary? ! bnd(,2,3) := lower left and upper right corner of global grid and ! of mb-1 internal boundary regions ! ! Copyright (C) 2002 Ralf Deiterding ! Brandenburgische Universitaet Cottbus ! ! Copyright (C) 2003-2007 California Institute of Technology ! Ralf Deiterding, ralf@amroc.net ! !----------------------------------------------------------------------- subroutine physbd(u,mx,my,mz,lb,ub,lbbnd,ubbnd,shapebnd, & xc,dx,dir,bnd,mb,time,meqn) implicit none integer mx, my, mz, meqn, mb, dir integer lb(3), ub(3), lbbnd(3), ubbnd(3), shapebnd(3) double precision u(meqn,mx,my,mz), xc(3), dx(3), bnd(mb,2,3), time ! Local variables integer i, j, k, imin, imax, jmin, jmax, kmin, kmax, m integer stride, getindx, isym, jsym, ksym !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! See definition of member-function extents() in BBox.h ! for calculation of stride stride = (ub(1) - lb(1))/(mx-1) !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! Find working domain imin = getindx(max(lbbnd(1), lb(1)), lb(1), stride) imax = getindx(min(ubbnd(1), ub(1)), lb(1), stride) jmin = getindx(max(lbbnd(2), lb(2)), lb(2), stride) jmax = getindx(min(ubbnd(2), ub(2)), lb(2), stride) kmin = getindx(max(lbbnd(3), lb(3)), lb(3), stride) kmax = getindx(min(ubbnd(3), ub(3)), lb(3), stride) if(imax .gt. mx .or. jmax .gt. my .or. kmax .gt. mz .or. & imin .lt. 1 .or. jmin .lt. 1 .or. kmin .lt. 1) then write(0,*)'INDEX ERROR in physbd' end if ! Left Side --- periodic !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (dir.eq.0) then return end if ! Right Side --- periodic !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (dir.eq.1) then return end if ! Bottom Side --- periodic !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (dir.eq.2) then return end if ! Top Side --- periodic !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (dir.eq.3) then return end if ! Front Side --- periodic !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (dir.eq.4) then return end if ! Back Side --- periodic !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (dir.eq.5) then return end if return end