Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gridap/Gridap.jl into fix_in_adap…
Browse files Browse the repository at this point in the history
…tivity
  • Loading branch information
JordiManyer committed Aug 30, 2023
2 parents 5e15817 + 578f5b7 commit dca67ab
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
8 changes: 6 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ 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
## Unreleased

### Added

- Block assembly now generalised to work with `AbstractBlockArrays`, to include changes in GridapDistributed. Since PR [939](https://github.com/gridap/Gridap.jl/pull/939).

### Fixed

Expand All @@ -17,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Reimplemented `DomainStyle` for `CellQuadrature` to fix breaking low-level Poisson tutorial. Since PR [#937](https://github.com/gridap/Gridap.jl/pull/937).

## [0.17.18] - 2023-08-15
## [0.17.18] - 2023-08-15

### Added

Expand Down
19 changes: 11 additions & 8 deletions src/MultiField/BlockSparseMatrixAssemblers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ end
function FESpaces.SparseMatrixAssembler(mat,
vec,
trial::MultiFieldFESpace{<:BlockMultiFieldStyle},
test::MultiFieldFESpace{<:BlockMultiFieldStyle},
test ::MultiFieldFESpace{<:BlockMultiFieldStyle},
strategy::AssemblyStrategy=DefaultAssemblyStrategy())
return BlockSparseMatrixAssembler(trial,test,SparseMatrixBuilder(mat),ArrayBuilder(vec),strategy)
end
Expand Down Expand Up @@ -272,22 +272,25 @@ end
# In place assembly modifications (for dispatching)
# We convert from BlockArray to ArrayBlock to be able to expland the blocks.
# After assembly we convert back to BlockArray automatically.
function FESpaces.assemble_vector_add!(b::BlockVector,a::BlockSparseMatrixAssembler,vecdata)
b1 = ArrayBlock(b.blocks,fill(true,size(b.blocks)))
function FESpaces.assemble_vector_add!(b::AbstractBlockVector,a::BlockSparseMatrixAssembler,vecdata)
b1 = ArrayBlock(blocks(b),fill(true,blocksize(b)))
b2 = expand_blocks(a,b1)
FESpaces.assemble_vector_add!(b2,a,vecdata)
end

function FESpaces.assemble_matrix_add!(mat::BlockMatrix,a::BlockSparseMatrixAssembler,matdata)
m1 = ArrayBlock(mat.blocks,fill(true,size(mat.blocks)))
function FESpaces.assemble_matrix_add!(mat::AbstractBlockMatrix,a::BlockSparseMatrixAssembler,matdata)
m1 = ArrayBlock(blocks(mat),fill(true,blocksize(mat)))
m2 = expand_blocks(a,m1)
FESpaces.assemble_matrix_add!(m2,a,matdata)
end

function FESpaces.assemble_matrix_and_vector_add!(A::BlockMatrix,b::BlockVector,a::BlockSparseMatrixAssembler,data)
m1 = ArrayBlock(A.blocks,fill(true,size(A.blocks)))
function FESpaces.assemble_matrix_and_vector_add!(A::AbstractBlockMatrix,
b::AbstractBlockVector,
a::BlockSparseMatrixAssembler,
data)
m1 = ArrayBlock(blocks(A),fill(true,blocksize(A)))
m2 = expand_blocks(a,m1)
b1 = ArrayBlock(b.blocks,fill(true,size(b.blocks)))
b1 = ArrayBlock(blocks(b),fill(true,blocksize(b)))
b2 = expand_blocks(a,b1)
FESpaces.assemble_matrix_and_vector_add!(m2,b2,a,data)
end

0 comments on commit dca67ab

Please sign in to comment.