Assign one Euler field to another.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(euler_1d), | intent(inout) | :: | lhs | Left hand side. |
||
| class(integrand), | intent(in) | :: | rhs | Right hand side. |
subroutine euler_assign_euler(lhs, rhs)
!< Assign one Euler field to another.
class(euler_1d), intent(inout) :: lhs !< Left hand side.
class(integrand), intent(in) :: rhs !< Right hand side.
integer(I4P) :: i !< Counter.
select type(rhs)
class is(euler_1d)
lhs%weno_order = rhs%weno_order
lhs%Ni = rhs%Ni
lhs%Ng = rhs%Ng
lhs%Dx = rhs%Dx
lhs%eos = rhs%eos
if (allocated(rhs%U)) then
if (allocated(lhs%U)) deallocate(lhs%U) ; allocate(lhs%U(1:lhs%Ni))
select type(rhs)
class is(euler_1d)
if (allocated(rhs%U)) then
do i=1, lhs%Ni
lhs%U(i) = rhs%U(i)
enddo
endif
endselect
endif
if (allocated(rhs%BC_L)) lhs%BC_L = rhs%BC_L
if (allocated(rhs%BC_R)) lhs%BC_R = rhs%BC_R
if (allocated(rhs%interpolator)) then
if (allocated(lhs%interpolator)) deallocate(lhs%interpolator)
allocate(lhs%interpolator, source=rhs%interpolator)
endif
if (associated(rhs%reconstruct_interfaces)) lhs%reconstruct_interfaces => rhs%reconstruct_interfaces
! if (associated(rhs%riemann_solver)) lhs%riemann_solver => rhs%riemann_solver
if (allocated(rhs%riemann_solver)) then
if (allocated(lhs%riemann_solver)) deallocate(lhs%riemann_solver) ; allocate(lhs%riemann_solver, source=rhs%riemann_solver)
endif
endselect
endsubroutine euler_assign_euler