24 character(len=*),
intent(in) :: geom
30 case (
"Cartesian",
"Cartesian_1D",
"Cartesian_2D",
"Cartesian_3D")
33 case (
"Cartesian_1D_expansion")
34 if (
ndim /= 1)
call mpistop(
"Geometry Cartesian_1D_expansion but ndim /= 1")
37 case (
"Cartesian_1.5D")
38 if (
ndim /= 1)
call mpistop(
"Geometry Cartesian_1.5D but ndim /= 1")
41 case (
"Cartesian_1.75D")
42 if (
ndim /= 1)
call mpistop(
"Geometry Cartesian_1.75D but ndim /= 1")
45 case (
"Cartesian_2.5D")
46 if (
ndim /= 2)
call mpistop(
"Geometry Cartesian_2.5D but ndim /= 2")
49 case (
"cylindrical",
"cylindrical_2D",
"cylindrical_3D")
55 case (
"cylindrical_2.5D")
56 if (
ndim /= 2)
call mpistop(
"Geometry cylindrical_2.5D but ndim /= 2")
62 case (
"polar",
"polar_2D",
"polar_3D")
69 if (
ndim /= 1)
call mpistop(
"Geometry polar_1.5D but ndim /= 1")
75 if (
ndim /= 2)
call mpistop(
"Geometry polar_2.5D but ndim /= 2")
81 case (
"spherical",
"spherical_2D",
"spherical_3D")
87 case (
"spherical_2.5D")
89 call mpistop(
"Geometry spherical_2.5D requires ndim == 2")
96 call mpistop(
"Unknown geometry specified")
107 if(
phi_/=3)
call mpistop(
"phi_ should be 3 in 3D spherical coord!")
108 if(mod(ng3(1),2)/=0) &
109 call mpistop(
"Number of meshes in phi-direction should be even!")
110 if(abs(xprobmin2)<smalldouble)
then
112 "Will apply pi-periodic conditions at northpole!"
117 if(abs(xprobmax2-dpi)<smalldouble)
then
119 "Will apply pi-periodic conditions at southpole!"
127 if (^d == phi_ .and. periodb(^d))
then
128 if(mod(ng^d(1),2)/=0)
then
129 call mpistop(
"Number of meshes in phi-direction should be even!")
132 if(abs(xprobmin1)<smalldouble)
then
134 write(unitterm,*)
"Will apply pi-periodic conditions at r=0"
139 write(unitterm,*)
"There is no cylindrical axis!"
150 integer,
intent(in) :: igrid
152 deallocate(ps(igrid)%surfaceC,ps(igrid)%surface,ps(igrid)%dvolume,ps(igrid)%dx,&
153 psc(igrid)%dx,ps(igrid)%ds,psc(igrid)%dvolume)
163 integer,
intent(in) :: ixG^L
165 double precision :: x(ixG^S,ndim), xext(ixGmin1-1:ixGmax1,1), drs(ixG^S), drs_ext(ixGmin1-1:ixGmax1), dx2(ixG^S), dx3(ixG^S)
166 double precision :: exp_factor_ext(ixGmin1-1:ixGmax1),del_exp_factor_ext(ixGmin1-1:ixGmax1),exp_factor_primitive_ext(ixGmin1-1:ixGmax1)
167 double precision :: exp_factor(ixGmin1:ixGmax1),del_exp_factor(ixGmin1:ixGmax1),exp_factor_primitive(ixGmin1:ixGmax1)
172 drs(ixg^s)=s%dx(ixg^s,1)
173 x(ixg^s,1)=s%x(ixg^s,1)
176 call usr_set_surface(ixgmin1,ixgmax1,x,drs,exp_factor,del_exp_factor,exp_factor_primitive)
177 if (any(exp_factor <= zero))
call mpistop(
"The area must always be strictly positive!")
179 s%surface(ixg^s,1)=exp_factor(ixg^s)
180 xext(ixgmin1-1,1)=x(1,1)-half*drs(1)
181 xext(ixg^s,1)=x(ixg^s,1)+half*drs(ixg^s)
182 drs_ext(ixgmin1-1)=drs(1)
183 drs_ext(ixg^s)=drs(ixg^s)
185 s%surfaceC(ixgmin1-1:ixgmax1,1)=exp_factor_ext(ixgmin1-1:ixgmax1)
189 drs(ixg^s)=s%dx(ixg^s,1)
191 dx2(ixg^s)=s%dx(ixg^s,2)}
193 dx3(ixg^s)=s%dx(ixg^s,3)}
196 s%surfaceC(ixg^s,1)=1.d0
197 s%surface(ixg^s,1) =1.d0
200 s%surfaceC(ixg^s,1)=dx2(ixg^s)
201 s%surfaceC(ixg^s,2)=drs(ixg^s)
202 s%surface(ixg^s,1) =dx2(ixg^s)
203 s%surface(ixg^s,2)=drs(ixg^s)
206 s%surfaceC(ixg^s,1)= dx2(ixg^s)*dx3(ixg^s)
207 s%surfaceC(ixg^s,2)= drs(ixg^s)*dx3(ixg^s)
208 s%surfaceC(ixg^s,3)= drs(ixg^s)*dx2(ixg^s)
209 s%surface(ixg^s,1)=s%surfaceC(ixg^s,1)
210 s%surface(ixg^s,2)=s%surfaceC(ixg^s,2)
211 s%surface(ixg^s,3)=s%surfaceC(ixg^s,3)
213 {s%surfaceC(0^
d%ixG^s,^
d)=s%surfaceC(1^
d%ixG^s,^
d);\}
215 x(ixg^s,1)=s%x(ixg^s,1)
217 x(ixg^s,2)=s%x(ixg^s,2)
219 drs(ixg^s)=s%dx(ixg^s,1)
221 dx2(ixg^s)=s%dx(ixg^s,2)
224 dx3(ixg^s)=s%dx(ixg^s,3)
227 s%surfaceC(ixg^s,1)=(x(ixg^s,1)+half*drs(ixg^s))**2 {^nooned &
228 *two*dsin(x(ixg^s,2))*dsin(half*dx2(ixg^s))}{^ifthreed*dx3(ixg^s)}
231 s%surfaceC(ixg^s,2)=x(ixg^s,1)*drs(ixg^s)&
232 *dsin(x(ixg^s,2)+half*dx2(ixg^s))}{^ifthreed*dx3(ixg^s)}
235 s%surfaceC(ixg^s,3)=x(ixg^s,1)*drs(ixg^s)*dx2(ixg^s)
239 s%surfaceC(0,1)=dabs(x(1,1)-half*drs(1))**2
242 s%surfaceC(0,ixgmin2:ixgmax2,1)=(x(1,ixgmin2:ixgmax2,1)-half*drs(1,&
243 ixgmin2:ixgmax2))**2*two*dsin(x(1,ixgmin2:ixgmax2,2))*dsin(half*dx2(1,&
245 s%surfaceC(ixgmin1:ixgmax1,0,2)=x(ixgmin1:ixgmax1,1,&
246 1)*drs(ixgmin1:ixgmax1,1)*dsin(x(ixgmin1:ixgmax1,1,&
247 2)-half*dx2(ixgmin1:ixgmax1,1))
250 s%surfaceC(0,ixgmin2:ixgmax2,ixgmin3:ixgmax3,1)=(x(1,ixgmin2:ixgmax2,&
251 ixgmin3:ixgmax3,1)-half*drs(1,ixgmin2:ixgmax2,&
252 ixgmin3:ixgmax3))**2*two*dsin(x(1,ixgmin2:ixgmax2,ixgmin3:ixgmax3,&
253 2))*dsin(half*dx2(1,ixgmin2:ixgmax2,ixgmin3:ixgmax3))*dx3(1,&
254 ixgmin2:ixgmax2,ixgmin3:ixgmax3)
255 s%surfaceC(ixgmin1:ixgmax1,0,ixgmin3:ixgmax3,2)=x(ixgmin1:ixgmax1,1,&
256 ixgmin3:ixgmax3,1)*drs(ixgmin1:ixgmax1,1,&
257 ixgmin3:ixgmax3)*dsin(x(ixgmin1:ixgmax1,1,ixgmin3:ixgmax3,&
258 2)-half*dx2(ixgmin1:ixgmax1,1,ixgmin3:ixgmax3))*dx3(ixgmin1:ixgmax1,1,&
260 s%surfaceC(ixgmin1:ixgmax1,ixgmin2:ixgmax2,0,3)=&
261 s%surfaceC(ixgmin1:ixgmax1,ixgmin2:ixgmax2,1,3)
264 s%surface(ixg^s,1)=x(ixg^s,1)**2 {^nooned &
265 *two*dsin(x(ixg^s,2))*dsin(half*dx2(ixg^s))}{^ifthreed*dx3(ixg^s)}
267 s%surface(ixg^s,2)=x(ixg^s,1)*drs(ixg^s)&
268 *dsin(x(ixg^s,2))}{^ifthreed*dx3(ixg^s)}
271 s%surface(ixg^s,3)=x(ixg^s,1)*drs(ixg^s)*dx2(ixg^s)}
274 x(ixg^s,1)=s%x(ixg^s,1)
275 drs(ixg^s)=s%dx(ixg^s,1)
277 dx2(ixg^s)=s%dx(ixg^s,2)}
279 dx3(ixg^s)=s%dx(ixg^s,3)}
281 s%surfaceC(ixg^s,1)=dabs(x(ixg^s,1)+half*drs(ixg^s)){^de&*
dx^de(ixg^s) }
283 if (
z_==2) s%surfaceC(ixg^s,2)=x(ixg^s,1)*drs(ixg^s){^ifthreed*dx3(ixg^s)}
284 if (
phi_==2) s%surfaceC(ixg^s,2)=drs(ixg^s){^ifthreed*dx3(ixg^s)}
287 if (
z_==3) s%surfaceC(ixg^s,3)=x(ixg^s,1)*drs(ixg^s)*dx2(ixg^s)
288 if (
phi_==3) s%surfaceC(ixg^s,3)=drs(ixg^s)*dx2(ixg^s)
291 s%surfaceC(0,1)=dabs(x(1,1)-half*drs(1))
294 s%surfaceC(0,ixgmin2:ixgmax2,1)=dabs(x(1,ixgmin2:ixgmax2,1)-half*drs(1,&
295 ixgmin2:ixgmax2))*dx2(1,ixgmin2:ixgmax2)
298 s%surfaceC(0,ixgmin2:ixgmax2,ixgmin3:ixgmax3,1)=dabs(x(1,ixgmin2:ixgmax2,&
299 ixgmin3:ixgmax3,1)-half*drs(1,ixgmin2:ixgmax2,ixgmin3:ixgmax3))*dx2(1,&
300 ixgmin2:ixgmax2,ixgmin3:ixgmax3)*dx3(1,ixgmin2:ixgmax2,&
303 {s%surfaceC(0^de%ixG^s,^de)=s%surfaceC(1^de%ixG^s,^de);\}
305 s%surface(ixg^s,1)=dabs(x(ixg^s,1)){^de&*
dx^de(ixg^s) }
307 if (
z_==2) s%surface(ixg^s,2)=x(ixg^s,1)*drs(ixg^s){^ifthreed*dx3(ixg^s)}
308 if (
phi_==2) s%surface(ixg^s,2)=drs(ixg^s){^ifthreed*dx3(ixg^s)}}
310 if (
z_==3) s%surface(ixg^s,3)=x(ixg^s,1)*drs(ixg^s)*dx2(ixg^s)
311 if (
phi_==3) s%surface(ixg^s,3)=drs(ixg^s)*dx2(ixg^s)}
314 call mpistop(
"Sorry, coordinate unknown")
323 integer,
intent(in) :: ixI^L, ixO^L, idir
324 double precision,
intent(in) :: q(ixI^S)
325 double precision,
intent(inout) :: gradq(ixI^S)
327 integer :: jxO^L, hxO^L
329 hxo^l=ixo^l-
kr(idir,^
d);
330 jxo^l=ixo^l+
kr(idir,^
d);
333 gradq(ixo^s)=half*(q(jxo^s)-q(hxo^s))/
dxlevel(idir)
335 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/(
block%x(jxo^s,idir)-
block%x(hxo^s,idir))
339 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/((
block%x(jxo^s,1)-
block%x(hxo^s,1)))
342 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/((
block%x(jxo^s,2)-
block%x(hxo^s,2))*
block%x(ixo^s,1))
346 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/((
block%x(jxo^s,3)-
block%x(hxo^s,3))*
block%x(ixo^s,1)*dsin(
block%x(ixo^s,2)))
353 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/(
block%x(jxo^s,idir)-
block%x(hxo^s,idir))
356 call mpistop(
'Unknown geometry')
362 subroutine gradientx(q,x,ixI^L,ixO^L,idir,gradq,fourth_order)
365 integer,
intent(in) :: ixI^L, ixO^L, idir
366 double precision,
intent(in) :: q(ixI^S), x(ixI^S,1:ndim)
367 double precision,
intent(inout) :: gradq(ixI^S)
368 logical,
intent(in) :: fourth_order
369 integer :: jxO^L, hxO^L, kxO^L
372 jxo^l=ixo^l+
kr(idir,^
d);
375 if(fourth_order)
then
378 if(iximin^
d>kxomin^
d.or.iximax^
d<kxomax^
d|.or.) &
379 call mpistop(
"Error in gradientx: Non-conforming input limits")
380 hxo^l=ixo^l-
kr(idir,^
d);
381 jxo^l=ixo^l+
kr(idir,^
d);
382 kxo^l=ixo^l+
kr(idir,^
d)*2;
383 gradq(ixo^s)=(27.d0*(q(jxo^s)-q(ixo^s))-q(kxo^s)+q(hxo^s))/24.d0/
dxlevel(idir)
385 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/
dxlevel(idir)
388 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/(x(jxo^s,idir)-x(hxo^s,idir))
392 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/((x(jxo^s,1)-x(hxo^s,1)))
395 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/((x(jxo^s,2)-x(hxo^s,2))*x(ixo^s,1))
399 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/((x(jxo^s,3)-x(hxo^s,3))*x(ixo^s,1)*dsin(x(ixo^s,2)))
404 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/((x(jxo^s,
phi_)-x(hxo^s,
phi_))*x(ixo^s,
r_))
406 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/(x(jxo^s,idir)-x(hxo^s,idir))
409 call mpistop(
'Unknown geometry')
418 integer,
intent(in) :: ixI^L, ixO^L, idir
419 double precision,
intent(in) :: q(ixI^S), x(ixI^S,1:ndim)
420 double precision,
intent(inout) :: gradq(ixI^S)
421 integer :: jxO^L, hxO^L, kxO^L
424 hxo^l=ixo^l-
kr(idir,^
d);
427 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/
dxlevel(idir)
429 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/(x(jxo^s,idir)-x(hxo^s,idir))
433 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/((x(jxo^s,1)-x(hxo^s,1)))
436 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/((x(jxo^s,2)-x(hxo^s,2))*x(ixo^s,1))
440 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/((x(jxo^s,3)-x(hxo^s,3))*x(ixo^s,1)*dsin(x(ixo^s,2)))
445 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/((x(jxo^s,
phi_)-x(hxo^s,
phi_))*x(ixo^s,
r_))
447 gradq(ixo^s)=(q(jxo^s)-q(hxo^s))/(x(jxo^s,idir)-x(hxo^s,idir))
450 call mpistop(
'Unknown geometry')
462 integer,
intent(in) :: ixI^L, ixO^L, idir
463 double precision,
intent(in) :: q(ixI^S)
464 double precision,
intent(inout) :: gradq(ixI^S)
465 double precision ,
dimension(ixI^S) :: qC,qL,qR,dqC,ldq,rdq
467 double precision :: x(ixI^S,1:ndim)
468 double precision :: invdx
469 integer :: hxO^L,ixC^L,jxC^L,gxC^L,hxC^L
471 x(ixi^s,1:ndim)=
block%x(ixi^s,1:ndim)
474 hxo^l=ixo^l-
kr(idir,^
d);
475 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
476 jxc^l=ixc^l+
kr(idir,^
d);
477 gxcmin^
d=ixcmin^
d-
kr(idir,^
d);gxcmax^
d=jxcmax^
d;
478 hxc^l=gxc^l+
kr(idir,^
d);
484 dqc(gxc^s)= qr(gxc^s)-ql(gxc^s)
486 ql(ixc^s) = ql(ixc^s) + half*ldq(ixc^s)
487 qr(ixc^s) = qr(ixc^s) - half*rdq(jxc^s)
494 gradq(ixo^s)=(qr(ixo^s)-ql(hxo^s))*invdx
496 gradq(ixo^s)=(qr(ixo^s)-ql(hxo^s))/
block%dx(ixo^s,idir)
498 gradq(ixo^s)=(qr(ixo^s)-ql(hxo^s))/
block%dx(ixo^s,idir)
501 gradq(ixo^s)=gradq(ixo^s)/x(ixo^s,1)
504 gradq(ixo^s)=gradq(ixo^s)/(x(ixo^s,1)*dsin(x(ixo^s,2)))
508 gradq(ixo^s)=(qr(ixo^s)-ql(hxo^s))/
block%dx(ixo^s,idir)
509 if(idir==
phi_) gradq(ixo^s)=gradq(ixo^s)/x(ixo^s,1)
515 subroutine divvector(qvec,ixI^L,ixO^L,divq,fourthorder,sixthorder)
517 integer,
intent(in) :: ixI^L,ixO^L
518 double precision,
intent(in) :: qvec(ixI^S,1:ndir)
519 double precision,
intent(inout) :: divq(ixI^S)
520 logical,
intent(in),
optional :: fourthorder
521 logical,
intent(in),
optional :: sixthorder
522 logical :: use_4th_order
523 logical :: use_6th_order
524 double precision :: qC(ixI^S), invdx(1:ndim)
525 integer :: jxO^L, hxO^L, ixC^L, jxC^L
526 integer :: idims, ix^L, gxO^L, kxO^L
527 integer :: lxO^L, fxO^L
529 use_4th_order = .false.
530 use_6th_order = .false.
531 if (
present(fourthorder)) use_4th_order = fourthorder
532 if (
present(sixthorder)) use_6th_order = sixthorder
533 if(use_4th_order .and. use_6th_order) &
534 call mpistop(
"divvector: using 4th and 6th order at the same time")
536 if(use_4th_order)
then
538 call mpistop(
"divvector: 4th order only supported for slab geometry")
541 else if(use_6th_order)
then
544 call mpistop(
"divvector: 6th order only supported for slab geometry")
551 if (iximin^
d>ixmin^
d.or.iximax^
d<ixmax^
d|.or.) &
552 call mpistop(
"Error in divvector: Non-conforming input limits")
559 if(use_6th_order)
then
560 lxo^l=ixo^l+3*
kr(idims,^
d);
561 kxo^l=ixo^l+2*
kr(idims,^
d);
562 jxo^l=ixo^l+
kr(idims,^
d);
563 hxo^l=ixo^l-
kr(idims,^
d);
564 gxo^l=ixo^l-2*
kr(idims,^
d);
565 fxo^l=ixo^l-3*
kr(idims,^
d);
566 divq(ixo^s)=divq(ixo^s)+&
567 (-qvec(fxo^s,idims)+9.d0*qvec(gxo^s,idims)-45.d0*qvec(hxo^s,idims)&
568 +qvec(lxo^s,idims)-9.d0*qvec(kxo^s,idims)+45.d0*qvec(jxo^s,idims))&
570 else if(use_4th_order)
then
572 kxo^l=ixo^l+2*
kr(idims,^
d);
573 jxo^l=ixo^l+
kr(idims,^
d);
574 hxo^l=ixo^l-
kr(idims,^
d);
575 gxo^l=ixo^l-2*
kr(idims,^
d);
576 divq(ixo^s)=divq(ixo^s)+&
577 (-qvec(kxo^s,idims)+8.d0*qvec(jxo^s,idims)-8.d0*&
578 qvec(hxo^s,idims)+qvec(gxo^s,idims))/(12.d0*
dxlevel(idims))
581 jxo^l=ixo^l+
kr(idims,^
d);
582 hxo^l=ixo^l-
kr(idims,^
d);
583 divq(ixo^s)=divq(ixo^s)+half*(qvec(jxo^s,idims) &
584 - qvec(hxo^s,idims))*invdx(idims)
589 hxo^l=ixo^l-
kr(idims,^
d);
590 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
591 jxc^l=ixc^l+
kr(idims,^
d);
594 qc(ixc^s)=
block%surfaceC(ixc^s,idims)*(qvec(ixc^s,idims)+0.5d0*
block%dx(ixc^s,idims)*&
595 (qvec(jxc^s,idims)-qvec(ixc^s,idims))/(
block%x(jxc^s,idims)-
block%x(ixc^s,idims)))
597 qc(ixc^s)=
block%surfaceC(ixc^s,idims)*half*(qvec(ixc^s,idims)+qvec(jxc^s,idims))
599 divq(ixo^s)=divq(ixo^s)+qc(ixo^s)-qc(hxo^s)
601 divq(ixo^s)=divq(ixo^s)/
block%dvolume(ixo^s)
612 integer,
intent(in) :: ixI^L,ixO^L
613 double precision,
intent(in) :: qvec(ixI^S,1:ndir)
614 double precision,
intent(inout) :: divq(ixI^S)
615 double precision,
dimension(ixI^S) :: qL,qR,dqC,ldq,rdq
617 double precision :: invdx(1:ndim)
618 integer :: hxO^L,ixC^L,jxC^L,idims,ix^L,gxC^L,hxC^L
622 if (iximin^
d>ixmin^
d.or.iximax^
d<ixmax^
d|.or.) &
623 call mpistop(
"Error in divvectorS: Non-conforming input limits")
628 hxo^l=ixo^l-
kr(idims,^
d);
629 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
630 jxc^l=ixc^l+
kr(idims,^
d);
631 gxcmin^
d=ixcmin^
d-
kr(idims,^
d);gxcmax^
d=jxcmax^
d;
632 hxc^l=gxc^l+
kr(idims,^
d);
633 qr(gxc^s) = qvec(hxc^s,idims)
634 ql(gxc^s) = qvec(gxc^s,idims)
636 dqc(gxc^s)= qr(gxc^s)-ql(gxc^s)
638 ql(ixc^s) = ql(ixc^s) + half*ldq(ixc^s)
639 qr(ixc^s) = qr(ixc^s) - half*rdq(jxc^s)
641 dqc(ixi^s)=qvec(ixi^s,idims)
646 divq(ixo^s)=divq(ixo^s)+half*(qr(ixo^s)-ql(hxo^s))*invdx(idims)
648 qr(ixc^s)=
block%surfaceC(ixc^s,idims)*qr(ixc^s)
649 ql(ixc^s)=
block%surfaceC(ixc^s,idims)*ql(ixc^s)
650 divq(ixo^s)=divq(ixo^s)+qr(ixo^s)-ql(hxo^s)
662 subroutine curlvector(qvec,ixI^L,ixO^L,curlvec,idirmin,idirmin0,ndir0,fourthorder)
665 integer,
intent(in) :: ixI^L,ixO^L
666 integer,
intent(in) :: ndir0, idirmin0
667 integer,
intent(inout) :: idirmin
668 double precision,
intent(in) :: qvec(ixI^S,1:ndir0)
669 double precision,
intent(inout) :: curlvec(ixI^S,idirmin0:3)
670 logical,
intent(in),
optional :: fourthorder
672 integer :: ixA^L,ixC^L,jxC^L,idir,jdir,kdir,hxO^L,jxO^L,kxO^L,gxO^L
673 double precision :: invdx(1:ndim)
674 double precision :: tmp(ixI^S),tmp2(ixI^S),xC(ixI^S),surface(ixI^S)
675 logical :: use_4th_order
681 use_4th_order = .false.
682 if (
present(fourthorder)) use_4th_order = fourthorder
684 if (use_4th_order)
then
686 call mpistop(
"curlvector: 4th order only supported for slab geometry")
694 if (iximin^
d>ixamin^
d.or.iximax^
d<ixamax^
d|.or.) &
695 call mpistop(
"Error in curlvector: Non-conforming input limits")
698 curlvec(ixo^s,idirmin0:3)=zero
704 do idir=idirmin0,3;
do jdir=1,ndim;
do kdir=1,ndir0
705 if(
lvc(idir,jdir,kdir)/=0)
then
706 if (.not. use_4th_order)
then
708 jxo^l=ixo^l+
kr(jdir,^
d);
709 hxo^l=ixo^l-
kr(jdir,^
d);
710 tmp(ixo^s)=half*(qvec(jxo^s,kdir) &
711 - qvec(hxo^s,kdir))*invdx(jdir)
714 kxo^l=ixo^l+2*
kr(jdir,^
d);
715 jxo^l=ixo^l+
kr(jdir,^
d);
716 hxo^l=ixo^l-
kr(jdir,^
d);
717 gxo^l=ixo^l-2*
kr(jdir,^
d);
718 tmp(ixo^s)=(-qvec(kxo^s,kdir) + 8.0d0 * qvec(jxo^s,kdir) - 8.0d0 * &
719 qvec(hxo^s,kdir) + qvec(gxo^s,kdir))/(12.0d0 *
dxlevel(jdir))
721 if(
lvc(idir,jdir,kdir)==1)
then
722 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)+tmp(ixo^s)
724 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)-tmp(ixo^s)
726 if(idir<idirmin)idirmin=idir
730 do idir=idirmin0,3;
do jdir=1,ndim;
do kdir=1,ndir0
731 if(
lvc(idir,jdir,kdir)/=0)
then
734 tmp(ixa^s)=qvec(ixa^s,kdir)
735 hxo^l=ixo^l-
kr(jdir,^
d);
736 jxo^l=ixo^l+
kr(jdir,^
d);
738 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/(
block%x(jxo^s,jdir)-
block%x(hxo^s,jdir))
740 hxo^l=ixo^l-
kr(jdir,^
d);
741 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
742 jxc^l=ixc^l+
kr(jdir,^
d);
743 tmp(ixc^s)=
block%surfaceC(ixc^s,jdir)*(qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
744 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir)))
745 tmp2(ixo^s)=(tmp(ixo^s)-tmp(hxo^s))/
block%dvolume(ixo^s)
747 hxo^l=ixo^l-
kr(jdir,^
d);
748 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
749 jxc^l=ixc^l+
kr(jdir,^
d);
751 tmp(ixc^s)=
block%ds(ixo^s,kdir)*(qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
752 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir)))
754 tmp(ixc^s)=(qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
755 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir)))
758 tmp2(ixo^s)=(tmp(ixo^s)-tmp(hxo^s))/
block%surface(ixo^s,idir)
760 tmp2(ixo^s)=(tmp(ixo^s)-tmp(hxo^s))/(
block%ds(ixo^s,jdir)*
block%ds(ixo^s,kdir))
763 call mpistop(
'no such curl evaluator')
765 if(
lvc(idir,jdir,kdir)==1)
then
766 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)+tmp2(ixo^s)
768 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)-tmp2(ixo^s)
770 if(idir<idirmin)idirmin=idir
776 do idir=idirmin0,3;
do jdir=1,ndim;
do kdir=1,ndir0
777 if(
lvc(idir,jdir,kdir)/=0)
then
778 tmp(ixa^s)=qvec(ixa^s,kdir)
779 hxo^l=ixo^l-
kr(jdir,^
d);
780 jxo^l=ixo^l+
kr(jdir,^
d);
783 tmp(ixa^s)=tmp(ixa^s)*
block%x(ixa^s,1)
784 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/((
block%x(jxo^s,1)-
block%x(hxo^s,1))*
block%x(ixo^s,1))
786 if(idir==1) tmp(ixa^s)=tmp(ixa^s)*dsin(
block%x(ixa^s,2))
787 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/((
block%x(jxo^s,2)-
block%x(hxo^s,2))*
block%x(ixo^s,1))
788 if(idir==1) tmp2(ixo^s)=tmp2(ixo^s)/dsin(
block%x(ixo^s,2))
791 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/((
block%x(jxo^s,3)-
block%x(hxo^s,3))*
block%x(ixo^s,1)*dsin(
block%x(ixo^s,2)))
794 if(
lvc(idir,jdir,kdir)==1)
then
795 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)+tmp2(ixo^s)
797 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)-tmp2(ixo^s)
799 if(idir<idirmin)idirmin=idir
804 do jdir=1,ndim;
do kdir=1,ndir0
805 if(
lvc(idir,jdir,kdir)/=0)
then
806 hxo^l=ixo^l-
kr(jdir,^
d);
807 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
808 jxc^l=ixc^l+
kr(jdir,^
d);
809 tmp(ixc^s)=
block%surfaceC(ixc^s,jdir)*(qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
810 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir)))
811 tmp2(ixo^s)=(tmp(ixo^s)-tmp(hxo^s))/
block%dvolume(ixo^s)
812 if(
lvc(idir,jdir,kdir)==1)
then
813 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)+tmp2(ixo^s)
815 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)-tmp2(ixo^s)
817 if(idir<idirmin)idirmin=idir
821 if(idir==2.and.
phi_>0) curlvec(ixo^s,2)=curlvec(ixo^s,2)+qvec(ixo^s,
phi_)/
block%x(ixo^s,
r_)
829 do idir=idirmin0,3;
do jdir=1,ndim;
do kdir=1,ndir0
830 if(
lvc(idir,jdir,kdir)/=0)
then
836 hxo^l=ixo^l-
kr(jdir,^
d);
837 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
838 jxc^l=ixc^l+
kr(jdir,^
d);
841 tmp(ixc^s)=qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
842 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir))
844 tmp(ixc^s)=0.5d0*(qvec(ixc^s,kdir)+qvec(jxc^s,kdir))
847 xc(ixc^s)=
block%x(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,jdir)
848 curlvec(ixo^s,idir)=(dsin(xc(ixo^s))*tmp(ixo^s)-&
849 dsin(xc(hxo^s))*tmp(hxo^s))*
block%dx(ixo^s,kdir)
851 hxo^l=ixo^l-
kr(kdir,^
d);
852 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
853 jxc^l=ixc^l+
kr(kdir,^
d);
856 tmp(ixc^s)=qvec(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,kdir)*&
857 (qvec(jxc^s,jdir)-qvec(ixc^s,jdir))/(
block%x(jxc^s,kdir)-
block%x(ixc^s,kdir))
859 tmp(ixc^s)=0.5d0*(qvec(ixc^s,jdir)+qvec(jxc^s,jdir))
861 curlvec(ixo^s,idir)=(curlvec(ixo^s,idir)+(tmp(hxo^s)-tmp(ixo^s))*
block%dx(ixo^s,jdir))&
862 /
block%surface(ixo^s,idir)*
block%x(ixo^s,idir)
868 hxo^l=ixo^l-
kr(kdir,^
d);
869 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
870 jxc^l=ixc^l+
kr(kdir,^
d);
873 tmp(ixc^s)=qvec(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,kdir)*&
874 (qvec(jxc^s,jdir)-qvec(ixc^s,jdir))/(
block%x(jxc^s,kdir)-
block%x(ixc^s,kdir))
876 tmp(ixc^s)=0.5d0*(qvec(ixc^s,jdir)+qvec(jxc^s,jdir))
878 curlvec(ixo^s,idir)=(tmp(ixo^s)-tmp(hxo^s))*
block%dx(ixo^s,1)
880 hxo^l=ixo^l-
kr(jdir,^
d);
881 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
882 jxc^l=ixc^l+
kr(jdir,^
d);
885 tmp(ixc^s)=qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
886 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir))
888 tmp(ixc^s)=0.5d0*(qvec(ixc^s,kdir)+qvec(jxc^s,kdir))
891 xc(ixc^s)=
block%x(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,jdir)
892 curlvec(ixo^s,idir)=(curlvec(ixo^s,idir)+(xc(hxo^s)*tmp(hxo^s)-xc(ixo^s)*tmp(ixo^s))*&
893 dsin(
block%x(ixo^s,idir))*
block%dx(ixo^s,kdir))/
block%surface(ixo^s,idir)
899 hxo^l=ixo^l-
kr(kdir,^
d);
900 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
901 jxc^l=ixc^l+
kr(kdir,^
d);
904 tmp(ixc^s)=qvec(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,kdir)*&
905 (qvec(jxc^s,jdir)-qvec(ixc^s,jdir))/(
block%x(jxc^s,kdir)-
block%x(ixc^s,kdir))
907 tmp(ixc^s)=0.5d0*(qvec(ixc^s,jdir)+qvec(jxc^s,jdir))
909 curlvec(ixo^s,idir)=(tmp(hxo^s)-tmp(ixo^s))*
block%dx(ixo^s,jdir)
911 hxo^l=ixo^l-
kr(jdir,^
d);
912 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
913 jxc^l=ixc^l+
kr(jdir,^
d);
916 tmp(ixc^s)=qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
917 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir))
919 tmp(ixc^s)=0.5d0*(qvec(ixc^s,kdir)+qvec(jxc^s,kdir))
922 xc(ixc^s)=
block%x(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,jdir)
924 surface(ixo^s)=
block%surface(ixo^s,idir)
926 surface(ixo^s)=
block%x(ixo^s,jdir)*
block%dx(ixo^s,kdir)*
block%dx(ixo^s,jdir)
928 curlvec(ixo^s,idir)=(curlvec(ixo^s,idir)+(xc(ixo^s)*tmp(ixo^s)-xc(hxo^s)*tmp(hxo^s))*
block%dx(ixo^s,kdir))&
932 if(idir<idirmin)idirmin=idir
936 call mpistop(
'no such curl evaluator')
941 do idir=idirmin0,3;
do jdir=1,ndim;
do kdir=1,ndir0
942 if(
lvc(idir,jdir,kdir)/=0)
then
943 tmp(ixa^s)=qvec(ixa^s,kdir)
944 hxo^l=ixo^l-
kr(jdir,^
d);
945 jxo^l=ixo^l+
kr(jdir,^
d);
946 if(
z_==3.or.
z_==-1)
then
950 if(idir==
z_) tmp(ixa^s)=tmp(ixa^s)*
block%x(ixa^s,1)
952 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/(
block%x(jxo^s,1)-
block%x(hxo^s,1))
953 if(idir==
z_) tmp2(ixo^s)=tmp2(ixo^s)/
block%x(ixo^s,1)
956 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/((
block%x(jxo^s,2)-
block%x(hxo^s,2))*
block%x(ixo^s,1))
960 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/(
block%x(jxo^s,3)-
block%x(hxo^s,3))
968 if(idir==
z_) tmp(ixa^s)=tmp(ixa^s)*
block%x(ixa^s,1)
970 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/(
block%x(jxo^s,1)-
block%x(hxo^s,1))
971 if(idir==
z_) tmp2(ixo^s)=tmp2(ixo^s)/
block%x(ixo^s,1)
974 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/(
block%x(jxo^s,2)-
block%x(hxo^s,2))
978 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/((
block%x(jxo^s,3)-
block%x(hxo^s,3))*
block%x(ixo^s,1))
982 if(
lvc(idir,jdir,kdir)==1)
then
983 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)+tmp2(ixo^s)
985 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)-tmp2(ixo^s)
987 if(idir<idirmin)idirmin=idir
991 if(ndim<2)
call mpistop(
"Gaussbased for 2D, 2.5D or 3D polar or cylindrical only")
993 do jdir=1,ndim;
do kdir=1,ndir0
994 if(
lvc(idir,jdir,kdir)/=0)
then
995 hxo^l=ixo^l-
kr(jdir,^
d);
996 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
997 jxc^l=ixc^l+
kr(jdir,^
d);
998 tmp(ixc^s)=
block%surfaceC(ixc^s,jdir)*(qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
999 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir)))
1000 tmp2(ixo^s)=(tmp(ixo^s)-tmp(hxo^s))/
block%dvolume(ixo^s)
1001 if(
lvc(idir,jdir,kdir)==1)
then
1002 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)+tmp2(ixo^s)
1004 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)-tmp2(ixo^s)
1006 if(idir<idirmin)idirmin=idir
1013 if((idir==
phi_.or.(
phi_==-1.and.idir==3)).and.
z_>0)
then
1015 if(
z_==2) curlvec(ixo^s,idir)=curlvec(ixo^s,idir)-qvec(ixo^s,
z_)/
block%x(ixo^s,
r_)
1017 if(
phi_==2) curlvec(ixo^s,idir)=curlvec(ixo^s,idir)+qvec(ixo^s,
z_)/
block%x(ixo^s,
r_)
1021 if(ndim<3)
call mpistop(
"Stokesbased for 3D cylindrical only")
1022 do idir=idirmin0,3;
do jdir=1,ndim;
do kdir=1,ndir0
1023 if(
lvc(idir,jdir,kdir)/=0)
then
1028 hxo^l=ixo^l-
kr(jdir,^
d);
1029 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1030 jxc^l=ixc^l+
kr(jdir,^
d);
1033 tmp(ixc^s)=qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
1034 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir))
1036 tmp(ixc^s)=0.5d0*(qvec(ixc^s,kdir)+qvec(jxc^s,kdir))
1038 curlvec(ixo^s,idir)=(tmp(ixo^s)-tmp(hxo^s))*
block%dx(ixo^s,kdir)
1040 hxo^l=ixo^l-
kr(kdir,^
d);
1041 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1042 jxc^l=ixc^l+
kr(kdir,^
d);
1045 tmp(ixc^s)=qvec(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,kdir)*&
1046 (qvec(jxc^s,jdir)-qvec(ixc^s,jdir))/(
block%x(jxc^s,kdir)-
block%x(ixc^s,kdir))
1048 tmp(ixc^s)=0.5d0*(qvec(ixc^s,jdir)+qvec(jxc^s,jdir))
1050 curlvec(ixo^s,idir)=(curlvec(ixo^s,idir)+(tmp(hxo^s)-tmp(ixo^s))*
block%x(ixo^s,idir)*
block%dx(ixo^s,jdir))&
1051 /
block%surface(ixo^s,idir)
1053 else if(idir==
phi_)
then
1057 hxo^l=ixo^l-
kr(kdir,^
d);
1058 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1059 jxc^l=ixc^l+
kr(kdir,^
d);
1062 tmp(ixc^s)=qvec(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,kdir)*&
1063 (qvec(jxc^s,jdir)-qvec(ixc^s,jdir))/(
block%x(jxc^s,kdir)-
block%x(ixc^s,kdir))
1065 tmp(ixc^s)=0.5d0*(qvec(ixc^s,jdir)+qvec(jxc^s,jdir))
1067 curlvec(ixo^s,idir)=(tmp(ixo^s)-tmp(hxo^s))*
block%dx(ixo^s,jdir)
1069 hxo^l=ixo^l-
kr(jdir,^
d);
1070 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1071 jxc^l=ixc^l+
kr(jdir,^
d);
1074 tmp(ixc^s)=qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
1075 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir))
1077 tmp(ixc^s)=0.5d0*(qvec(ixc^s,kdir)+qvec(jxc^s,kdir))
1079 curlvec(ixo^s,idir)=(curlvec(ixo^s,idir)+(tmp(hxo^s)-tmp(ixo^s))*
block%dx(ixo^s,kdir))&
1080 /
block%surface(ixo^s,idir)
1086 hxo^l=ixo^l-
kr(kdir,^
d);
1087 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1088 jxc^l=ixc^l+
kr(kdir,^
d);
1091 tmp(ixc^s)=qvec(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,kdir)*&
1092 (qvec(jxc^s,jdir)-qvec(ixc^s,jdir))/(
block%x(jxc^s,kdir)-
block%x(ixc^s,kdir))
1094 tmp(ixc^s)=0.5d0*(qvec(ixc^s,jdir)+qvec(jxc^s,jdir))
1096 curlvec(ixo^s,idir)=(tmp(hxo^s)-tmp(ixo^s))*
block%dx(ixo^s,jdir)
1098 hxo^l=ixo^l-
kr(jdir,^
d);
1099 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1100 jxc^l=ixc^l+
kr(jdir,^
d);
1103 tmp(ixc^s)=qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
1104 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir))
1106 tmp(ixc^s)=0.5d0*(qvec(ixc^s,kdir)+qvec(jxc^s,kdir))
1109 xc(ixc^s)=
block%x(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,jdir)
1110 curlvec(ixo^s,idir)=(curlvec(ixo^s,idir)+(xc(ixo^s)*tmp(ixo^s)-xc(hxo^s)*tmp(hxo^s))*
block%dx(ixo^s,kdir))&
1111 /
block%surface(ixo^s,idir)
1114 if(idir<idirmin)idirmin=idir
1116 enddo; enddo; enddo;
1118 call mpistop(
'no such curl evaluator')
1121 call mpistop(
'not possible to calculate curl')
1134 integer,
intent(in) :: ixI^L,ixO^L
1135 integer,
intent(in) :: idim, ndir0, idirmin0
1136 integer,
intent(inout) :: idirmin
1137 double precision,
intent(in) :: qvec(ixI^S,1:ndir0),qvecc(ixI^S,1:ndir0)
1138 double precision,
intent(inout) :: curlvec(ixI^S,idirmin0:3)
1140 integer :: ixA^L,ixC^L,jxC^L,idir,jdir,kdir,hxO^L,jxO^L
1141 double precision :: invdx(1:ndim)
1142 double precision :: tmp(ixI^S),tmp2(ixI^S),xC(ixI^S),surface(ixI^S)
1149 curlvec(ixo^s,idirmin0:3)=zero
1158 do jdir=1,ndim;
do kdir=1,ndir0
1159 if(
lvc(idir,jdir,kdir)/=0)
then
1161 tmp(ixi^s)=qvec(ixi^s,kdir)
1162 hxo^l=ixo^l-
kr(jdir,^
d);
1163 jxo^l=ixo^l+
kr(jdir,^
d);
1167 tmp(ixi^s)=qvecc(ixi^s,kdir)
1169 jxo^l=ixo^l+
kr(jdir,^
d);
1172 tmp(ixo^s)=half*(tmp(jxo^s)-tmp(hxo^s))*invdx(jdir)
1173 if(
lvc(idir,jdir,kdir)==1)
then
1174 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)+tmp(ixo^s)
1176 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)-tmp(ixo^s)
1178 if(idir<idirmin)idirmin=idir
1183 do idir=idirmin0,3;
do jdir=1,ndim;
do kdir=1,ndir0
1184 if(
lvc(idir,jdir,kdir)/=0)
then
1187 tmp(ixi^s)=qvec(ixi^s,kdir)
1188 hxo^l=ixo^l-
kr(jdir,^
d);
1189 jxo^l=ixo^l+
kr(jdir,^
d);
1191 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/(
block%x(jxo^s,jdir)-
block%x(hxo^s,jdir))
1193 hxo^l=ixo^l-
kr(jdir,^
d);
1194 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1195 jxc^l=ixc^l+
kr(jdir,^
d);
1196 tmp(ixc^s)=
block%surfaceC(ixc^s,jdir)*(qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
1197 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir)))
1198 tmp2(ixo^s)=(tmp(ixo^s)-tmp(hxo^s))/
block%dvolume(ixo^s)
1200 hxo^l=ixo^l-
kr(jdir,^
d);
1201 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1202 jxc^l=ixc^l+
kr(jdir,^
d);
1204 tmp(ixc^s)=
block%ds(ixo^s,kdir)*(qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
1205 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir)))
1207 tmp(ixc^s)=(qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
1208 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir)))
1211 tmp2(ixo^s)=(tmp(ixo^s)-tmp(hxo^s))/
block%surface(ixo^s,idir)
1213 tmp2(ixo^s)=(tmp(ixo^s)-tmp(hxo^s))/(
block%ds(ixo^s,jdir)*
block%ds(ixo^s,kdir))
1216 call mpistop(
'no such curl evaluator')
1218 if(
lvc(idir,jdir,kdir)==1)
then
1219 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)+tmp2(ixo^s)
1221 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)-tmp2(ixo^s)
1223 if(idir<idirmin)idirmin=idir
1225 enddo; enddo; enddo;
1229 do idir=idirmin0,3;
do jdir=1,ndim;
do kdir=1,ndir0
1230 if(
lvc(idir,jdir,kdir)/=0)
then
1231 tmp(ixi^s)=qvec(ixi^s,kdir)
1232 hxo^l=ixo^l-
kr(jdir,^
d);
1233 jxo^l=ixo^l+
kr(jdir,^
d);
1236 tmp(ixa^s)=tmp(ixa^s)*
block%x(ixa^s,1)
1237 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/((
block%x(jxo^s,1)-
block%x(hxo^s,1))*
block%x(ixo^s,1))
1239 if(idir==1) tmp(ixa^s)=tmp(ixa^s)*dsin(
block%x(ixa^s,2))
1240 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/((
block%x(jxo^s,2)-
block%x(hxo^s,2))*
block%x(ixo^s,1))
1241 if(idir==1) tmp2(ixo^s)=tmp2(ixo^s)/dsin(
block%x(ixo^s,2))
1244 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/((
block%x(jxo^s,3)-
block%x(hxo^s,3))*
block%x(ixo^s,1)*dsin(
block%x(ixo^s,2)))
1247 if(
lvc(idir,jdir,kdir)==1)
then
1248 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)+tmp2(ixo^s)
1250 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)-tmp2(ixo^s)
1252 if(idir<idirmin)idirmin=idir
1254 enddo; enddo; enddo;
1257 do jdir=1,ndim;
do kdir=1,ndir0
1258 if(
lvc(idir,jdir,kdir)/=0)
then
1259 hxo^l=ixo^l-
kr(jdir,^
d);
1260 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1261 jxc^l=ixc^l+
kr(jdir,^
d);
1262 tmp(ixc^s)=
block%surfaceC(ixc^s,jdir)*(qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
1263 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir)))
1264 tmp2(ixo^s)=(tmp(ixo^s)-tmp(hxo^s))/
block%dvolume(ixo^s)
1265 if(
lvc(idir,jdir,kdir)==1)
then
1266 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)+tmp2(ixo^s)
1268 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)-tmp2(ixo^s)
1270 if(idir<idirmin)idirmin=idir
1274 if(idir==2.and.
phi_>0) curlvec(ixo^s,2)=curlvec(ixo^s,2)+qvec(ixo^s,
phi_)/
block%x(ixo^s,
r_)
1282 do idir=idirmin0,3;
do jdir=1,ndim;
do kdir=1,ndir0
1283 if(
lvc(idir,jdir,kdir)/=0)
then
1289 hxo^l=ixo^l-
kr(jdir,^
d);
1290 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1291 jxc^l=ixc^l+
kr(jdir,^
d);
1294 tmp(ixc^s)=qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
1295 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir))
1297 tmp(ixc^s)=0.5d0*(qvec(ixc^s,kdir)+qvec(jxc^s,kdir))
1300 xc(ixc^s)=
block%x(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,jdir)
1301 curlvec(ixo^s,idir)=(dsin(xc(ixo^s))*tmp(ixo^s)-&
1302 dsin(xc(hxo^s))*tmp(hxo^s))*
block%dx(ixo^s,kdir)
1304 hxo^l=ixo^l-
kr(kdir,^
d);
1305 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1306 jxc^l=ixc^l+
kr(kdir,^
d);
1309 tmp(ixc^s)=qvec(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,kdir)*&
1310 (qvec(jxc^s,jdir)-qvec(ixc^s,jdir))/(
block%x(jxc^s,kdir)-
block%x(ixc^s,kdir))
1312 tmp(ixc^s)=0.5d0*(qvec(ixc^s,jdir)+qvec(jxc^s,jdir))
1314 curlvec(ixo^s,idir)=(curlvec(ixo^s,idir)+(tmp(hxo^s)-tmp(ixo^s))*
block%dx(ixo^s,jdir))&
1315 /
block%surface(ixo^s,idir)*
block%x(ixo^s,idir)
1321 hxo^l=ixo^l-
kr(kdir,^
d);
1322 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1323 jxc^l=ixc^l+
kr(kdir,^
d);
1326 tmp(ixc^s)=qvec(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,kdir)*&
1327 (qvec(jxc^s,jdir)-qvec(ixc^s,jdir))/(
block%x(jxc^s,kdir)-
block%x(ixc^s,kdir))
1329 tmp(ixc^s)=0.5d0*(qvec(ixc^s,jdir)+qvec(jxc^s,jdir))
1331 curlvec(ixo^s,idir)=(tmp(ixo^s)-tmp(hxo^s))*
block%dx(ixo^s,1)
1333 hxo^l=ixo^l-
kr(jdir,^
d);
1334 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1335 jxc^l=ixc^l+
kr(jdir,^
d);
1338 tmp(ixc^s)=qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
1339 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir))
1341 tmp(ixc^s)=0.5d0*(qvec(ixc^s,kdir)+qvec(jxc^s,kdir))
1344 xc(ixc^s)=
block%x(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,jdir)
1345 curlvec(ixo^s,idir)=(curlvec(ixo^s,idir)+(xc(hxo^s)*tmp(hxo^s)-xc(ixo^s)*tmp(ixo^s))*&
1346 dsin(
block%x(ixo^s,idir))*
block%dx(ixo^s,kdir))/
block%surface(ixo^s,idir)
1352 hxo^l=ixo^l-
kr(kdir,^
d);
1353 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1354 jxc^l=ixc^l+
kr(kdir,^
d);
1357 tmp(ixc^s)=qvec(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,kdir)*&
1358 (qvec(jxc^s,jdir)-qvec(ixc^s,jdir))/(
block%x(jxc^s,kdir)-
block%x(ixc^s,kdir))
1360 tmp(ixc^s)=0.5d0*(qvec(ixc^s,jdir)+qvec(jxc^s,jdir))
1362 curlvec(ixo^s,idir)=(tmp(hxo^s)-tmp(ixo^s))*
block%dx(ixo^s,jdir)
1364 hxo^l=ixo^l-
kr(jdir,^
d);
1365 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1366 jxc^l=ixc^l+
kr(jdir,^
d);
1369 tmp(ixc^s)=qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
1370 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir))
1372 tmp(ixc^s)=0.5d0*(qvec(ixc^s,kdir)+qvec(jxc^s,kdir))
1375 xc(ixc^s)=
block%x(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,jdir)
1377 surface(ixo^s)=
block%surface(ixo^s,idir)
1379 surface(ixo^s)=
block%x(ixo^s,jdir)*
block%dx(ixo^s,kdir)*
block%dx(ixo^s,jdir)
1381 curlvec(ixo^s,idir)=(curlvec(ixo^s,idir)+(xc(ixo^s)*tmp(ixo^s)-xc(hxo^s)*tmp(hxo^s))*
block%dx(ixo^s,kdir))&
1385 if(idir<idirmin)idirmin=idir
1387 enddo; enddo; enddo;
1389 call mpistop(
'no such curl evaluator')
1394 do idir=idirmin0,3;
do jdir=1,ndim;
do kdir=1,ndir0
1395 if(
lvc(idir,jdir,kdir)/=0)
then
1396 tmp(ixi^s)=qvec(ixi^s,kdir)
1397 hxo^l=ixo^l-
kr(jdir,^
d);
1398 jxo^l=ixo^l+
kr(jdir,^
d);
1399 if(
z_==3.or.
z_==-1)
then
1403 if(idir==
z_) tmp(ixa^s)=tmp(ixa^s)*
block%x(ixa^s,1)
1405 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/(
block%x(jxo^s,1)-
block%x(hxo^s,1))
1406 if(idir==
z_) tmp2(ixo^s)=tmp2(ixo^s)/
block%x(ixo^s,1)
1409 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/((
block%x(jxo^s,2)-
block%x(hxo^s,2))*
block%x(ixo^s,1))
1413 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/(
block%x(jxo^s,3)-
block%x(hxo^s,3))
1421 if(idir==
z_) tmp(ixa^s)=tmp(ixa^s)*
block%x(ixa^s,1)
1423 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/(
block%x(jxo^s,1)-
block%x(hxo^s,1))
1424 if(idir==
z_) tmp2(ixo^s)=tmp2(ixo^s)/
block%x(ixo^s,1)
1427 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/(
block%x(jxo^s,2)-
block%x(hxo^s,2))
1431 tmp2(ixo^s)=(tmp(jxo^s)-tmp(hxo^s))/((
block%x(jxo^s,3)-
block%x(hxo^s,3))*
block%x(ixo^s,1))
1435 if(
lvc(idir,jdir,kdir)==1)
then
1436 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)+tmp2(ixo^s)
1438 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)-tmp2(ixo^s)
1440 if(idir<idirmin)idirmin=idir
1442 enddo; enddo; enddo;
1444 if(ndim<2)
call mpistop(
"Gaussbased for 2D, 2.5D or 3D polar or cylindrical only")
1446 do jdir=1,ndim;
do kdir=1,ndir0
1447 if(
lvc(idir,jdir,kdir)/=0)
then
1448 hxo^l=ixo^l-
kr(jdir,^
d);
1449 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1450 jxc^l=ixc^l+
kr(jdir,^
d);
1451 tmp(ixc^s)=
block%surfaceC(ixc^s,jdir)*(qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
1452 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir)))
1453 tmp2(ixo^s)=(tmp(ixo^s)-tmp(hxo^s))/
block%dvolume(ixo^s)
1454 if(
lvc(idir,jdir,kdir)==1)
then
1455 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)+tmp2(ixo^s)
1457 curlvec(ixo^s,idir)=curlvec(ixo^s,idir)-tmp2(ixo^s)
1459 if(idir<idirmin)idirmin=idir
1466 if((idir==
phi_.or.(
phi_==-1.and.idir==3)).and.
z_>0)
then
1468 if(
z_==2) curlvec(ixo^s,idir)=curlvec(ixo^s,idir)-qvec(ixo^s,
z_)/
block%x(ixo^s,
r_)
1470 if(
phi_==2) curlvec(ixo^s,idir)=curlvec(ixo^s,idir)+qvec(ixo^s,
z_)/
block%x(ixo^s,
r_)
1474 if(ndim<3)
call mpistop(
"Stokesbased for 3D cylindrical only")
1475 do idir=idirmin0,3;
do jdir=1,ndim;
do kdir=1,ndir0
1476 if(
lvc(idir,jdir,kdir)/=0)
then
1481 hxo^l=ixo^l-
kr(jdir,^
d);
1482 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1483 jxc^l=ixc^l+
kr(jdir,^
d);
1486 tmp(ixc^s)=qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
1487 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir))
1489 tmp(ixc^s)=0.5d0*(qvec(ixc^s,kdir)+qvec(jxc^s,kdir))
1491 curlvec(ixo^s,idir)=(tmp(ixo^s)-tmp(hxo^s))*
block%dx(ixo^s,kdir)
1493 hxo^l=ixo^l-
kr(kdir,^
d);
1494 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1495 jxc^l=ixc^l+
kr(kdir,^
d);
1498 tmp(ixc^s)=qvec(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,kdir)*&
1499 (qvec(jxc^s,jdir)-qvec(ixc^s,jdir))/(
block%x(jxc^s,kdir)-
block%x(ixc^s,kdir))
1501 tmp(ixc^s)=0.5d0*(qvec(ixc^s,jdir)+qvec(jxc^s,jdir))
1503 curlvec(ixo^s,idir)=(curlvec(ixo^s,idir)+(tmp(hxo^s)-tmp(ixo^s))*
block%x(ixo^s,idir)*
block%dx(ixo^s,jdir))&
1504 /
block%surface(ixo^s,idir)
1506 else if(idir==
phi_)
then
1510 hxo^l=ixo^l-
kr(kdir,^
d);
1511 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1512 jxc^l=ixc^l+
kr(kdir,^
d);
1515 tmp(ixc^s)=qvec(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,kdir)*&
1516 (qvec(jxc^s,jdir)-qvec(ixc^s,jdir))/(
block%x(jxc^s,kdir)-
block%x(ixc^s,kdir))
1518 tmp(ixc^s)=0.5d0*(qvec(ixc^s,jdir)+qvec(jxc^s,jdir))
1520 curlvec(ixo^s,idir)=(tmp(ixo^s)-tmp(hxo^s))*
block%dx(ixo^s,jdir)
1522 hxo^l=ixo^l-
kr(jdir,^
d);
1523 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1524 jxc^l=ixc^l+
kr(jdir,^
d);
1527 tmp(ixc^s)=qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
1528 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir))
1530 tmp(ixc^s)=0.5d0*(qvec(ixc^s,kdir)+qvec(jxc^s,kdir))
1532 curlvec(ixo^s,idir)=(curlvec(ixo^s,idir)+(tmp(hxo^s)-tmp(ixo^s))*
block%dx(ixo^s,kdir))&
1533 /
block%surface(ixo^s,idir)
1539 hxo^l=ixo^l-
kr(kdir,^
d);
1540 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1541 jxc^l=ixc^l+
kr(kdir,^
d);
1544 tmp(ixc^s)=qvec(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,kdir)*&
1545 (qvec(jxc^s,jdir)-qvec(ixc^s,jdir))/(
block%x(jxc^s,kdir)-
block%x(ixc^s,kdir))
1547 tmp(ixc^s)=0.5d0*(qvec(ixc^s,jdir)+qvec(jxc^s,jdir))
1549 curlvec(ixo^s,idir)=(tmp(hxo^s)-tmp(ixo^s))*
block%dx(ixo^s,jdir)
1551 hxo^l=ixo^l-
kr(jdir,^
d);
1552 ixcmin^
d=hxomin^
d;ixcmax^
d=ixomax^
d;
1553 jxc^l=ixc^l+
kr(jdir,^
d);
1556 tmp(ixc^s)=qvec(ixc^s,kdir)+0.5d0*
block%dx(ixc^s,jdir)*&
1557 (qvec(jxc^s,kdir)-qvec(ixc^s,kdir))/(
block%x(jxc^s,jdir)-
block%x(ixc^s,jdir))
1559 tmp(ixc^s)=0.5d0*(qvec(ixc^s,kdir)+qvec(jxc^s,kdir))
1562 xc(ixc^s)=
block%x(ixc^s,jdir)+0.5d0*
block%dx(ixc^s,jdir)
1563 curlvec(ixo^s,idir)=(curlvec(ixo^s,idir)+(xc(ixo^s)*tmp(ixo^s)-xc(hxo^s)*tmp(hxo^s))*
block%dx(ixo^s,kdir))&
1564 /
block%surface(ixo^s,idir)
1567 if(idir<idirmin)idirmin=idir
1569 enddo; enddo; enddo;
1571 call mpistop(
'no such curl evaluator')
1574 call mpistop(
'not possible to calculate curl')
subroutine, public mpistop(message)
Exit MPI-AMRVAC with an error message.
Module with geometry-related routines (e.g., divergence, curl)
subroutine set_coordinate_system(geom)
Set the coordinate system to be used.
subroutine gradientq(q, x, ixIL, ixOL, idir, gradq)
Calculate gradient of a scalar q in direction idir at cell interfaces.
subroutine divvectors(qvec, ixIL, ixOL, divq)
Calculate divergence of a vector qvec within ixL using limited extrapolation to cell edges.
subroutine get_surface_area(s, ixGL)
calculate area of surfaces of cells
integer, parameter spherical
integer, parameter cartesian
integer, parameter stokesbased
integer, parameter cylindrical
integer, parameter gaussbased
integer, parameter cartesian_expansion
integer, parameter cartesian_stretched
subroutine gradient(q, ixIL, ixOL, idir, gradq)
Calculate gradient of a scalar q within ixL in direction idir.
subroutine curlvector(qvec, ixIL, ixOL, curlvec, idirmin, idirmin0, ndir0, fourthorder)
Calculate curl of a vector qvec within ixL Options to employ standard second order CD evaluations use...
integer, parameter central
subroutine gradients(q, ixIL, ixOL, idir, gradq)
Calculate gradient of a scalar q within ixL in direction idir first use limiter to go from cell cente...
subroutine curlvector_trans(qvec, qvecc, ixIL, ixOL, curlvec, idim, idirmin, idirmin0, ndir0)
Calculate idim transverse components of curl of a vector qvec within ixL Options to employ standard s...
subroutine divvector(qvec, ixIL, ixOL, divq, fourthorder, sixthorder)
Calculate divergence of a vector qvec within ixL.
subroutine putgridgeo(igrid)
Deallocate geometry-related variables.
subroutine gradientx(q, x, ixIL, ixOL, idir, gradq, fourth_order)
Calculate gradient of a scalar q in direction idir at cell interfaces.
This module contains definitions of global parameters and variables and some generic functions/subrou...
type(state), pointer block
Block pointer for using one block and its previous state.
character(len=std_len) geometry_name
integer, dimension(3, 3, 3) lvc
Levi-Civita tensor.
integer, dimension(3, 3) kr
Kronecker delta tensor.
logical stretch_uncentered
If true, adjust mod_geometry routines to account for grid stretching (but the flux computation will n...
integer, parameter ndim
Number of spatial dimensions for grid variables.
integer mype
The rank of the current MPI task.
integer, dimension(:), allocatable, parameter d
integer ndir
Number of spatial dimensions (components) for vector variables.
logical, dimension(ndim) stretched_dim
True if a dimension is stretched.
integer, parameter unitterm
Unit for standard output.
logical, dimension(ndim) periodb
True for dimensions with periodic boundaries.
double precision, dimension(:,:), allocatable dx
logical slab_uniform
uniform Cartesian geometry or not (stretched Cartesian)
integer r_
Indices for cylindrical coordinates FOR TESTS, negative value when not used:
logical, dimension(2, ndim) poleb
Indicates whether there is a pole at a boundary.
integer, dimension(:), allocatable type_gradient_limiter
Type of slope limiter used for computing gradients or divergences, when typegrad or typediv are set t...
double precision, dimension(ndim) dxlevel
Module with slope/flux limiters.
integer, parameter limiter_ppm
subroutine dwlimiter2(dwC, ixIL, ixCL, idims, typelim, ldw, rdw, a2max)
Limit the centered dwC differences within ixC for iw in direction idim. The limiter is chosen accordi...
subroutine, public ppmlimitervar(ixIL, ixL, idims, q, qCT, qLC, qRC)
Module with all the methods that users can customize in AMRVAC.
procedure(set_surface), pointer usr_set_surface