2D AMRCLAW
inlinelimiter.f
Go to the documentation of this file.
1 c
2 c
3 c =====================================================
4  subroutine limiter(maxm,meqn,mwaves,mbc,mx,wave,s,mthlim)
5 c =====================================================
6 c
7 c # Apply a limiter to the waves.
8 c
9 c # Version of December, 2002.
10 c # Modified from the original CLAWPACK routine to eliminate calls
11 c # to philim. Since philim was called for every wave at each cell
12 c # interface, this was adding substantial overhead in some cases.
13 c
14 c # The limiter is computed by comparing the 2-norm of each wave with
15 c # the projection of the wave from the interface to the left or
16 c # right onto the current wave. For a linear system this would
17 c # correspond to comparing the norms of the two waves. For a
18 c # nonlinear problem the eigenvectors are not colinear and so the
19 c # projection is needed to provide more limiting in the case where the
20 c # neighboring wave has large norm but points in a different direction
21 c # in phase space.
22 c
23 c # The specific limiter used in each family is determined by the
24 c # value of the corresponding element of the array mthlim.
25 c # Note that a different limiter may be used in each wave family.
26 c
27 c # dotl and dotr denote the inner product of wave with the wave to
28 c # the left or right. The norm of the projections onto the wave are then
29 c # given by dotl/wnorm2 and dotr/wnorm2, where wnorm2 is the 2-norm
30 c # of wave.
31 c
32  implicit double precision (a-h,o-z)
33  dimension mthlim(mwaves)
34  dimension wave(meqn, mwaves, 1-mbc:maxm+mbc)
35  dimension s(mwaves, 1-mbc:maxm+mbc)
36 c
37 c
38  do 200 mw=1,mwaves
39  if (mthlim(mw) .eq. 0) go to 200
40  dotr = 0.d0
41  do 190 i = 0, mx+1
42  wnorm2 = 0.d0
43  dotl = dotr
44  dotr = 0.d0
45  do 5 m=1,meqn
46  wnorm2 = wnorm2 + wave(m,mw,i)**2
47  dotr = dotr + wave(m,mw,i)*wave(m,mw,i+1)
48  5 continue
49  if (i.eq.0) go to 190
50  if (wnorm2.eq.0.d0) go to 190
51 c
52  if (s(mw,i) .gt. 0.d0) then
53  r = dotl / wnorm2
54  else
55  r = dotr / wnorm2
56  endif
57 c
58  go to (10,20,30,40,50) mthlim(mw)
59 c
60  10 continue
61 c --------
62 c # minmod
63 c --------
64  wlimitr = dmax1(0.d0, dmin1(1.d0, r))
65  go to 170
66 c
67  20 continue
68 c ----------
69 c # superbee
70 c ----------
71  wlimitr = dmax1(0.d0, dmin1(1.d0, 2.d0*r), dmin1(2.d0, r))
72  go to 170
73 c
74  30 continue
75 c ----------
76 c # van Leer
77 c ----------
78  wlimitr = (r + dabs(r)) / (1.d0 + dabs(r))
79  go to 170
80 c
81  40 continue
82 c ------------------------------
83 c # monotinized centered
84 c ------------------------------
85  c = (1.d0 + r)/2.d0
86  wlimitr = dmax1(0.d0, dmin1(c, 2.d0, 2.d0*r))
87  go to 170
88 c
89  50 continue
90 c ------------------------------
91 c # Beam-Warming
92 c ------------------------------
93  wlimitr = r
94  go to 170
95 c
96  170 continue
97 c
98 c # apply limiter to waves:
99 c
100  do 180 m=1,meqn
101  wave(m,mw,i) = wlimitr * wave(m,mw,i)
102  180 continue
103 
104  190 continue
105  200 continue
106 c
107  return
108  end
integer, dimension(:), allocatable mthlim
Definition: amr_module.f90:254
subroutine limiter(maxm, meqn, mwaves, mbc, mx, wave, s, mthlim)
Definition: inlinelimiter.f:5
integer mwaves
Definition: amr_module.f90:253