Skip to content

Commit

Permalink
Refactored MultiFieldSparseMatrixAssembler
Browse files Browse the repository at this point in the history
  • Loading branch information
fverdugo committed May 6, 2020
1 parent cfb46ed commit 9fcaca4
Show file tree
Hide file tree
Showing 4 changed files with 198 additions and 160 deletions.
12 changes: 10 additions & 2 deletions src/FESpaces/Assemblers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,12 @@ function assemble_matrix(

n = count_matrix_nnz_coo(a,term_to_cellidsrows,term_to_cellidscols)
I,J,V = allocate_coo_vectors(get_matrix_type(a),n)
fill_matrix_coo_numeric!(I,J,V,a,term_to_cellmat,term_to_cellidsrows,term_to_cellidscols)

nmax = fill_matrix_coo_numeric!(I,J,V,a,term_to_cellmat,term_to_cellidsrows,term_to_cellidscols)
resize!(I,nmax)
resize!(J,nmax)
resize!(V,nmax)

m = num_free_dofs(a.test)
n = num_free_dofs(a.trial)
finalize_coo!(get_matrix_type(a),I,J,V,m,n)
Expand All @@ -316,7 +321,10 @@ function assemble_matrix_and_vector(a::SparseMatrixAssembler, matvecdata, matdat
I,J,V = allocate_coo_vectors(get_matrix_type(a),n)
b = allocate_vector(a,vecdata...)

fill_matrix_and_vector_coo_numeric!(I,J,V,b,a, matvecdata, matdata, vecdata)
nmax = fill_matrix_and_vector_coo_numeric!(I,J,V,b,a, matvecdata, matdata, vecdata)
resize!(I,nmax)
resize!(J,nmax)
resize!(V,nmax)

m = num_free_dofs(a.test)
n = num_free_dofs(a.trial)
Expand Down
6 changes: 6 additions & 0 deletions src/FESpaces/FESpaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ export apply_constraints_matrix_and_vector_rows
export test_fe_space

export Assembler
export AssemblyStrategy
export row_map
export col_map
export row_mask
export col_mask
export DefaultAssemblyStrategy
export get_test
export get_trial
export assemble_matrix!
Expand Down
13 changes: 7 additions & 6 deletions src/MultiField/MultiField.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ import Gridap.FESpaces: SparseMatrixAssembler
import Gridap.FESpaces: AffineFEOperator
import Gridap.FESpaces: FEOperator
import Gridap.FESpaces: EvaluationFunction
export Gridap.FESpaces: get_matrix_type
export Gridap.FESpaces: get_vector_type
export Gridap.FESpaces: count_matrix_nnz_coo
export Gridap.FESpaces: fill_matrix_coo_symbolic!
export Gridap.FESpaces: fill_matrix_coo_numeric!
export Gridap.FESpaces: fill_matrix_and_vector_coo_numeric!
import Gridap.FESpaces: get_matrix_type
import Gridap.FESpaces: get_vector_type
import Gridap.FESpaces: get_assembly_strategy
import Gridap.FESpaces: count_matrix_nnz_coo
import Gridap.FESpaces: fill_matrix_coo_symbolic!
import Gridap.FESpaces: fill_matrix_coo_numeric!
import Gridap.FESpaces: fill_matrix_and_vector_coo_numeric!

import Base: +, -

Expand Down
Loading

0 comments on commit 9fcaca4

Please sign in to comment.