Operator +.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(conservative_compressible), | intent(in) | :: | lhs | Left hand side. |
||
| class(conservative_object), | intent(in) | :: | rhs | Right hand side. |
Operator result.
function add(lhs, rhs) result(operator_result)
!< Operator `+`.
class(conservative_compressible), intent(in) :: lhs !< Left hand side.
class(conservative_object), intent(in) :: rhs !< Right hand side.
class(conservative_object), allocatable :: operator_result !< Operator result.
allocate(conservative_compressible :: operator_result)
select type(operator_result)
class is(conservative_compressible)
operator_result = lhs
select type(rhs)
class is (conservative_compressible)
operator_result%density = lhs%density + rhs%density
operator_result%momentum = lhs%momentum + rhs%momentum
operator_result%energy = lhs%energy + rhs%energy
endselect
endselect
endfunction add