getPlus_overlapLowering Function

private function getPlus_overlapLowering(nSwitches, bVal, dat) result(plusWeight)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: nSwitches
real(kind=dp), intent(in) :: bVal
type(WeightData_t), intent(in) :: dat

Return Value real(kind=dp)


Contents


Source Code

    function getPlus_overlapLowering(nSwitches, bVal, dat) result(plusWeight)
        real(dp), intent(in) :: nSwitches, bVal
        type(WeightData_t), intent(in) :: dat
        real(dp) :: plusWeight
        character(*), parameter :: this_routine = "getPlus_overlapLowering"

        ASSERT(nSwitches >= 0.0_dp)

        ! if b == 0, set the plus weight to zero, to handle that case
        if (near_zero(bVal)) then
            plusWeight = 0.0_dp
        else

            plusWeight = dat%F * dat%plus + dat%G * (1.0_dp - dat%F) * dat%minus + &
                         nSwitches / bVal * (dat%G * dat%minus + dat%F * (1.0_dp - dat%G) * dat%plus)

        end if
        ASSERT(plusWeight >= 0.0_dp)

    end function getPlus_overlapLowering