|
10 | 10 |
|
11 | 11 | #2. pass `B` as vector
|
12 | 12 | B = ones(T,n)
|
13 |
| - x_vec = solve(A, b, SmoothedAggregationAMG(B), maxiter = 1, abstol = 1e-6) |
| 13 | + x_vec = solve(A, b, SmoothedAggregationAMG(), maxiter = 1, abstol = 1e-6;B=B) |
14 | 14 | @test x_vec ≈ x_nothing
|
15 | 15 |
|
16 | 16 | #3. pass `B` as matrix
|
17 | 17 | B = ones(T,n,1)
|
18 |
| - x_mat = solve(A, b, SmoothedAggregationAMG(B), maxiter = 1, abstol = 1e-6) |
| 18 | + x_mat = solve(A, b, SmoothedAggregationAMG(), maxiter = 1, abstol = 1e-6;B=B) |
19 | 19 | @test x_mat ≈ x_nothing
|
20 | 20 | end
|
21 | 21 |
|
|
194 | 194 | @load "lin_elastic_2d.jld2" A b B
|
195 | 195 | A = SparseMatrixCSC(A.m, A.n, A.colptr, A.rowval, A.nzval)
|
196 | 196 |
|
197 |
| - x_nns, residuals_nns = solve(A, b, SmoothedAggregationAMG(B); log=true, reltol=1e-10) |
198 |
| - x_wonns, residuals_wonns = solve(A, b, SmoothedAggregationAMG(); log=true, reltol=1e-10) |
199 |
| - |
200 |
| - ml = smoothed_aggregation(A, B) |
201 |
| - @show ml |
| 197 | + x_nns, residuals_nns = solve(A, b, SmoothedAggregationAMG(), log=true, reltol=1e-10;B=B) |
| 198 | + x_wonns, residuals_wonns = solve(A, b, SmoothedAggregationAMG(), log=true, reltol=1e-10) |
202 | 199 |
|
203 | 200 | println("No NNS: final residual at iteration ", length(residuals_wonns), ": ", residuals_wonns[end])
|
204 | 201 | println("With NNS: final residual at iteration ", length(residuals_nns), ": ", residuals_nns[end])
|
|
233 | 230 | @test u[end-1] ≈ (P * L^3) / (3 * E * I) # vertical disp. at the end of the beam
|
234 | 231 |
|
235 | 232 |
|
236 |
| - x_nns, residuals_nns = solve(A, b, SmoothedAggregationAMG(B); log=true, reltol=1e-10) |
237 |
| - x_wonns, residuals_wonns = solve(A, b, SmoothedAggregationAMG(); log=true, reltol=1e-10) |
| 233 | + x_nns, residuals_nns = solve(A, b, SmoothedAggregationAMG(), log=true, reltol=1e-10,B=B) |
| 234 | + x_wonns, residuals_wonns = solve(A, b, SmoothedAggregationAMG(), log=true, reltol=1e-10) |
238 | 235 |
|
239 | 236 | println("No NNS: final residual at iteration ", length(residuals_wonns), ": ", residuals_wonns[end])
|
240 | 237 | println("With NNS: final residual at iteration ", length(residuals_nns), ": ", residuals_nns[end])
|
|
0 commit comments