Skip to content

How can I update the values of an already assembled sparse matrix? #945

Answered by upsj
edocento asked this question in Q&A
Discussion options

You must be logged in to vote

We don't have a good high-performance interface for this yet, but you can start off by using the gko::matrix_assembly_data type and its add_data member function, which is meant for exactly this FEM-like matrix assembly use case. matrix_assembly_data can be passed directly to any matrix->read(...) function of the correct value and index type :) Note that this is meant for assembling a matrix once - if your matrix entries change repeatedly (e.g. nonlinear problem), I'd recommend modifying the entries in-place using the existing column index information in the matrix types.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@edocento
Comment options

@upsj
Comment options

@edocento
Comment options

@upsj
Comment options

@Slaedr
Comment options

Answer selected by edocento
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants