]> https://gitweb.dealii.org/ - dealii.git/commit
Fix bug in Trilinos SparseMatrix::add/copy_from 359/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 18 Dec 2014 11:03:18 +0000 (12:03 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 18 Dec 2014 21:35:13 +0000 (22:35 +0100)
commitbe0f0c728553501dafa3e0f9364e7c4c3d2781bf
tree783a405eee7e389d11f159089e6cf24afe6f4479
parentf2670cf963d98a1a30b6615e1d5e6fe62e57f5ab
Fix bug in Trilinos SparseMatrix::add/copy_from

We assume that the pointers to a Trilinos sparse matrix remain valid when a matrix
is copied from another one or added and the two matrices share the same sparsity pattern.
This is used in step-32. However, the fix introduced in 8d64256 could not ensure this
(while fixing a few other cases). The check if the two sparsity patterns point to the same
memory is not good (we can have the same sparsity pattern memory but different addresses).

Therefore, the add and copy_from methods need to be more careful to not set up a new
matrix structure when this is not necessary. In particular, the two methods now check
whether the column indices are the same in any case but without requiring calling
methods that change the memory layout.
source/lac/trilinos_sparse_matrix.cc
tests/trilinos/add_matrices_04.cc [new file with mode: 0644]
tests/trilinos/add_matrices_04.output [new file with mode: 0644]
tests/trilinos/add_matrices_05.cc [new file with mode: 0644]
tests/trilinos/add_matrices_05.output [new file with mode: 0644]
tests/trilinos/add_matrices_06.cc [new file with mode: 0644]
tests/trilinos/add_matrices_06.output [new file with mode: 0644]

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.