Skip to content

Minor update to RichardsonLinearSolver#106

Open
shreyas02 wants to merge 7 commits intogridap:mainfrom
shreyas02:richardson_bugfix
Open

Minor update to RichardsonLinearSolver#106
shreyas02 wants to merge 7 commits intogridap:mainfrom
shreyas02:richardson_bugfix

Conversation

@shreyas02
Copy link
Copy Markdown
Contributor

Updating the struct to handle a more wide range of relaxation parameters.

Copilot AI review requested due to automatic review settings March 31, 2026 12:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates RichardsonLinearSolver to accept a broader set of vector-like relaxation parameters by widening the stored type from Vector{Float64} to AbstractVector{Float64}, and documents the change in the changelog.

Changes:

  • Widened the ω field type to accept AbstractVector{Float64} in addition to Float64.
  • Added an “Unreleased” NEWS entry describing the update.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/LinearSolvers/RichardsonLinearSolvers.jl Broadens the accepted relaxation parameter container type (VectorAbstractVector).
NEWS.md Adds an Unreleased changelog entry for the Richardson relaxation parameter update.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"""
struct RichardsonLinearSolver<:Gridap.Algebra.LinearSolver
ω::Union{Vector{Float64},Float64}
ω::Union{AbstractVector{Float64},Float64}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

Using an abstract type (AbstractVector{Float64}) as a struct field can introduce dynamic dispatch/type-instability when ω is accessed inside hot loops. Consider making RichardsonLinearSolver parametric over the relaxation type (e.g., RichardsonLinearSolver{W} with ω::W and a constructor that restricts W to Float64 or AbstractVector{Float64}) to keep instances concretely typed while still accepting any AbstractVector implementation.

Copilot uses AI. Check for mistakes.
"""
struct RichardsonLinearSolver<:Gridap.Algebra.LinearSolver
ω::Union{Vector{Float64},Float64}
ω::Union{AbstractVector{Float64},Float64}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The docstring above this struct still says the relaxation parameter can be a Vector{Float64}; with this change it should be updated to reflect AbstractVector{Float64} (or whatever types are intended) so user-facing docs match the actual accepted types.

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.55%. Comparing base (7f2d3c0) to head (ee0d9fd).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #106   +/-   ##
=======================================
  Coverage   66.55%   66.55%           
=======================================
  Files          62       62           
  Lines        4072     4072           
=======================================
  Hits         2710     2710           
  Misses       1362     1362           
Flag Coverage Δ
mpi-applications 32.66% <ø> (ø)
mpi-block 12.90% <ø> (ø)
mpi-linear 36.93% <100.00%> (ø)
mpi-multilevel 12.22% <ø> (ø)
mpi-nonlinear 6.65% <ø> (ø)
seq-applications 11.29% <ø> (ø)
seq-block 12.16% <ø> (ø)
seq-linear 38.24% <100.00%> (ø)
seq-multilevel 2.99% <ø> (ø)
seq-nonlinear 7.74% <ø> (ø)
test-extlibs 7.48% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

shreyas02 and others added 2 commits March 31, 2026 14:30
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants