From e65de6d1f88c307246c3eab1271d64a51593ea3a Mon Sep 17 00:00:00 2001 From: heister Date: Thu, 9 Aug 2012 13:41:07 +0000 Subject: [PATCH] additional error check in Trilinos SparseMatrix in debug mode git-svn-id: https://svn.dealii.org/trunk@25809 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/lac/trilinos_sparse_matrix.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deal.II/source/lac/trilinos_sparse_matrix.cc b/deal.II/source/lac/trilinos_sparse_matrix.cc index 4ca860c810..2534911edc 100644 --- a/deal.II/source/lac/trilinos_sparse_matrix.cc +++ b/deal.II/source/lac/trilinos_sparse_matrix.cc @@ -911,12 +911,19 @@ namespace TrilinosWrappers SparseMatrix::diag_element (const unsigned int i) const { Assert (m() == n(), ExcNotQuadratic()); - + +#ifdef DEBUG + // use operator() in debug mode because + // it checks if this is a valid element + // (in parallel) + return operator()(i,i); +#else // Trilinos doesn't seem to have a // more efficient way to access the // diagonal than by just using the // standard el(i,j) function. return el(i,i); +#endif } -- 2.39.5