Multiply an Euler field by a real scalar.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D_openmp), | intent(in) | :: | lhs | Left hand side. |
||
real(kind=R_P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
function euler_multiply_real(lhs, rhs) result(opr)
!---------------------------------------------------------------------------------------------------------------------------------
!< Multiply an Euler field by a real scalar.
!---------------------------------------------------------------------------------------------------------------------------------
class(euler_1D_openmp), intent(IN) :: lhs !< Left hand side.
real(R_P), intent(IN) :: rhs !< Right hand side.
class(integrand), allocatable :: opr !< Operator result.
integer(I_P) :: i !< Counter.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
allocate(euler_1D_openmp :: opr)
select type(opr)
class is(euler_1D_openmp)
opr = lhs
endselect
!$OMP PARALLEL DEFAULT(NONE) PRIVATE(i) SHARED(lhs, rhs, opr)
select type(opr)
class is(euler_1D_openmp)
!$OMP DO
do i=1, lhs%Ni
opr%U(:, i) = lhs%U(:, i) * rhs
enddo
endselect
!$OMP END PARALLEL
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction euler_multiply_real