Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gridap/Gridap.jl into facet_integ…
Browse files Browse the repository at this point in the history
…ration_non_conforming_meshes
  • Loading branch information
amartinhuertas committed Jan 28, 2024
2 parents c710563 + faacb16 commit c5a68ae
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
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).

## [0.17.23] - 2024-01-28

### Changed

- Changed how `symbolic_loop_matrix_vector!` loop works. Now it also takes account vector entries touched from matvecdata. Since PR[#975](https://github.com/gridap/Gridap.jl/pull/975).

## [0.17.22] - 2024-01-12

### Added
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Gridap"
uuid = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e"
authors = ["Santiago Badia <[email protected]>", "Francesc Verdugo <[email protected]>", "Alberto F. Martin <[email protected]>"]
version = "0.17.22"
version = "0.17.23"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
35 changes: 34 additions & 1 deletion src/FESpaces/SparseMatrixAssemblers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,44 @@ end
end

function symbolic_loop_matrix_and_vector!(A,b,a::SparseMatrixAssembler,data)
if LoopStyle(A) == DoNotLoop()
return A, b
end
matvecdata, matdata, vecdata = data
symbolic_loop_matrix!(A,a,matvecdata)
strategy = get_assembly_strategy(a)
for (cellmatvec,_cellidsrows,_cellidscols) in zip(matvecdata...)
cellidsrows = map_cell_rows(strategy,_cellidsrows)
cellidscols = map_cell_cols(strategy,_cellidscols)
@assert length(cellidscols) == length(cellidsrows)
@assert length(cellmatvec) == length(cellidsrows)
if length(cellmatvec) > 0
rows_cache = array_cache(cellidsrows)
cols_cache = array_cache(cellidscols)
vals_cache = array_cache(cellmatvec)
mat1, vec1 = getindex!(vals_cache,cellmatvec,1)
rows1 = getindex!(rows_cache,cellidsrows,1)
cols1 = getindex!(cols_cache,cellidscols,1)
touch! = TouchEntriesMap()
touch_mat_cache = return_cache(touch!,A,mat1,rows1,cols1)
touch_vec_cache = return_cache(touch!,b,vec1,rows1)
caches = touch_mat_cache, touch_vec_cache,rows_cache, cols_cache
_symbolic_loop_matvec!(A,b,caches,cellidsrows,cellidscols,mat1,vec1)
end
end
symbolic_loop_matrix!(A,a,matdata)
symbolic_loop_vector!(b,a,vecdata)
A, b
end

@noinline function _symbolic_loop_matvec!(A,b,caches,cell_rows,cell_cols,mat1,vec1)
touch_mat_cache, touch_vec_cache, rows_cache, cols_cache = caches
touch! = TouchEntriesMap()
for cell in 1:length(cell_cols)
rows = getindex!(rows_cache,cell_rows,cell)
cols = getindex!(cols_cache,cell_cols,cell)
evaluate!(touch_mat_cache,touch!,A,mat1,rows,cols)
evaluate!(touch_vec_cache,touch!,b,vec1,rows)
end
end

function numeric_loop_matrix_and_vector!(A,b,a::SparseMatrixAssembler,data)
Expand Down

0 comments on commit c5a68ae

Please sign in to comment.