2D AMRCLAW
limiter.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 # The limiter is computed by comparing the 2-norm of each wave with
9 c # the projection of the wave from the interface to the left or
10 c # right onto the current wave. For a linear system this would
11 c # correspond to comparing the norms of the two waves. For a
12 c # nonlinear problem the eigenvectors are not colinear and so the
13 c # projection is needed to provide more limiting in the case where the
14 c # neighboring wave has large norm but points in a different direction
15 c # in phase space.
16 c
17 c # The specific limiter used in each family is determined by the
18 c # value of the corresponding element of the array mthlim, as used in
19 c # the function philim.
20 c # Note that a different limiter may be used in each wave family.
21 c
22 c # dotl and dotr denote the inner product of wave with the wave to
23 c # the left or right. The norm of the projections onto the wave are then
24 c # given by dotl/wnorm2 and dotr/wnorm2, where wnorm2 is the 2-norm
25 c # of wave.
26 c
27  implicit double precision (a-h,o-z)
28  dimension mthlim(mwaves)
29  dimension wave(meqn, mwaves, 1-mbc:maxm+mbc)
30  dimension s(mwaves, 1-mbc:maxm+mbc)
31 c
32 c
33  do 50 mw=1,mwaves
34  if (mthlim(mw) .eq. 0) go to 50
35  dotr = 0.d0
36  do 40 i = 0, mx+1
37  wnorm2 = 0.d0
38  dotl = dotr
39  dotr = 0.d0
40  do 20 m=1,meqn
41  wnorm2 = wnorm2 + wave(m,mw,i)**2
42  dotr = dotr + wave(m,mw,i)*wave(m,mw,i+1)
43  20 continue
44  if (i.eq.0) go to 40
45  if (wnorm2.eq.0.d0) go to 40
46 c
47  if (s(mw,i) .gt. 0.d0) then
48  wlimitr = philim(wnorm2, dotl, mthlim(mw))
49  else
50  wlimitr = philim(wnorm2, dotr, mthlim(mw))
51  endif
52 c
53  do 30 m=1,meqn
54  wave(m,mw,i) = wlimitr * wave(m,mw,i)
55  30 continue
56  40 continue
57  50 continue
58 c
59  return
60  end
subroutine limiter(maxm, meqn, mwaves, mbc, mx, wave, s, mthlim)
Definition: inlinelimiter.f:4
double precision function philim(a, b, meth)
Definition: philim.f:4