]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix compiler warning for macro usage in TpetraWrappers
authorDaniel Arndt <arndtd@ornl.gov>
Mon, 25 Mar 2024 17:46:50 +0000 (13:46 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Mon, 25 Mar 2024 17:47:39 +0000 (13:47 -0400)
include/deal.II/lac/trilinos_tpetra_vector.templates.h

index 2da046ba3d04a166367ce83db71e83ca88eafab7..70ded3bbdfe23b4a19c40af366ffb3d489cec85d 100644 (file)
@@ -1032,12 +1032,14 @@ namespace LinearAlgebra
       const size_type begin = vector->getMap()->getMinGlobalIndex();
       const size_type end   = vector->getMap()->getMaxGlobalIndex() + 1;
 
-      Assert(
+      [[maybe_unused]] const size_type n_local_elements =
 #  if DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
-        end - begin == vector->getMap()->getLocalNumElements(),
+        vector->getMap()->getLocalNumElements();
 #  else
-        end - begin == vector->getMap()->getNodeNumElements(),
+        vector->getMap()->getNodeNumElements();
 #  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. "

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.