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,
p_))/min(w(ixl^s,
p_),w(ixr^s,
p_))
30 call mpistop(
"PPM with flatcd=.true. can not be used without energy equation!")
36 subroutine mhd_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,
p_)+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_)*dp(ixo^s))
63 ptot(ixi^s)= w(ixi^s,
mom(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.
Magneto-hydrodynamics module.
integer, dimension(:), allocatable, public, protected mom
Indices of the momentum density.
double precision, public mhd_gamma
The adiabatic index.
integer, dimension(:), allocatable, public, protected mag
Indices of the magnetic field.
logical, public, protected mhd_energy
Whether an energy equation is used.
integer, public, protected p_
Index of the gas pressure (-1 if not present) should equal e_.
integer, public, protected rho_
Index of the density (in the w array)
subroutine, public mhd_ppm_init()
subroutine mhd_ppm_flatcd(ixIL, ixOL, ixLL, ixRL, w, d2w, drho, dp)
subroutine mhd_ppm_flatsh(ixIL, ixOL, ixLLL, ixLL, ixRL, ixRRL, idims, w, drho, dp, dv)
procedure(sub_ppm_flatcd), pointer phys_ppm_flatcd
procedure(sub_ppm_flatsh), pointer phys_ppm_flatsh