21 integer,
intent(in) :: ixI^L,ixO^L,ixL^L,ixR^L
22 double precision,
intent(in) :: w(ixI^S,nw),d2w(ixI^S,1:nwflux)
23 double precision,
intent(inout) :: drho(ixI^S),dp(ixI^S)
28 dp(ixo^s) = dabs(d2w(ixo^s,
e_c_))/min(w(ixl^s,
e_c_),w(ixr^s,
e_c_))
30 call mpistop(
"PPM with flatcd=.true. can not be used without energy equation!")
36 subroutine twofl_ppm_flatsh(ixI^L,ixO^L,ixLL^L,ixL^L,ixR^L,ixRR^L,idims,w,drho,dp,dv)
40 integer,
intent(in) :: ixI^L,ixO^L,ixLL^L,ixL^L,ixR^L,ixRR^L
41 integer,
intent(in) :: idims
42 double precision,
intent(in) :: w(ixI^S,nw)
43 double precision,
intent(inout) :: drho(ixI^S),dp(ixI^S),dv(ixI^S)
44 double precision :: ptot(ixI^S)
48 ptot(ixo^s)=w(ixo^s,
e_c_)+half*sum(w(ixo^s,
mag(:))**2,dim=
ndim+1)
49 where (dabs(ptot(ixrr^s)-ptot(ixll^s))>smalldouble)
50 drho(ixo^s) = dabs((ptot(ixr^s)-ptot(ixl^s))&
51 /(ptot(ixrr^s)-ptot(ixll^s)))
60 dp(ixo^s) = dabs(ptot(ixr^s)-ptot(ixl^s))&
61 /(w(ixo^s,
rho_c_)*dp(ixo^s))
63 ptot(ixi^s)= w(ixi^s,
mom_c(idims))
64 call gradient(ptot,ixi^l,ixo^l,idims,dv)
66 call mpistop(
"PPM with flatsh=.true. can not be used without energy equation!")
subroutine mpistop(message)
Exit MPI-AMRVAC with an error message.
Module with geometry-related routines (e.g., divergence, curl)
subroutine gradient(q, ixIL, ixOL, idir, gradq)
Calculate gradient of a scalar q within ixL in direction idir.
This module contains definitions of global parameters and variables and some generic functions/subrou...
integer, parameter ndim
Number of spatial dimensions for grid variables.
procedure(sub_ppm_flatcd), pointer phys_ppm_flatcd
procedure(sub_ppm_flatsh), pointer phys_ppm_flatsh
Magneto-hydrodynamics module.
integer, public e_c_
Index of the energy density (-1 if not present)
integer, dimension(:), allocatable, public mom_c
Indices of the momentum density.
integer, dimension(:), allocatable, public mag
Indices of the magnetic field.
integer, public rho_c_
Index of the density (in the w array)
integer, public, protected twofl_eq_energy
double precision, public twofl_gamma
The adiabatic index.
subroutine twofl_ppm_flatsh(ixIL, ixOL, ixLLL, ixLL, ixRL, ixRRL, idims, w, drho, dp, dv)
subroutine twofl_ppm_flatcd(ixIL, ixOL, ixLL, ixRL, w, d2w, drho, dp)
subroutine, public twofl_ppm_init()