Skip to content

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

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

Abdelrahman912
Copy link

closes #80

@termi-official Ferrite dependency is now gone and the whole system is stored in "lin_elastic_2d.jld2"

@Abdelrahman912 Abdelrahman912 marked this pull request as ready for review May 28, 2025 21:00
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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,
Copy link
Collaborator

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.

Copy link
Author

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?

Copy link
Collaborator

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.

@ViralBShah
Copy link
Member

@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.

@termi-official
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User-defined near null space
3 participants