INTERPOLATIONS: Remove comments from 5th order OCMP method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
be07cdaaaa
commit
173f13e8b7
@ -4495,30 +4495,30 @@ module interpolations
|
||||
real(kind=8), dimension(size(fc)) :: r
|
||||
real(kind=8), dimension(size(fc)) :: u
|
||||
|
||||
real(kind=8), parameter :: a1 = 5.0163016d-01
|
||||
real(kind=8), parameter :: a2 = 2.5394716d-01
|
||||
real(kind=8), dimension(3), parameter :: &
|
||||
di = [ 5.0163016d-01, 1.0d+00, 2.5394716d-01 ]
|
||||
di5 = [ a1, 1.0d+00, a2 ]
|
||||
real(kind=8), dimension(5), parameter :: &
|
||||
ci5 = [- 3.0d+00 * di(1) - 3.0d+00 * di(3) + 2.0d+00, &
|
||||
2.7d+01 * di(1) + 1.7d+01 * di(3) - 1.3d+01, &
|
||||
4.7d+01 * di(1) - 4.3d+01 * di(3) + 4.7d+01, &
|
||||
- 1.3d+01 * di(1) + 7.7d+01 * di(3) + 2.7d+01, &
|
||||
2.0d+00 * di(1) + 1.2d+01 * di(3) - 3.0d+00 ] / 6.0d+01
|
||||
ci5 = [- 3.0d+00 * a1 - 3.0d+00 * a2 + 2.0d+00, &
|
||||
2.7d+01 * a1 + 1.7d+01 * a2 - 1.3d+01, &
|
||||
4.7d+01 * a1 - 4.3d+01 * a2 + 4.7d+01, &
|
||||
- 1.3d+01 * a1 + 7.7d+01 * a2 + 2.7d+01, &
|
||||
2.0d+00 * a1 + 1.2d+01 * a2 - 3.0d+00 ] / 6.0d+01
|
||||
!
|
||||
!-------------------------------------------------------------------------------
|
||||
!
|
||||
n = size(fc)
|
||||
|
||||
! prepare the diagonals of the tridiagonal matrix
|
||||
!
|
||||
do i = 1, ng
|
||||
a(i) = 0.0d+00
|
||||
b(i) = 1.0d+00
|
||||
c(i) = 0.0d+00
|
||||
end do
|
||||
do i = ng + 1, n - ng - 1
|
||||
a(i) = di(1)
|
||||
b(i) = di(2)
|
||||
c(i) = di(3)
|
||||
a(i) = di5(1)
|
||||
b(i) = di5(2)
|
||||
c(i) = di5(3)
|
||||
end do
|
||||
do i = n - ng, n
|
||||
a(i) = 0.0d+00
|
||||
@ -4528,14 +4528,10 @@ module interpolations
|
||||
|
||||
!! === left-side interpolation ===
|
||||
!!
|
||||
! prepare the right-hand side of the linear system
|
||||
!
|
||||
do i = ng, n - ng + 1
|
||||
r(i) = sum(ci5(:) * fc(i-2:i+2))
|
||||
end do
|
||||
|
||||
! use explicit methods for ghost zones
|
||||
!
|
||||
r( 1) = sum(ce2(:) * fc( 1: 2))
|
||||
r( 2) = sum(ce3(:) * fc( 1: 3))
|
||||
do i = 3, ng
|
||||
@ -4547,32 +4543,20 @@ module interpolations
|
||||
r(n-1) = sum(ce3(:) * fc(n-2: n))
|
||||
r(n ) = fc(n )
|
||||
|
||||
! solve the tridiagonal system of equations
|
||||
!
|
||||
call tridiag(n, a(1:n), b(1:n), c(1:n), r(1:n), u(1:n))
|
||||
|
||||
! apply the monotonicity preserving limiter
|
||||
!
|
||||
call mp_limiting(fc(:), u(:))
|
||||
|
||||
! return the interpolated values of the left state
|
||||
!
|
||||
fl(1:n) = u(1:n)
|
||||
|
||||
!! === right-side interpolation ===
|
||||
!!
|
||||
! invert the cell-centered integrals
|
||||
!
|
||||
fi(1:n) = fc(n:1:-1)
|
||||
|
||||
! prepare the right-hand side of the linear system
|
||||
!
|
||||
do i = ng, n - ng + 1
|
||||
r(i) = sum(ci5(:) * fi(i-2:i+2))
|
||||
end do ! i = ng, n - ng + 1
|
||||
|
||||
! use explicit methods for ghost zones
|
||||
!
|
||||
r( 1) = sum(ce2(:) * fi( 1: 2))
|
||||
r( 2) = sum(ce3(:) * fi( 1: 3))
|
||||
do i = 3, ng
|
||||
@ -4584,20 +4568,12 @@ module interpolations
|
||||
r(n-1) = sum(ce3(:) * fi(n-2: n))
|
||||
r(n ) = fi(n )
|
||||
|
||||
! solve the tridiagonal system of equations
|
||||
!
|
||||
call tridiag(n, a(1:n), b(1:n), c(1:n), r(1:n), u(1:n))
|
||||
|
||||
! apply the monotonicity preserving limiter
|
||||
!
|
||||
call mp_limiting(fi(:), u(:))
|
||||
|
||||
! return the interpolated values of the right state
|
||||
!
|
||||
fr(1:n-1) = u(n-1:1:-1)
|
||||
|
||||
! update the extremum points
|
||||
!
|
||||
i = n - 1
|
||||
fl(1) = 0.5d+00 * (fc(1) + fc(2))
|
||||
fr(i) = 0.5d+00 * (fc(i) + fc(n))
|
||||
|
Loading…
x
Reference in New Issue
Block a user