From 4a8341f8d300250b83a9ed31e99260cc603c4169 Mon Sep 17 00:00:00 2001 From: Andrew Gibbs Date: Tue, 6 Feb 2024 16:31:42 +0000 Subject: [PATCH] Added its output option --- src/projections.jl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/projections.jl b/src/projections.jl index 6df6b61..a8f8f3c 100644 --- a/src/projections.jl +++ b/src/projections.jl @@ -41,6 +41,18 @@ function \(K::DiscreteSIO, f::Function) return K \ fₕ end +# New versions of backslash - so we can solve and get iteration details easily +function solve_with_it_count(K::DiscreteSIO{V,M,Ω,T}, fₕ::Projection) where {V,M,Ω,T<:LinearMap} + thresh = 1E-8 + coeffs, log_deets = gmres(K.Galerkin_matrix,fₕ.coeffs,reltol=thresh, log=true) + return Projection(K.SIO.domain, K.mesh, coeffs), log_deets +end + +function solve_with_it_count(K::DiscreteSIO{V,M,Ω,T}, f::Function) where {V,M,Ω,T<:LinearMap} + fₕ = project(K.mesh, f, K.h_quad) + return solve_with_it_count(K::DiscreteSIO{V,M,Ω,T}, fₕ::Projection) +end + # now some functions related to projections, and embeddings function embed(f::Projection,g::Projection)