From eee16f92ec1247cdd3d074987e3eaa806d9f1109 Mon Sep 17 00:00:00 2001 From: JordiManyer Date: Mon, 2 Oct 2023 12:34:40 +1100 Subject: [PATCH] Minor --- src/Algebra.jl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Algebra.jl b/src/Algebra.jl index 9135d5ef..e8fedd02 100644 --- a/src/Algebra.jl +++ b/src/Algebra.jl @@ -1,3 +1,14 @@ + +# Vector allocation + +function Algebra.allocate_vector(::Type{<:PVector{V}},ids::PRange) where {V} + PVector{V}(undef,partition(ids)) +end + +function Algebra.allocate_vector(::Type{<:BlockPVector{V}},ids::BlockPRange) where {V} + BlockPVector{V}(undef,ids) +end + # This might go to Gridap in the future. We keep it here for the moment. function change_axes(a::Algebra.ArrayCounter,axes) @notimplemented @@ -288,14 +299,6 @@ function local_views(a::BlockPMatrix,new_rows::BlockPRange,new_cols::BlockPRange return map(mortar,vals) end -function Algebra.allocate_vector(::Type{<:PVector{V}},ids::PRange) where {V} - PVector{V}(undef,partition(ids)) -end - -function Algebra.allocate_vector(::Type{<:BlockPVector{V}},ids::BlockPRange) where {V} - BlockPVector{V}(undef,ids) -end - # PSparseMatrix assembly struct FullyAssembledRows end