Add two Burgers fields.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(burgers), | intent(in) | :: | lhs | Left hand side. |
||
class(integrand), | intent(in) | :: | rhs | Right hand side. |
Operator result.
function add_burgers(lhs, rhs) result(opr)
!---------------------------------------------------------------------------------------------------------------------------------
!< Add two Burgers fields.
!---------------------------------------------------------------------------------------------------------------------------------
class(burgers), intent(IN) :: lhs !< Left hand side.
class(integrand), intent(IN) :: rhs !< Right hand side.
class(integrand), allocatable :: opr !< Operator result.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
allocate(burgers :: opr)
select type(opr)
class is(burgers)
opr = lhs
select type(rhs)
class is (burgers)
opr%U = lhs%U + rhs%U
endselect
endselect
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction add_burgers