Add two Euler fields.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(euler_1d), | intent(in) | :: | lhs | Left hand side. |
||
| class(integrand), | intent(in) | :: | rhs | Right hand side. |
Operator result.
function add_euler(lhs, rhs) result(opr)
!< Add two Euler fields.
class(euler_1d), intent(in) :: lhs !< Left hand side.
class(integrand), intent(in) :: rhs !< Right hand side.
class(integrand), allocatable :: opr !< Operator result.
integer(I4P) :: i !< Counter.
allocate (euler_1d :: opr)
select type(opr)
class is(euler_1d)
opr = lhs
select type(rhs)
class is (euler_1d)
do i=1, lhs%Ni
opr%U(i) = lhs%U(i) + rhs%U(i)
enddo
endselect
endselect
endfunction add_euler