Reconstruct interfaces states.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_ladvection), | intent(in) | :: | self | Advection field. |
||
real(kind=R_P), | intent(in) | :: | conservative(1-self%Ng:) | Conservative variables. |
||
real(kind=R_P), | intent(inout) | :: | r_conservative(1:,0:) | Reconstructed conservative vars. |
subroutine reconstruct_interfaces(self, conservative, r_conservative)
!< Reconstruct interfaces states.
class(integrand_ladvection), intent(in) :: self !< Advection field.
real(R_P), intent(in) :: conservative(1-self%Ng:) !< Conservative variables.
real(R_P), intent(inout) :: r_conservative(1:, 0:) !< Reconstructed conservative vars.
real(R_P) :: C(1:2, 1-self%Ng:-1+self%Ng) !< Stencils.
real(R_P) :: CR(1:2) !< Reconstrcuted intrafaces.
integer(I_P) :: i !< Counter.
integer(I_P) :: j !< Counter.
integer(I_P) :: f !< Counter.
select case(self%weno_order)
case(1) ! 1st order piecewise constant reconstruction
do i=0, self%Ni+1
r_conservative(1, i) = conservative(i)
r_conservative(2, i) = r_conservative(1, i)
enddo
case(3, 5, 7, 9, 11, 13, 15, 17) ! 3rd-17th order WENO reconstruction
do i=0, self%Ni+1
do j=i+1-self%Ng, i-1+self%Ng
do f=1, 2
C(f, j-i) = conservative(j)
enddo
enddo
call self%interpolator%interpolate(stencil=C(:, :), interpolation=CR(:))
do f=1, 2
r_conservative(f, i) = CR(f)
enddo
enddo
endselect
endsubroutine reconstruct_interfaces