Use precomputed coordinates in init_blast().
This commit is contained in:
parent
0ef1342df2
commit
da92634ddb
@ -483,11 +483,12 @@ module problem
|
|||||||
!
|
!
|
||||||
!===============================================================================
|
!===============================================================================
|
||||||
!
|
!
|
||||||
subroutine init_blast(pblock)
|
subroutine init_blast(pdata)
|
||||||
|
|
||||||
use blocks , only : block_data
|
use blocks , only : block_data
|
||||||
use config , only : in, jn, kn, im, jm, km, ng &
|
use config , only : im, jm, km
|
||||||
, gamma, dens, pres, ratio, rcut
|
use config , only : gamma, dens, pres, ratio, rcut
|
||||||
|
use coords , only : ax, ay, az
|
||||||
use scheme , only : prim2cons
|
use scheme , only : prim2cons
|
||||||
use variables, only : nvr, nqt, idn, ivx, ivy, ivz
|
use variables, only : nvr, nqt, idn, ivx, ivy, ivz
|
||||||
#ifdef ADI
|
#ifdef ADI
|
||||||
@ -502,13 +503,13 @@ module problem
|
|||||||
|
|
||||||
! input arguments
|
! input arguments
|
||||||
!
|
!
|
||||||
type(block_data), pointer, intent(inout) :: pblock
|
type(block_data), pointer, intent(inout) :: pdata
|
||||||
|
|
||||||
! local variables
|
! local variables
|
||||||
!
|
!
|
||||||
integer(kind=4), dimension(3) :: dm
|
integer(kind=4), dimension(3) :: dm
|
||||||
integer :: i, j, k
|
integer :: i, j, k
|
||||||
real :: dx, dy, dz, r
|
real :: r
|
||||||
|
|
||||||
! local arrays
|
! local arrays
|
||||||
!
|
!
|
||||||
@ -519,24 +520,14 @@ module problem
|
|||||||
!
|
!
|
||||||
!-------------------------------------------------------------------------------
|
!-------------------------------------------------------------------------------
|
||||||
!
|
!
|
||||||
! calculate the cell sizes
|
! obtain block coordinates
|
||||||
!
|
!
|
||||||
dx = (pblock%meta%xmax - pblock%meta%xmin) / in
|
x(:) = pdata%meta%xmin + ax(pdata%meta%level,:)
|
||||||
dy = (pblock%meta%ymax - pblock%meta%ymin) / jn
|
y(:) = pdata%meta%ymin + ay(pdata%meta%level,:)
|
||||||
#if NDIMS == 3
|
#if NDIMS == 3
|
||||||
dz = (pblock%meta%zmax - pblock%meta%zmin) / kn
|
z(:) = pdata%meta%zmin + az(pdata%meta%level,:)
|
||||||
#else /* NDIMS == 3 */
|
#else /* NDIMS == 3 */
|
||||||
dz = 1.0d0
|
z(:) = 0.0d0
|
||||||
#endif /* NDIMS == 3 */
|
|
||||||
|
|
||||||
! generate the coordinates
|
|
||||||
!
|
|
||||||
x(:) = ((/(i, i = 1, im)/) - ng - 0.5d0) * dx + pblock%meta%xmin
|
|
||||||
y(:) = ((/(j, j = 1, jm)/) - ng - 0.5d0) * dy + pblock%meta%ymin
|
|
||||||
#if NDIMS == 3
|
|
||||||
z(:) = ((/(k, k = 1, km)/) - ng - 0.5d0) * dz + pblock%meta%zmin
|
|
||||||
#else /* NDIMS == 3 */
|
|
||||||
z(1) = 0.0d0
|
|
||||||
#endif /* NDIMS == 3 */
|
#endif /* NDIMS == 3 */
|
||||||
|
|
||||||
! set the uniform variables
|
! set the uniform variables
|
||||||
@ -587,7 +578,7 @@ module problem
|
|||||||
|
|
||||||
! copy the conserved variables to the current block
|
! copy the conserved variables to the current block
|
||||||
!
|
!
|
||||||
pblock%u(1:nqt,1:im,j,k) = u(1:nqt,1:im)
|
pdata%u(1:nqt,1:im,j,k) = u(1:nqt,1:im)
|
||||||
|
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user