]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Removed the workaround for TrilinosWrappers::VectorBase::sadd when using different...
authordaniel.arndt <daniel.arndt@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 23 Jun 2014 16:16:57 +0000 (16:16 +0000)
committerdaniel.arndt <daniel.arndt@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 23 Jun 2014 16:16:57 +0000 (16:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@33081 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/modules/FindTRILINOS.cmake
deal.II/include/deal.II/base/config.h.in
deal.II/source/lac/trilinos_vector_base.cc

index 6fc8c408d4db01e6504bc4399b486a9e5357ef63..51b627064ebbd37d911b8403263a5b4cf4b135c9 100644 (file)
@@ -65,9 +65,15 @@ IF(DEFINED Trilinos_VERSION)
     "^[0-9]+\\.([0-9]+).*$" "\\1"
     TRILINOS_VERSION_MINOR "${Trilinos_VERSION}")
 
+  # If there is no subminor number, then the REGEX REPLACE will fail,
+  # setting TRILINOS_VERSION_PATCH to TRILINOS_VERSION. If that
+  # is the case, then set the subminor number to zero
   STRING(REGEX REPLACE
-    "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1"
+    "^[0-9]+\\.[0-9]+\\.([0-9]+)?.*$" "\\1"
     TRILINOS_VERSION_SUBMINOR "${Trilinos_VERSION}")
+  IF(${TRILINOS_VERSION_SUBMINOR} STREQUAL "${Trilinos_VERSION}")
+    SET(TRILINOS_VERSION_SUBMINOR "0")
+  ENDIF()
 ENDIF()
 
 #
index 8f82a02ee3917ed3a3c49df7afda51cbf38372c8..3709ce396a7bcd47c43eac52d24ce114bbca4888 100644 (file)
 #ifdef DEAL_II_WITH_TRILINOS
 /** Compatibility definition (with naming from deal.II < 8.0): */
 #  define DEAL_II_USE_TRILINOS
+
+#  define DEAL_II_TRILINOS_VERSION_MAJOR @TRILINOS_VERSION_MAJOR@
+#  define DEAL_II_TRILINOS_VERSION_MINOR @TRILINOS_VERSION_MINOR@
+#  define DEAL_II_TRILINOS_VERSION_SUBMINOR @TRILINOS_VERSION_SUBMINOR@
+
+#  define DEAL_II_TRILINOS_VERSION_GTE(major,minor,subminor) \
+ ((DEAL_II_TRILINOS_VERSION_MAJOR * 10000 + \
+    DEAL_II_TRILINOS_VERSION_MINOR * 100 + \
+      DEAL_II_TRILINOS_VERSION_SUBMINOR) \
+    >=  \
+    (major)*10000 + (minor)*100 + (subminor))
 #endif
 
 
index da1e491f16d3361264b4aaf534ad09cf5cad3331..aff9959d2031f4f7a78821804af682478d0d72dd 100644 (file)
@@ -295,11 +295,14 @@ namespace TrilinosWrappers
         AssertThrow (size() == v.size(),
                      ExcDimensionMismatch (size(), v.size()));
 
-        //HACK: For some reason the following doesn't work properly, so do it manually
-        //  Epetra_Import data_exchange (vector->Map(), v.vector->Map());
-        //  int ierr = vector->Import(*v.vector, data_exchange, Add);
-        //  AssertThrow (ierr == 0, ExcTrilinosError(ierr));
-        //  last_action = Add;
+#if DEAL_II_TRILINOS_VERSION_GTE(11,9,0)
+         Epetra_Import data_exchange (vector->Map(), v.vector->Map());
+         int ierr = vector->Import(*v.vector, data_exchange, Add);
+         AssertThrow (ierr == 0, ExcTrilinosError(ierr));
+         last_action = Add;
+#else
+        // In versions older than 11.9 the Import function is broken for adding
+        // Hence, we provide a workaround in this case
 
         Epetra_MultiVector dummy(vector->Map(), 1, false);
         Epetra_Import data_exchange (dummy.Map(), v.vector->Map());
@@ -309,6 +312,7 @@ namespace TrilinosWrappers
 
         ierr = vector->Update (1.0, dummy, 1.0);
         AssertThrow (ierr == 0, ExcTrilinosError(ierr));
+#endif
       }
   }
 

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.