forward Function

public function forward(L, b) result(y)

forward algorithm, solves the system where L is a lower triangular matrix and b is a vector

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), DIMENSION(:, :) :: L
real(kind=dp), intent(in), DIMENSION(:) :: b

Return Value real(kind=dp), DIMENSION(SIZE(L, 1))


Called by

proc~~forward~~CalledByGraph proc~forward forward proc~applypreconditioner ApplyPreconditioner proc~applypreconditioner->proc~forward

Source Code

    FUNCTION forward(L, b) RESULT(y)
        REAL(dp), DIMENSION(:, :), INTENT(IN) :: L
        REAL(dp), DIMENSION(:), INTENT(IN) :: b
        REAL(dp), DIMENSION(SIZE(L, 1)) :: y
        INTEGER :: i, N
    
        N = SIZE(L, 1)
    
        y(1) = b(1) / L(1, 1)

        DO i = 2,N
            y(i) = (b(i) - DOT_PRODUCT(L(i,1:i-1), y(1:i-1))) / L(i,i)
        END DO
    
    END FUNCTION forward