]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use ifdef DEBUG instead 16784/head
authorDaniel Arndt <arndtd@ornl.gov>
Wed, 27 Mar 2024 12:57:16 +0000 (08:57 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Wed, 27 Mar 2024 12:57:16 +0000 (08:57 -0400)
include/deal.II/lac/trilinos_tpetra_vector.templates.h

index 70ded3bbdfe23b4a19c40af366ffb3d489cec85d..c28a18481c4ecefdbc42062508723da4e7a2964e 100644 (file)
@@ -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);
     }

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.