From 627f8b03bc42143eb3b49d06622765db1616c21e Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 27 Mar 2024 08:57:16 -0400 Subject: [PATCH] Use ifdef DEBUG instead --- include/deal.II/lac/trilinos_tpetra_vector.templates.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); } -- 2.39.5