-
-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CG and GMRES Incompatible with Systems of PDEs #5
Comments
Do you mean when julia> x = rand(20,20); A = rand(20,20); b = rand(20,20);
julia> cg(A,b)
ERROR: DimensionMismatch("dimensions must match")
in promote_shape at ./operators.jl:211
julia> cg!(x,A,b)
ERROR: MethodError: `init!` has no method matching init!(::IterativeSolvers.KrylovSubspace{Float64,Array{Float64,2}}, ::Array{Float64,2})
Closest candidates are:
init!{T}(::IterativeSolvers.KrylovSubspace{T,OpT}, ::Array{T,1}) |
Yes, that's the error which stops it from working. Either |
I don't really know what the future plan for |
Now that I think about, if I'm not mistaken, this can just be done with a comprehension over the iterative solvers. For example, when solving (Would there be any efficiency gains by handling it somewhat similarly inside the Should there be type annotation on the |
Does the stopping criteria change for matrices? Yeah what you are saying could be done easily in a patch, but at the moment the pull request are merging slowly (might take some time). |
I think the stopping criteria can be done either way. Theoretically there is none so it's just what's practical. In practice, by doing a loop over However, in the case of PDEs it may be more practical to allow the different columns to have the errors/tolerances applied separately because they may differ vastly in their values (one case where this may come up is a PDE where the components are kept in the columns of |
It works. However, I wasn't able to use views, so it has some extra allocations. Noted in #33 |
CG and GMRES linear solvers only work on vectors and not matrices due to using
dot
. An issue has been opened at JuliaLinearAlgebra/IterativeSolvers.jl#73. I may need to implement my own CG/GMRES. Also related is a way to handle different diffusion constants (functions) with CG/GMRESThe text was updated successfully, but these errors were encountered: