From: Daniel Arndt Date: Wed, 27 Mar 2024 12:57:16 +0000 (-0400) Subject: Use ifdef DEBUG instead X-Git-Tag: v9.6.0-rc1~448^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=627f8b03bc42143eb3b49d06622765db1616c21e;p=dealii.git Use ifdef DEBUG instead --- diff --git a/include/deal.II/lac/trilinos_tpetra_vector.templates.h b/include/deal.II/lac/trilinos_tpetra_vector.templates.h index 70ded3bbdf..c28a18481c 100644 --- a/include/deal.II/lac/trilinos_tpetra_vector.templates.h +++ b/include/deal.II/lac/trilinos_tpetra_vector.templates.h @@ -1032,18 +1032,20 @@ namespace LinearAlgebra const size_type begin = vector->getMap()->getMinGlobalIndex(); const size_type end = vector->getMap()->getMaxGlobalIndex() + 1; - [[maybe_unused]] const size_type n_local_elements = -# if DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0) +# ifdef DEBUG + const size_type n_local_elements = +# if DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0) vector->getMap()->getLocalNumElements(); -# else +# else vector->getMap()->getNodeNumElements(); -# endif +# endif Assert( end - begin == n_local_elements, ExcMessage( "This function only makes sense if the elements that this " "vector stores on the current processor form a contiguous range. " "This does not appear to be the case for the current vector.")); +# endif return std::make_pair(begin, end); }