FE-Project
Loading...
Searching...
No Matches
Public Member Functions | List of all members
scale_linalgebra::linalgebra_solvelineq Interface Reference

Public Member Functions

subroutine linalgebra_solvelineq_b1d (a, b, x)
 
subroutine linalgebra_solvelineq_b2d (a, b, x)
 

Detailed Description

Definition at line 32 of file scale_linalgebra.F90.

Member Function/Subroutine Documentation

◆ linalgebra_solvelineq_b1d()

subroutine scale_linalgebra::linalgebra_solvelineq::linalgebra_solvelineq_b1d ( real(rp), dimension(:,:), intent(in) a,
real(rp), dimension(:), intent(in) b,
real(rp), dimension(size(b)), intent(out) x )

Definition at line 96 of file scale_linalgebra.F90.

97
98 real(RP), intent(in) :: A(:,:)
99 real(RP), intent(in) :: b(:)
100 real(RP), intent(out) :: x(size(b))
101
102 real(RP) :: A_lu(size(A,1),size(A,2))
103 integer :: ipiv(size(A,1))
104 integer :: n, info
105
106 !---------------------------------------------------------------------------
107
108 a_lu = a
109 n = size(a,1)
110
111 call dgetrf(n, n, a_lu, n, ipiv, info)
112 if (info /=0 ) then
113 log_error("linalgebra_SolveLinEq",*) "Matrix is singular"
114 call prc_abort
115 end if
116
117 x(:) = b
118 call dgetrs('N', n, 1, a_lu, n, ipiv, x, n, info)
119 if (info /=0 ) then
120 log_error("linalgebra_SolveLinEq",*) "Matrix inversion is failed"
121 call prc_abort
122 end if
123
124 return

◆ linalgebra_solvelineq_b2d()

subroutine scale_linalgebra::linalgebra_solvelineq::linalgebra_solvelineq_b2d ( real(rp), dimension(:,:), intent(in) a,
real(rp), dimension(:,:), intent(in) b,
real(rp), dimension(size(b,1),size(b,2)), intent(out) x )

Definition at line 128 of file scale_linalgebra.F90.

129
130 real(RP), intent(in) :: A(:,:)
131 real(RP), intent(in) :: b(:,:)
132 real(RP), intent(out) :: x(size(b,1),size(b,2))
133
134 real(RP) :: A_lu(size(A,1),size(A,2))
135 integer :: ipiv(size(A,1))
136 integer :: n, info
137
138 !---------------------------------------------------------------------------
139
140 a_lu = a
141 n = size(a,1)
142
143 call dgetrf(n, n, a_lu, n, ipiv, info)
144 if (info /=0 ) then
145 log_error("linalgebra_SolveLinEq",*) "Matrix is singular"
146 call prc_abort
147 end if
148
149 x(:,:) = b
150 call dgetrs('N', n, size(b,2), a_lu, n, ipiv, x, n, info)
151 if (info /=0 ) then
152 log_error("linalgebra_SolveLinEq",*) "Matrix inversion is failed"
153 call prc_abort
154 end if
155
156 return

The documentation for this interface was generated from the following file: