Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Fixed

- Updated `RichardsonLinearSolver` to also accept the relaxation parameter as an `AbstractVector{Float64}` (in addition to a scalar `Float64`). Since PR[#106](https://github.com/gridap/GridapSolvers.jl/pull/106/files).

## [0.7.0] - 2026-03-10

### Breaking
Expand Down
4 changes: 2 additions & 2 deletions src/LinearSolvers/RichardsonLinearSolvers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
Richardson Iteration, with an optional left preconditioners `Pl`.

The relaxation parameter (ω) can either be of type Float64 or Vector{Float64}.
This gives flexiblity in relaxation.
This gives flexibility in relaxation.
"""
struct RichardsonLinearSolver<:Gridap.Algebra.LinearSolver
ω::Union{Vector{Float64},Float64}
ω::Union{AbstractVector{Float64},Float64}

Copilot AI Mar 31, 2026

Copy link

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.

Copilot AI Mar 31, 2026

Copy link

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.
Pl::Union{Gridap.Algebra.LinearSolver,Nothing}
log::ConvergenceLog{Float64}
end
Expand Down
Loading