Skip to content
Closed
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
3 changes: 3 additions & 0 deletions src/RB/RBSteady/Projections.jl
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,9 @@ for f in (:project!,:inv_project!)
end

function Arrays.return_cache(::typeof(get_norm_matrix),a::BlockProjection)
blocksizes = num_fe_dofs(a)
n = sum(blocksizes)
norm_matrix = BlockArray(zeros(n,n),blocksizes,blocksizes)
i = findfirst(a.touched)
@notimplementedif isnothing(i)
A = typeof(get_norm_matrix(a[i]))
Expand Down
28 changes: 28 additions & 0 deletions test/RBSteady/block_projection_norm_matrix.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module BlockProjectionNormMatrixTest

using Test
using GridapROMs
using GridapROMs.RBSteady
using BlockArrays
using LinearAlgebra

function main()
basis1 = rand(10,3)
basis2 = rand(10,2)
proj1 = PODProjection(basis1)
proj2 = PODProjection(basis2)

array = [proj1,proj2]
touched = [true,true]
bp = BlockProjection(array,touched)

norm_matrix = get_norm_matrix(bp)
@test norm_matrix isa AbstractMatrix
@test size(norm_matrix) == (20,20)
@test norm_matrix[Block(1,1)] == I(10)
@test norm_matrix[Block(2,2)] == I(10)
end

main()

end
Loading