]> https://gitweb.dealii.org/ - dealii.git/commit
Fix bug in Trilinos SparseMatrix::add/copy_from
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 18 Dec 2014 11:03:18 +0000 (12:03 +0100)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Fri, 19 Dec 2014 11:59:07 +0000 (12:59 +0100)
commitda05d8ca2dd90a75b7a783b211f9912ce46a624d
treecc00eb1fe0d451d9c1b54284625cf9764ce24277
parent95e936ed639ed345b3d023f60fd6583fe9eca2fa
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.