2 subroutine refine_grids(child_igrid,child_ipe,igrid,ipe,active)
5 integer,
dimension(2^D&),
intent(in) :: child_igrid, child_ipe
6 integer,
intent(in) :: igrid, ipe
7 logical,
intent(in) :: active
16 if ((time_advance .and. active).or.convert.or.reset_grid)
then
36 integer,
dimension(2^D&),
intent(in) :: child_igrid, child_ipe
37 integer,
intent(in) :: igrid, ipe
39 integer :: ix^L, ichild, ixCo^L, ic^D
40 double precision :: dxCo^D, xComin^D, dxFi^D, xFimin^D
42 {
#IFDEF EVOLVINGBOUNDARY
48 }{
#IFNDEF EVOLVINGBOUNDARY
60 ichild=child_igrid(ic^d)
62 ixcomin^d=ixmlo^d+(ic^d-1)*
block_nx^d/2\
63 ixcomax^d=ixmhi^d+(ic^d-2)*
block_nx^d/2\
68 dxco^d,xcomin^d,dxfi^d,xfimin^d,igrid,ichild)
72 if (prolongprimitive)
call phys_to_conserved(ixg^ll,ix^l,ps(igrid)%w,ps(igrid)%x)
77 subroutine prolong_2nd(sCo,ixCo^L,sFi,dxCo^D,xComin^D,dxFi^D,xFimin^D,igridCo,igridFi)
82 integer,
intent(in) :: ixCo^L, igridFi, igridCo
83 double precision,
intent(in) :: dxCo^D, xComin^D, dxFi^D, xFimin^D
84 type(state),
intent(in) :: sCo
85 type(state),
intent(inout) :: sFi
87 integer :: ixCo^D, jxCo^D, hxCo^D, ixFi^D, ix^D, idim, iw, ixCg^L, el
88 double precision :: slopeL, slopeR, slopeC, signC, signR
89 double precision :: slope(nw,ndim)
90 double precision :: eta^D
93 associate(wco=>sco%w, wfi=>sfi%w)
95 {
#IFDEF EVOLVINGBOUNDARY
98 ixcgmin^d=ixcomin^d-el\
99 ixcgmax^d=ixcomax^d+el\
102 {
do ixco^db = ixcg^lim^db
104 ixfi^db=2*(ixco^db-ixcomin^db)+ixmlo^db\}
107 hxco^d=ixco^d-
kr(^d,idim)\
108 jxco^d=ixco^d+
kr(^d,idim)\
111 slopel=wco(ixco^d,iw)-wco(hxco^d,iw)
112 sloper=wco(jxco^d,iw)-wco(ixco^d,iw)
113 slopec=half*(sloper+slopel)
116 signr=sign(one,sloper)
117 signc=sign(one,slopec)
135 slope(iw,idim)=signc*max(zero,min(dabs(slopec), &
136 signc*slopel,signc*sloper))
142 {
do ix^db=ixfi^db,ixfi^db+1 \}
151 eta^d=0.5d0*(dble(ix^d-ixfi^d)-0.5d0);
154 eta^d=(dble(ix^d-ixfi^d)-0.5d0)*(one-sfi%dvolume(ix^dd) &
155 /sum(sfi%dvolume(ixfi^d:ixfi^d+1^d%ix^dd))) \}
157 wfi(ix^d,1:nw) = wco(ixco^d,1:nw) &
158 + {(slope(1:nw,^d)*eta^d)+}
161 if(stagger_grid)
then
162 call already_fine(sfi,igridfi,fine_^l)
163 call prolong_2nd_stg(sco,sfi,ixco^l,ixm^ll,dxco^d,xcomin^d,dxfi^d,xfimin^d,.false.,fine_^l)
166 if(fix_small_values)
call phys_handle_small_values(prolongprimitive,wfi,sfi%x,ixg^ll,ixm^ll,
'prolong_2nd')
167 if(prolongprimitive)
call phys_to_conserved(ixg^ll,ixm^ll,wfi,sfi%x)
176 integer,
intent(in) :: ixCo^L
177 double precision,
intent(in) :: wCo(ixG^T,nw), xFi(ixG^T,1:ndim)
178 double precision,
intent(out) :: wFi(ixG^T,nw)
180 integer :: ixCo^D, ixFi^D, iw
183 {
do ixco^db = ixco^lim^db
184 ixfi^db=2*(ixco^db-ixcomin^db)+ixmlo^db\}
185 forall(iw=1:nw) wfi(ixfi^d:ixfi^d+1,iw)=wco(ixco^d,iw)
subroutine alloc_node(igrid)
allocate arrays on igrid node
subroutine dealloc_node(igrid)
subroutine initial_condition(igrid)
fill in initial condition
subroutine, public old_neighbors(child_igrid, child_ipe, igrid, ipe)
subroutine, public already_fine(sFi, ichild, fine_L)
This routine fills the fine faces before prolonging. It is the face equivalent of fix_conserve.
subroutine, public prolong_2nd_stg(sCo, sFi, ixCoLin, ixFiLin, dxCoD, xCominD, dxFiD, xFiminD, ghost, fine_Lin)
This subroutine performs a 2nd order prolongation for a staggered field F, preserving the divergence ...
This module contains definitions of global parameters and variables and some generic functions/subrou...
integer, dimension(3, 3) kr
Kronecker delta tensor.
integer, parameter rpxmin
logical stagger_grid
True for using stagger grid.
logical, dimension(:), allocatable phyboundblock
True if a block has any physical boundary.
integer block_nx
number of cells for each dimension in grid block excluding ghostcells
integer ixm
the mesh range (within a block with ghost cells)
double precision, dimension(:,:), allocatable rnode
Corner coordinates.
integer nghostcells
Number of ghost cells surrounding a grid.
logical slab_uniform
uniform Cartesian geometry or not (stretched Cartesian)
This module defines the procedures of a physics module. It contains function pointers for the various...
procedure(sub_convert), pointer phys_to_primitive
procedure(sub_small_values), pointer phys_handle_small_values
procedure(sub_convert), pointer phys_to_conserved
subroutine prolong_2nd(sCo, ixCoL, sFi, dxCoD, xCominD, dxFiD, xFiminD, igridCo, igridFi)
do 2nd order prolongation
subroutine prolong_grid(child_igrid, child_ipe, igrid, ipe)
prolong one block
subroutine refine_grids(child_igrid, child_ipe, igrid, ipe, active)
refine one block to its children blocks
subroutine prolong_1st(wCo, ixCoL, wFi, xFi)
do 1st order prolongation