Output the Euler field state (primitive variables).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D_caf_nf), | intent(in) | :: | self | Euler field. |
||
logical, | intent(in), | optional | :: | conservative | Output conservative variables instead of primitive. |
Euler state vector.
pure function output(self, conservative) result(state)
!---------------------------------------------------------------------------------------------------------------------------------
!< Output the Euler field state (primitive variables).
!---------------------------------------------------------------------------------------------------------------------------------
class(euler_1D_caf_nf), intent(IN) :: self !< Euler field.
logical, optional, intent(IN) :: conservative !< Output conservative variables instead of primitive.
real(R_P), dimension(:,:), allocatable :: state !< Euler state vector.
integer(I_P) :: i !< Counter.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
if (present(conservative)) then
state = self%U
else
allocate(state(1:self%Np, 1:self%Ni))
do i=1, self%Ni
state(:, i) = self%conservative2primitive(self%U(:, i))
enddo
endif
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction output