From: heister Date: Thu, 9 Aug 2012 13:41:07 +0000 (+0000) Subject: additional error check in Trilinos SparseMatrix in debug mode X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e65de6d1f88c307246c3eab1271d64a51593ea3a;p=dealii-svn.git additional error check in Trilinos SparseMatrix in debug mode git-svn-id: https://svn.dealii.org/trunk@25809 0785d39b-7218-0410-832d-ea1e28bc413d --- 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 }