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.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
allocate (euler_1D :: opr)
select type(opr)
class is(euler_1D)
opr = lhs
select type(rhs)
class is (euler_1D)
opr%U = lhs%U + rhs%U
endselect
endselect
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction add_euler