diff --git a/WENO.F90 b/WENO.F90 index 11dcbcac3901eb9f4b213af5c680e96970608a9d..a6da580111b2bf9cc9365eeb7f3732fb1ae0b3d5 100644 --- a/WENO.F90 +++ b/WENO.F90 @@ -35,16 +35,17 @@ subroutine compute_flux_derivatives(nvars, ndim, nx, ny, nz, & real generalized_fluxes(nvars, ndim, -2:nx+3, -2:ny+3, -2:nz+3) real generalized_states_frozen(nvars, -2:3) real generalized_fluxes_frozen(nvars, ndim, -2:3) + real metric_solve_tmp(ndim) real R(nvars, nvars), R_inv(nvars, nvars), lambda_roe(nvars) real lambda_pointwise(nvars, -2:3) real lambda(nvars) - integer i, j, k, l, m + integer i, j, k real delta_xi, delta_eta, delta_zeta real characteristic_fluxes_pos(nvars, -2:3) real characteristic_fluxes_neg(nvars, -2:3) real metrics_frozen(ndim, ndim) real combined_frozen_metrics(ndim) - integer v + integer v, d ! grid spacing in generalized coordinates delta_xi = 1.0 @@ -52,8 +53,20 @@ subroutine compute_flux_derivatives(nvars, ndim, nx, ny, nz, & delta_zeta = 1.0 !$loopy begin tagged: to_generalized - call convert_to_generalized(nvars, ndim, nx, ny, nz, & - fluxes, metrics, metric_jacobians, generalized_fluxes) + !call convert_to_generalized(nvars, ndim, nx, ny, nz, & + ! fluxes, metrics, metric_jacobians, generalized_fluxes) + + ! FIXME: Manually inlined for now + do k=-2,nz+3 + do j=-2,ny+3 + do i=-2,nx+3 + do v=1,nvars + call mult_mat_vec(ndim, ndim, 1.0/metric_jacobians(i,j,k), metrics(:,:,i,j,k), & + fluxes(v,:,i,j,k), generalized_fluxes(v,:,i,j,k)) + end do + end do + end do + end do !$loopy end tagged: to_generalized ! for the next three loops, note carefully that the inner loop indices have a different range @@ -210,11 +223,25 @@ subroutine compute_flux_derivatives(nvars, ndim, nx, ny, nz, & !$loopy end tagged: flux_z_diff !$loopy begin tagged: from_generalized - call convert_from_generalized(nvars, ndim, nx, ny, nz, & - flux_derivatives_generalized, & - metrics, & - metric_jacobians, & - flux_derivatives) + !call convert_from_generalized(nvars, ndim, nx, ny, nz, & + ! flux_derivatives_generalized, & + ! metrics, & + ! metric_jacobians, & + ! flux_derivatives) + ! FIXME: Manually inlined for now + do k=-2,nz+3 + do j=-2,ny+3 + do i=-2,nx+3 + do v=1,nvars + call solve3x3(metrics(:,:,i,j,k), flux_derivatives_generalized(v,:,i,j,k), & + metric_solve_tmp) + do d=1,ndim + flux_derivatives(v,d,i,j,k) = metric_solve_tmp(d)*metric_jacobians(i,j,k) + end do + end do + end do + end do + end do !$loopy end tagged: from_generalized end subroutine @@ -489,6 +516,7 @@ subroutine convert_to_generalized_frozen( & end do end subroutine +#if 0 subroutine convert_to_generalized(nvars, ndim, nx, ny, nz, & fluxes, & metrics, & @@ -546,6 +574,7 @@ subroutine convert_from_generalized(nvars, ndim, nx, ny, nz, & end do end do end subroutine +#endif subroutine solve3x3(a, b, x) implicit none