Compute polynomials.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(polynomials_js), | intent(inout) | :: | self | WENO polynomial. |
||
integer(kind=I_P), | intent(in) | :: | S | Number of stencils actually used. |
||
real(kind=R_P), | intent(in) | :: | stencil(1:,1-S:) | Stencil used for the interpolation, [1:2, 1-S:-1+S]. |
||
integer(kind=I_P), | intent(in) | :: | f1 | Faces to be computed. |
||
integer(kind=I_P), | intent(in) | :: | f2 | Faces to be computed. |
||
integer(kind=I_P), | intent(in) | :: | ff | Faces to be computed. |
pure subroutine compute(self, S, stencil, f1, f2, ff)
!< Compute polynomials.
class(polynomials_js), intent(inout) :: self !< WENO polynomial.
integer(I_P), intent(in) :: S !< Number of stencils actually used.
real(R_P), intent(in) :: stencil(1:, 1 - S:) !< Stencil used for the interpolation, [1:2, 1-S:-1+S].
integer(I_P), intent(in) :: f1, f2, ff !< Faces to be computed.
integer(I_P) :: s1, s2, f !< Counters
self%poly = 0._R_P
do s1 = 0, S - 1 ! stencils loop
do s2 = 0, S - 1 ! values loop
do f = f1, f2 ! 1 => left interface (i-1/2), 2 => right interface (i+1/2)
self%poly(f, s1) = self%poly(f, s1) + self%coef(f, s2, s1) * stencil(f + ff, -s2 + s1)
enddo
enddo
enddo
endsubroutine compute