-
Notifications
You must be signed in to change notification settings - Fork 24
Add user-defined near null space to aggregation-based AMG #118
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
base: master
Are you sure you want to change the base?
Add user-defined near null space to aggregation-based AMG #118
Conversation
User defined near null space for SA-AMG
function init(::SmoothedAggregationAMG, A, b; kwargs...) | ||
AMGSolver(smoothed_aggregation(A; kwargs...), b) | ||
function init(sa::SmoothedAggregationAMG, A, b; kwargs...) | ||
AMGSolver(smoothed_aggregation(A,sa.B; kwargs...), b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AMGSolver(smoothed_aggregation(A,sa.B; kwargs...), b) | |
AMGSolver(smoothed_aggregation(A, sa.B; kwargs...), b) |
@@ -1,4 +1,4 @@ | |||
function smoothed_aggregation(A::TA, | |||
function smoothed_aggregation(A::TA, _B = nothing, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
B
should be a new kwarg. Note that smoothed_aggregation
is exported (although no docstring is present) and this proposed change here would be breaking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, Ok no problem. But since we will send B as kwargs, then we don't need :
struct SmoothedAggregationAMG <: AMGAlg
B::Union{<:AbstractArray,Nothing} # `B` can be `Vector`, `Matrix`, or `nothing`
function SmoothedAggregationAMG(B::Union{AbstractArray,Nothing}=nothing)
new(B)
end
end
and B can be send directly as kwargs in solve
like: solve(A, b, SmoothedAggregationAMG(), log=true, reltol=1e-10,B=B)
what do you see on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also thought about this, but I am not sure. Having B as input for solve makes more sense for me in the current design, as we do not pass any of the other parameters via the struct. In this case we need to add an error message to the Ruge-Stüben solve tho. Are there any other consequences which I do not see right now?
@ranjanan I would kindly ask for your opinion on this matter.
@termi-official Do you have commit access here? I would be happy to add you here if you can help shepherd the feature and related release. |
Yes. Ranjan already gave me access here to push the AMG framework further. |
closes #80
@termi-official Ferrite dependency is now gone and the whole system is stored in "lin_elastic_2d.jld2"