• VTF
  • FSI
  • AMROC
  • SFC
  • Motion
  • STLIB
  • Main Page
  • src/3d/equations/acoustics/rp/flgout3ac.f

    c
    c     ==========================================================
          subroutine flgout3ac(q,mx,my,mz,lb,ub,qo,mxo,myo,mzo,lbo,ubo,
         &     aux,lbr,ubr,shaper,meqn,maux,nc,t)
    c     ==========================================================
    c
    c     # Computes primitives for Euler equations for output 
    c     # and flagging.
    c
    c     # Adaption based on pressure is often more intuitive.
    c
    c     # Copyright (C) 2002 Ralf Deiterding
    c     # Brandenburgische Universitaet Cottbus
    c
    c     # Copyright (C) 2003-2007 California Institute of Technology
    c     # Ralf Deiterding, ralf@cacr.caltech.edu
    c
          implicit double precision(a-h,o-z)
          integer meqn, mx, my, mz, mxo, myo, mzo
          dimension q(meqn,mx,my,mz), qo(mxo,myo,mzo), aux(maux,mx,my,mz)
          integer  lb(3), ub(3), lbo(3), ubo(3), lbr(3), ubr(3), shaper(3), 
         &     mresult, stride, imin(3), imax(3), i, getindx, d
    c
          stride = (ub(1) - lb(1))/(mx-1)
          do 5 d = 1, 3
             imin(d) = max(lb(d), lbr(d))
             imax(d) = min(ub(d), ubr(d))
    
             if (mod(imin(d)-lb(d),stride) .ne. 0) then
                imin(d) = imin(d) + stride - mod(imin(d)-lb(d),stride) 
             endif
             imin(d) = getindx(imin(d), lb(d), stride)  
    
             if (mod(imax(d)-lb(d),stride) .ne. 0) then
                imax(d) = imax(d) - mod(imax(d)-lb(d),stride) 
             endif
             imax(d) = getindx(imax(d), lb(d), stride)  
     5    continue
    
          do 10 i = imin(1), imax(1)
             do 10 j = imin(2), imax(2)
                do 10 k = imin(3), imax(3)
    c              # Density 
                   if (nc.eq.1) qo(i,j,k) = aux(1,i,j,k)
    c              # Velocity u fluctations
                   if (nc.eq.2) qo(i,j,k) = q(2,i,j,k)
    c              # Velocity v fluctations
                   if (nc.eq.3) qo(i,j,k) = q(3,i,j,k)
    c              # Velocity v fluctations
                   if (nc.eq.4) qo(i,j,k) = q(4,i,j,k)
    c              # Pressure fluctations
                   if (nc.eq.7) qo(i,j,k) = q(1,i,j,k)
    c              # Speed of sound
                   if (nc.eq.9) qo(i,j,k) = aux(2,i,j,k)
     10   continue         
    
          return
          end
    c
    c
    c
    c     ==========================================================
          subroutine out3ac(q,mx,my,mz,lb,ub,qo,mxo,myo,mzo,lbo,ubo,
         &     lbr,ubr,shaper,meqn,nc,t)
    c     ==========================================================
    c
    c     # Computes primitives for Euler equations for output 
    c     # and flagging.
    c
    c     # Adaption based on pressure is often more intuitive.
    c
    c     # Copyright (C) 2002 Ralf Deiterding
    c     # Brandenburgische Universitaet Cottbus
    c
    c     # Copyright (C) 2003-2007 California Institute of Technology
    c     # Ralf Deiterding, ralf@cacr.caltech.edu
    c
          implicit double precision(a-h,o-z)
          integer meqn, mx, my, mz, mxo, myo, mzo
          dimension q(meqn,mx,my,mz), qo(mxo,myo,mzo)
          integer  lb(3), ub(3), lbo(3), ubo(3), lbr(3), ubr(3), shaper(3), 
         &     mresult, stride, imin(3), imax(3), i, getindx, d
    c
          stride = (ub(1) - lb(1))/(mx-1)
          do 5 d = 1, 3
             imin(d) = max(lb(d), lbr(d))
             imax(d) = min(ub(d), ubr(d))
    
             if (mod(imin(d)-lb(d),stride) .ne. 0) then
                imin(d) = imin(d) + stride - mod(imin(d)-lb(d),stride) 
             endif
             imin(d) = getindx(imin(d), lb(d), stride)  
    
             if (mod(imax(d)-lb(d),stride) .ne. 0) then
                imax(d) = imax(d) - mod(imax(d)-lb(d),stride) 
             endif
             imax(d) = getindx(imax(d), lb(d), stride)  
     5    continue
    
          do 10 i = imin(1), imax(1)
             do 10 j = imin(2), imax(2)
                do 10 k = imin(3), imax(3)
    c              # Velocity u fluctations
                   if (nc.eq.2) qo(i,j,k) = q(2,i,j,k)
    c              # Velocity v fluctations
                   if (nc.eq.3) qo(i,j,k) = q(3,i,j,k)
    c              # Velocity v fluctations
                   if (nc.eq.4) qo(i,j,k) = q(4,i,j,k)
    c              # Pressure fluctations
                   if (nc.eq.7) qo(i,j,k) = q(1,i,j,k)
     10   continue         
    
          return
          end
    

<