4 #include "cpp_macros.h"
10 public :: af_prolong_copy_from
11 public :: af_prolong_copy
12 public :: af_prolong_zeroth
13 public :: af_prolong_linear_from
14 public :: af_prolong_sparse
15 public :: af_prolong_linear
19 public :: af_prolong_limit
20 public :: af_prolong_linear_cons
25 subroutine af_prolong_copy_from(boxes, id, iv, iv_to, add)
26 type(
box_t),
intent(inout) :: boxes(:)
27 integer,
intent(in) :: id
28 integer,
intent(in) :: iv
29 integer,
intent(in),
optional :: iv_to
30 logical,
intent(in),
optional :: add
33 do i_c = 1, af_num_children
34 c_id = boxes(id)%children(i_c)
35 if (c_id == af_no_box) cycle
36 call af_prolong_copy(boxes(id), boxes(c_id), iv, iv_to=iv_to, add=add)
38 end subroutine af_prolong_copy_from
41 subroutine af_prolong_copy(box_p, box_c, iv, iv_to, low, high, add)
42 type(
box_t),
intent(in) :: box_p
43 type(
box_t),
intent(inout) :: box_c
44 integer,
intent(in) :: iv
45 integer,
intent(in),
optional :: iv_to
46 integer,
intent(in),
optional :: low(ndim)
47 integer,
intent(in),
optional :: high(ndim)
48 logical,
intent(in),
optional :: add
50 integer :: nc, ix_offset(ndim), ivc
51 integer :: ijk, ijk_(c1), lo(ndim), hi(ndim)
54 add_to = .false.;
if (
present(add)) add_to = add
55 ivc = iv;
if (
present(iv_to)) ivc = iv_to
56 lo = 1;
if (
present(low)) lo = low
57 hi = nc;
if (
present(high)) hi = high
60 ix_offset = af_get_child_offset(box_c)
65 i_c1 = ix_offset(1) + ishft(i+1, -1)
66 box_c%cc(i, ivc) = box_c%cc(i, ivc) + &
71 j_c1 = ix_offset(2) + ishft(j+1, -1)
73 i_c1 = ix_offset(1) + ishft(i+1, -1)
74 box_c%cc(i, j, ivc) = box_c%cc(i, j, ivc) + &
75 box_p%cc(i_c1, j_c1, iv)
80 k_c1 = ix_offset(3) + ishft(k+1, -1)
82 j_c1 = ix_offset(2) + ishft(j+1, -1)
84 i_c1 = ix_offset(1) + ishft(i+1, -1)
85 box_c%cc(i, j, k, ivc) = box_c%cc(i, j, k, ivc) + &
86 box_p%cc(i_c1, j_c1, k_c1, iv)
94 i_c1 = ix_offset(1) + ishft(i+1, -1)
95 box_c%cc(i, ivc) = box_p%cc(i_c1, iv)
99 j_c1 = ix_offset(2) + ishft(j+1, -1)
101 i_c1 = ix_offset(1) + ishft(i+1, -1)
102 box_c%cc(i, j, ivc) = box_p%cc(i_c1, j_c1, iv)
107 k_c1 = ix_offset(3) + ishft(k+1, -1)
109 j_c1 = ix_offset(2) + ishft(j+1, -1)
111 i_c1 = ix_offset(1) + ishft(i+1, -1)
112 box_c%cc(i, j, k, ivc) = box_p%cc(i_c1, j_c1, k_c1, iv)
118 end subroutine af_prolong_copy
121 subroutine af_prolong_zeroth(box_p, box_c, iv, iv_to, add, limiter)
122 type(
box_t),
intent(in) :: box_p
123 type(
box_t),
intent(inout) :: box_c
124 integer,
intent(in) :: iv
125 integer,
intent(in),
optional :: iv_to
126 logical,
intent(in),
optional :: add
127 integer,
intent(in),
optional :: limiter
128 integer :: hnc, nc, ix_offset(ndim), ivc
129 integer :: ijk, ijk_(c), ijk_(f)
134 hnc = ishft(box_c%n_cell, -1)
135 ix_offset = af_get_child_offset(box_c)
136 add_to = .false.;
if (
present(add)) add_to = add
137 ivc = iv;
if (
present(iv_to)) ivc = iv_to
139 if (.not. add_to)
then
140 box_c%cc(dtimes(1:nc), ivc) = 0
145 i_c = i + ix_offset(1)
148 f0 = box_p%cc(i_c, iv)
149 box_c%cc(i_f:i_f+1, ivc) = &
150 box_c%cc(i_f:i_f+1, ivc) + f0
154 j_c = j + ix_offset(2)
157 i_c = i + ix_offset(1)
160 f0 = box_p%cc(i_c, j_c, iv)
161 box_c%cc(i_f:i_f+1, j_f:j_f+1, ivc) = &
162 box_c%cc(i_f:i_f+1, j_f:j_f+1, ivc) + f0
167 k_c = k + ix_offset(3)
170 j_c = j + ix_offset(2)
173 i_c = i + ix_offset(1)
176 f0 = box_p%cc(i_c, j_c, k_c, iv)
177 box_c%cc(i_f:i_f+1, j_f:j_f+1, k_f:k_f+1, ivc) = &
178 box_c%cc(i_f:i_f+1, j_f:j_f+1, k_f:k_f+1, ivc) + f0
183 end subroutine af_prolong_zeroth
187 subroutine af_prolong_linear_from(boxes, id, iv, iv_to, add)
188 type(
box_t),
intent(inout) :: boxes(:)
189 integer,
intent(in) :: id
190 integer,
intent(in) :: iv
191 integer,
intent(in),
optional :: iv_to
192 logical,
intent(in),
optional :: add
195 do i_c = 1, af_num_children
196 c_id = boxes(id)%children(i_c)
197 if (c_id == af_no_box) cycle
198 call af_prolong_linear(boxes(id), boxes(c_id), iv, iv_to, add)
200 end subroutine af_prolong_linear_from
205 subroutine af_prolong_sparse(box_p, box_c, iv, iv_to, add, limiter)
206 type(
box_t),
intent(in) :: box_p
207 type(
box_t),
intent(inout) :: box_c
208 integer,
intent(in) :: iv
209 integer,
intent(in),
optional :: iv_to
210 logical,
intent(in),
optional :: add
211 integer,
intent(in),
optional :: limiter
212 integer :: hnc, nc, ix_offset(ndim), ivc
213 integer :: ijk, ijk_(c), ijk_(f)
214 real(dp) :: f0, flx, fhx
224 hnc = ishft(box_c%n_cell, -1)
225 ix_offset = af_get_child_offset(box_c)
226 add_to = .false.;
if (
present(add)) add_to = add
227 ivc = iv;
if (
present(iv_to)) ivc = iv_to
229 if (.not. add_to)
then
230 box_c%cc(dtimes(1:nc), ivc) = 0
235 i_c = i + ix_offset(1)
238 f0 = 0.75_dp * box_p%cc(i_c, iv)
239 flx = 0.25_dp * box_p%cc(i_c-1, iv)
240 fhx = 0.25_dp * box_p%cc(i_c+1, iv)
242 box_c%cc(i_f, ivc) = f0 + flx + box_c%cc(i_f, ivc)
243 box_c%cc(i_f+1, ivc) = f0 + fhx + box_c%cc(i_f+1, ivc)
247 j_c = j + ix_offset(2)
250 i_c = i + ix_offset(1)
253 f0 = 0.5_dp * box_p%cc(i_c, j_c, iv)
254 flx = 0.25_dp * box_p%cc(i_c-1, j_c, iv)
255 fhx = 0.25_dp * box_p%cc(i_c+1, j_c, iv)
256 fly = 0.25_dp * box_p%cc(i_c, j_c-1, iv)
257 fhy = 0.25_dp * box_p%cc(i_c, j_c+1, iv)
259 box_c%cc(i_f, j_f, ivc) = f0 + flx + fly &
260 + box_c%cc(i_f, j_f, ivc)
261 box_c%cc(i_f+1, j_f, ivc) = f0 + fhx + fly &
262 + box_c%cc(i_f+1, j_f, ivc)
263 box_c%cc(i_f, j_f+1, ivc) = f0 + flx + fhy &
264 + box_c%cc(i_f, j_f+1, ivc)
265 box_c%cc(i_f+1, j_f+1, ivc) = f0 + fhx + fhy &
266 + box_c%cc(i_f+1, j_f+1, ivc)
271 k_c = k + ix_offset(3)
274 j_c = j + ix_offset(2)
277 i_c = i + ix_offset(1)
280 f0 = 0.25_dp * box_p%cc(i_c, j_c, k_c, iv)
281 flx = 0.25_dp * box_p%cc(i_c-1, j_c, k_c, iv)
282 fhx = 0.25_dp * box_p%cc(i_c+1, j_c, k_c, iv)
283 fly = 0.25_dp * box_p%cc(i_c, j_c-1, k_c, iv)
284 fhy = 0.25_dp * box_p%cc(i_c, j_c+1, k_c, iv)
285 flz = 0.25_dp * box_p%cc(i_c, j_c, k_c-1, iv)
286 fhz = 0.25_dp * box_p%cc(i_c, j_c, k_c+1, iv)
288 box_c%cc(i_f, j_f, k_f, ivc) = f0 + flx + &
289 fly + flz + box_c%cc(i_f, j_f, k_f, ivc)
290 box_c%cc(i_f+1, j_f, k_f, ivc) = f0 + fhx + &
291 fly + flz + box_c%cc(i_f+1, j_f, k_f, ivc)
292 box_c%cc(i_f, j_f+1, k_f, ivc) = f0 + flx + &
293 fhy + flz + box_c%cc(i_f, j_f+1, k_f, ivc)
294 box_c%cc(i_f+1, j_f+1, k_f, ivc) = f0 + fhx + &
295 fhy + flz + box_c%cc(i_f+1, j_f+1, k_f, ivc)
296 box_c%cc(i_f, j_f, k_f+1, ivc) = f0 + flx + &
297 fly + fhz + box_c%cc(i_f, j_f, k_f+1, ivc)
298 box_c%cc(i_f+1, j_f, k_f+1, ivc) = f0 + fhx + &
299 fly + fhz + box_c%cc(i_f+1, j_f, k_f+1, ivc)
300 box_c%cc(i_f, j_f+1, k_f+1, ivc) = f0 + flx + &
301 fhy + fhz + box_c%cc(i_f, j_f+1, k_f+1, ivc)
302 box_c%cc(i_f+1, j_f+1, k_f+1, ivc) = f0 + fhx + &
303 fhy + fhz + box_c%cc(i_f+1, j_f+1, k_f+1, ivc)
308 end subroutine af_prolong_sparse
311 subroutine af_prolong_limit(box_p, box_c, iv, iv_to, add, limiter)
313 type(
box_t),
intent(in) :: box_p
314 type(
box_t),
intent(inout) :: box_c
315 integer,
intent(in) :: iv
316 integer,
intent(in),
optional :: iv_to
317 logical,
intent(in),
optional :: add
318 integer,
intent(in),
optional :: limiter
319 integer :: hnc, nc, ix_offset(ndim), ivc
320 integer :: ijk, ijk_(c), ijk_(f)
321 real(dp) :: f(0:ndim), slopes_a(ndim), slopes_b(ndim)
325 hnc = ishft(box_c%n_cell, -1)
326 ix_offset = af_get_child_offset(box_c)
327 add_to = .false.;
if (
present(add)) add_to = add
328 ivc = iv;
if (
present(iv_to)) ivc = iv_to
330 if (.not.
present(limiter)) error stop
"limiter argument required"
332 if (.not. add_to)
then
333 box_c%cc(dtimes(1:nc), ivc) = 0
336 associate(cc_p => box_p%cc, cc_c => box_c%cc)
339 i_c = i + ix_offset(1)
343 slopes_a = [cc_p(i_c, iv) - cc_p(i_c-1, iv)]
344 slopes_b = [cc_p(i_c+1, iv) - cc_p(i_c, iv)]
345 f(1:1) = 0.25_dp * af_limiter_apply(slopes_a, slopes_b, limiter)
347 cc_c(i_f, ivc) = f(0) - f(1) + cc_c(i_f, ivc)
348 cc_c(i_f+1, ivc) = f(0) + f(1) + cc_c(i_f+1, ivc)
352 j_c = j + ix_offset(2)
355 i_c = i + ix_offset(1)
358 f(0) = cc_p(i_c, j_c, iv)
360 cc_p(i_c, j_c, iv) - cc_p(i_c-1, j_c, iv), &
361 cc_p(i_c, j_c, iv) - cc_p(i_c, j_c-1, iv)]
363 cc_p(i_c+1, j_c, iv) - cc_p(i_c, j_c, iv), &
364 cc_p(i_c, j_c+1, iv) - cc_p(i_c, j_c, iv)]
365 f(1:2) = 0.25_dp * af_limiter_apply(slopes_a, slopes_b, limiter)
367 cc_c(i_f, j_f, ivc) = f(0) - f(1) - f(2) &
368 + cc_c(i_f, j_f, ivc)
369 cc_c(i_f+1, j_f, ivc) = f(0) + f(1) - f(2) &
370 + cc_c(i_f+1, j_f, ivc)
371 cc_c(i_f, j_f+1, ivc) = f(0) - f(1) + f(2) &
372 + cc_c(i_f, j_f+1, ivc)
373 cc_c(i_f+1, j_f+1, ivc) = f(0) + f(1) + f(2) &
374 + cc_c(i_f+1, j_f+1, ivc)
379 k_c = k + ix_offset(3)
382 j_c = j + ix_offset(2)
385 i_c = i + ix_offset(1)
388 f(0) = cc_p(i_c, j_c, k_c, iv)
390 cc_p(i_c, j_c, k_c, iv) - cc_p(i_c-1, j_c, k_c, iv), &
391 cc_p(i_c, j_c, k_c, iv) - cc_p(i_c, j_c-1, k_c, iv), &
392 cc_p(i_c, j_c, k_c, iv) - cc_p(i_c, j_c, k_c-1, iv)]
394 cc_p(i_c+1, j_c, k_c, iv) - cc_p(i_c, j_c, k_c, iv), &
395 cc_p(i_c, j_c+1, k_c, iv) - cc_p(i_c, j_c, k_c, iv), &
396 cc_p(i_c, j_c, k_c+1, iv) - cc_p(i_c, j_c, k_c, iv)]
397 f(1:3) = 0.25_dp * af_limiter_apply(slopes_a, slopes_b, limiter)
399 cc_c(i_f, j_f, k_f, ivc) = f(0) - f(1) - &
400 f(2) - f(3) + cc_c(i_f, j_f, k_f, ivc)
401 cc_c(i_f+1, j_f, k_f, ivc) = f(0) + f(1) - &
402 f(2) - f(3) + cc_c(i_f+1, j_f, k_f, ivc)
403 cc_c(i_f, j_f+1, k_f, ivc) = f(0) - f(1) + &
404 f(2) - f(3) + cc_c(i_f, j_f+1, k_f, ivc)
405 cc_c(i_f+1, j_f+1, k_f, ivc) = f(0) + f(1) + &
406 f(2) - f(3) + cc_c(i_f+1, j_f+1, k_f, ivc)
407 cc_c(i_f, j_f, k_f+1, ivc) = f(0) - f(1) - &
408 f(2) + f(3) + cc_c(i_f, j_f, k_f+1, ivc)
409 cc_c(i_f+1, j_f, k_f+1, ivc) = f(0) + f(1) - &
410 f(2) + f(3) + cc_c(i_f+1, j_f, k_f+1, ivc)
411 cc_c(i_f, j_f+1, k_f+1, ivc) = f(0) - f(1) + &
412 f(2) + f(3) + cc_c(i_f, j_f+1, k_f+1, ivc)
413 cc_c(i_f+1, j_f+1, k_f+1, ivc) = f(0) + f(1) + &
414 f(2) + f(3) + cc_c(i_f+1, j_f+1, k_f+1, ivc)
420 end subroutine af_prolong_limit
424 subroutine af_prolong_linear_cons(box_p, box_c, iv, iv_to, add, limiter)
425 type(box_t),
intent(in) :: box_p
426 type(box_t),
intent(inout) :: box_c
427 integer,
intent(in) :: iv
428 integer,
intent(in),
optional :: iv_to
429 logical,
intent(in),
optional :: add
430 integer,
intent(in),
optional :: limiter
431 integer :: hnc, nc, ix_offset(ndim), ivc
432 integer :: ijk, ijk_(c), ijk_(f)
433 real(dp) :: f(0:ndim)
437 hnc = ishft(box_c%n_cell, -1)
438 ix_offset = af_get_child_offset(box_c)
439 add_to = .false.;
if (
present(add)) add_to = add
440 ivc = iv;
if (
present(iv_to)) ivc = iv_to
442 if (.not. add_to)
then
443 box_c%cc(dtimes(1:nc), ivc) = 0
448 i_c = i + ix_offset(1)
451 f(0) = box_p%cc(i_c, iv)
452 f(1) = 0.125_dp * (box_p%cc(i_c+1, iv) - &
455 box_c%cc(i_f, ivc) = f(0) - f(1) + box_c%cc(i_f, ivc)
456 box_c%cc(i_f+1, ivc) = f(0) + f(1) + box_c%cc(i_f+1, ivc)
460 j_c = j + ix_offset(2)
463 i_c = i + ix_offset(1)
466 f(0) = box_p%cc(i_c, j_c, iv)
467 f(1) = 0.125_dp * (box_p%cc(i_c+1, j_c, iv) - &
468 box_p%cc(i_c-1, j_c, iv))
469 f(2) = 0.125_dp * (box_p%cc(i_c, j_c+1, iv) - &
470 box_p%cc(i_c, j_c-1, iv))
472 if (box_p%coord_t == af_cyl)
then
474 f(0) = f(0) - 0.25_dp * box_p%dr(1) * f(1) / &
475 af_cyl_radius_cc(box_p, i_c)
478 box_c%cc(i_f, j_f, ivc) = f(0) - f(1) - f(2) &
479 + box_c%cc(i_f, j_f, ivc)
480 box_c%cc(i_f+1, j_f, ivc) = f(0) + f(1) - f(2) &
481 + box_c%cc(i_f+1, j_f, ivc)
482 box_c%cc(i_f, j_f+1, ivc) = f(0) - f(1) + f(2) &
483 + box_c%cc(i_f, j_f+1, ivc)
484 box_c%cc(i_f+1, j_f+1, ivc) = f(0) + f(1) + f(2) &
485 + box_c%cc(i_f+1, j_f+1, ivc)
490 k_c = k + ix_offset(3)
493 j_c = j + ix_offset(2)
496 i_c = i + ix_offset(1)
499 f(0) = box_p%cc(i_c, j_c, k_c, iv)
500 f(1) = 0.125_dp * (box_p%cc(i_c+1, j_c, k_c, iv) - &
501 box_p%cc(i_c-1, j_c, k_c, iv))
502 f(2) = 0.125_dp * (box_p%cc(i_c, j_c+1, k_c, iv) - &
503 box_p%cc(i_c, j_c-1, k_c, iv))
504 f(3) = 0.125_dp * (box_p%cc(i_c, j_c, k_c+1, iv) - &
505 box_p%cc(i_c, j_c, k_c-1, iv))
507 box_c%cc(i_f, j_f, k_f, ivc) = f(0) - f(1) - &
508 f(2) - f(3) + box_c%cc(i_f, j_f, k_f, ivc)
509 box_c%cc(i_f+1, j_f, k_f, ivc) = f(0) + f(1) - &
510 f(2) - f(3) + box_c%cc(i_f+1, j_f, k_f, ivc)
511 box_c%cc(i_f, j_f+1, k_f, ivc) = f(0) - f(1) + &
512 f(2) - f(3) + box_c%cc(i_f, j_f+1, k_f, ivc)
513 box_c%cc(i_f+1, j_f+1, k_f, ivc) = f(0) + f(1) + &
514 f(2) - f(3) + box_c%cc(i_f+1, j_f+1, k_f, ivc)
515 box_c%cc(i_f, j_f, k_f+1, ivc) = f(0) - f(1) - &
516 f(2) + f(3) + box_c%cc(i_f, j_f, k_f+1, ivc)
517 box_c%cc(i_f+1, j_f, k_f+1, ivc) = f(0) + f(1) - &
518 f(2) + f(3) + box_c%cc(i_f+1, j_f, k_f+1, ivc)
519 box_c%cc(i_f, j_f+1, k_f+1, ivc) = f(0) - f(1) + &
520 f(2) + f(3) + box_c%cc(i_f, j_f+1, k_f+1, ivc)
521 box_c%cc(i_f+1, j_f+1, k_f+1, ivc) = f(0) + f(1) + &
522 f(2) + f(3) + box_c%cc(i_f+1, j_f+1, k_f+1, ivc)
528 end subroutine af_prolong_linear_cons
531 subroutine af_prolong_linear(box_p, box_c, iv, iv_to, add, limiter)
532 type(box_t),
intent(in) :: box_p
533 type(box_t),
intent(inout) :: box_c
534 integer,
intent(in) :: iv
535 integer,
intent(in),
optional :: iv_to
536 logical,
intent(in),
optional :: add
537 integer,
intent(in),
optional :: limiter
538 integer :: hnc, nc, ix_offset(ndim), ivc
539 integer :: ijk, ijk_(c), ijk_(f)
542 real(dp) :: f0, flx, fhx
543 real(dp),
parameter :: f1=1/4.0_dp, f3=3/4.0_dp
545 real(dp) :: f0, flx, fhx, fly, fhy
546 real(dp) :: fll, fhl, flh, fhh
547 real(dp),
parameter :: f1 = 1/16.0_dp, f3=3/16.0_dp, f9=9/16.0_dp
549 real(dp) :: f000, f00l, f0l0, f0ll, fl00, fl0l, fll0
550 real(dp) :: flll, f00h, f0h0, f0hh, fh00, fh0h, fhh0
551 real(dp) :: fhhh, f0lh, f0hl, fl0h, fh0l, flh0, fhl0
552 real(dp) :: fllh, flhl, fhll, fhhl, fhlh, flhh
553 real(dp),
parameter :: f1 = 1/64.0_dp, f3=3/64.0_dp, f9=9/64.0_dp
554 real(dp),
parameter :: f27 = 27/64.0_dp
558 hnc = ishft(box_c%n_cell, -1)
559 ix_offset = af_get_child_offset(box_c)
560 add_to = .false.;
if (
present(add)) add_to = add
561 ivc = iv;
if (
present(iv_to)) ivc = iv_to
563 if (.not. add_to)
then
564 box_c%cc(dtimes(1:nc), ivc) = 0
569 i_c = i + ix_offset(1)
572 f0 = f3 * box_p%cc(i_c, iv)
573 flx = f1 * box_p%cc(i_c-1, iv)
574 fhx = f1 * box_p%cc(i_c+1, iv)
576 box_c%cc(i_f, ivc) = f0 + flx + box_c%cc(i_f, ivc)
577 box_c%cc(i_f+1, ivc) = f0 + fhx + box_c%cc(i_f+1, ivc)
581 j_c = j + ix_offset(2)
584 i_c = i + ix_offset(1)
587 f0 = f9 * box_p%cc(i_c, j_c, iv)
588 flx = f3 * box_p%cc(i_c-1, j_c, iv)
589 fhx = f3 * box_p%cc(i_c+1, j_c, iv)
590 fly = f3 * box_p%cc(i_c, j_c-1, iv)
591 fhy = f3 * box_p%cc(i_c, j_c+1, iv)
592 fll = f1 * box_p%cc(i_c-1, j_c-1, iv)
593 fhl = f1 * box_p%cc(i_c+1, j_c-1, iv)
594 flh = f1 * box_p%cc(i_c-1, j_c+1, iv)
595 fhh = f1 * box_p%cc(i_c+1, j_c+1, iv)
597 box_c%cc(i_f, j_f, ivc) = f0 + flx + fly + fll &
598 + box_c%cc(i_f, j_f, ivc)
599 box_c%cc(i_f+1, j_f, ivc) = f0 + fhx + fly + fhl &
600 + box_c%cc(i_f+1, j_f, ivc)
601 box_c%cc(i_f, j_f+1, ivc) = f0 + flx + fhy + flh &
602 + box_c%cc(i_f, j_f+1, ivc)
603 box_c%cc(i_f+1, j_f+1, ivc) = f0 + fhx + fhy + fhh &
604 + box_c%cc(i_f+1, j_f+1, ivc)
609 k_c = k + ix_offset(3)
612 j_c = j + ix_offset(2)
615 i_c = i + ix_offset(1)
618 f000 = f27 * box_p%cc(i_c, j_c, k_c, iv)
620 f00l = f9 * box_p%cc(i_c, j_c, k_c-1, iv)
621 f0l0 = f9 * box_p%cc(i_c, j_c-1, k_c, iv)
622 f0ll = f3 * box_p%cc(i_c, j_c-1, k_c-1, iv)
623 fl00 = f9 * box_p%cc(i_c-1, j_c, k_c, iv)
624 fl0l = f3 * box_p%cc(i_c-1, j_c, k_c-1, iv)
625 fll0 = f3 * box_p%cc(i_c-1, j_c-1, k_c, iv)
626 flll = f1 * box_p%cc(i_c-1, j_c-1, k_c-1, iv)
628 f00h = f9 * box_p%cc(i_c, j_c, k_c+1, iv)
629 f0h0 = f9 * box_p%cc(i_c, j_c+1, k_c, iv)
630 f0hh = f3 * box_p%cc(i_c, j_c+1, k_c+1, iv)
631 fh00 = f9 * box_p%cc(i_c+1, j_c, k_c, iv)
632 fh0h = f3 * box_p%cc(i_c+1, j_c, k_c+1, iv)
633 fhh0 = f3 * box_p%cc(i_c+1, j_c+1, k_c, iv)
634 fhhh = f1 * box_p%cc(i_c+1, j_c+1, k_c+1, iv)
636 fl0h = f3 * box_p%cc(i_c-1, j_c, k_c+1, iv)
637 fh0l = f3 * box_p%cc(i_c+1, j_c, k_c-1, iv)
638 flh0 = f3 * box_p%cc(i_c-1, j_c+1, k_c, iv)
639 fhl0 = f3 * box_p%cc(i_c+1, j_c-1, k_c, iv)
640 f0lh = f3 * box_p%cc(i_c, j_c-1, k_c+1, iv)
641 f0hl = f3 * box_p%cc(i_c, j_c+1, k_c-1, iv)
643 fllh = f1 * box_p%cc(i_c-1, j_c-1, k_c+1, iv)
644 flhl = f1 * box_p%cc(i_c-1, j_c+1, k_c-1, iv)
645 fhll = f1 * box_p%cc(i_c+1, j_c-1, k_c-1, iv)
647 fhhl = f1 * box_p%cc(i_c+1, j_c+1, k_c-1, iv)
648 fhlh = f1 * box_p%cc(i_c+1, j_c-1, k_c+1, iv)
649 flhh = f1 * box_p%cc(i_c-1, j_c+1, k_c+1, iv)
651 box_c%cc(i_f, j_f, k_f, ivc) = f000 + fl00 + &
652 f0l0 + f00l + fll0 + fl0l + f0ll + flll + &
653 box_c%cc(i_f, j_f, k_f, ivc)
654 box_c%cc(i_f+1, j_f, k_f, ivc) = f000 + fh00 + &
655 f0l0 + f00l + fhl0 + fh0l + f0ll + fhll + &
656 box_c%cc(i_f+1, j_f, k_f, ivc)
657 box_c%cc(i_f, j_f+1, k_f, ivc) = f000 + fl00 + &
658 f0h0 + f00l + flh0 + fl0l + f0hl + flhl + &
659 box_c%cc(i_f, j_f+1, k_f, ivc)
660 box_c%cc(i_f+1, j_f+1, k_f, ivc) = f000 + fh00 + &
661 f0h0 + f00l + fhh0 + fh0l + f0hl + fhhl + &
662 box_c%cc(i_f+1, j_f+1, k_f, ivc)
663 box_c%cc(i_f, j_f, k_f+1, ivc) = f000 + fl00 + &
664 f0l0 + f00h + fll0 + fl0h + f0lh + fllh + &
665 box_c%cc(i_f, j_f, k_f+1, ivc)
666 box_c%cc(i_f+1, j_f, k_f+1, ivc) = f000 + fh00 + &
667 f0l0 + f00h + fhl0 + fh0h + f0lh + fhlh + &
668 box_c%cc(i_f+1, j_f, k_f+1, ivc)
669 box_c%cc(i_f, j_f+1, k_f+1, ivc) = f000 + fl00 + &
670 f0h0 + f00h + flh0 + fl0h + f0hh + flhh + &
671 box_c%cc(i_f, j_f+1, k_f+1, ivc)
672 box_c%cc(i_f+1, j_f+1, k_f+1, ivc) = f000 + fh00 + &
673 f0h0 + f00h + fhh0 + fh0h + f0hh + fhhh + &
674 box_c%cc(i_f+1, j_f+1, k_f+1, ivc)
679 end subroutine af_prolong_linear
Module containing slope limiters.
This module contains the routines related to prolongation: going from coarse to fine variables.
This module contains the basic types and constants that are used in the NDIM-dimensional version of A...
The basic building block of afivo: a box with cell-centered and face centered data,...