]> https://gitweb.dealii.org/ - dealii.git/commitdiff
decide between Trilinos and PETSc in step-40 1856/head
authorTimo Heister <timo.heister@gmail.com>
Tue, 10 Nov 2015 13:42:46 +0000 (08:42 -0500)
committerTimo Heister <timo.heister@gmail.com>
Tue, 10 Nov 2015 14:00:20 +0000 (09:00 -0500)
based on a patch sent in by Kevin Drzycimski on the mailing list

examples/step-40/CMakeLists.txt
examples/step-40/step-40.cc

index 7130ef287472cf8353d27c559335603b8420ffe2..d04cc77bac704998c7d417a12d3c4b1bc92e9ad7 100644 (file)
@@ -37,12 +37,15 @@ ENDIF()
 #
 # Are all dependencies fulfilled?
 #
-IF(NOT DEAL_II_WITH_PETSC OR NOT DEAL_II_WITH_P4EST)
+IF(NOT (DEAL_II_WITH_PETSC OR DEAL_II_WITH_TRILINOS) OR NOT DEAL_II_WITH_P4EST)
   MESSAGE(FATAL_ERROR "
 Error! The deal.II library found at ${DEAL_II_PATH} was not configured with
     DEAL_II_WITH_PETSC = ON
     DEAL_II_WITH_P4EST = ON
-One or all of these are OFF in your installation but are required for this tutorial step."
+or
+    DEAL_II_WITH_TRILINOS = ON
+    DEAL_II_WITH_P4EST = ON
+One or both of these combinations are OFF in your installation but at least one is required for this tutorial step."
     )
 ENDIF()
 
index d92c47423a6f2063f2a28b319d0ba2dfcfa4025e..36f39ba0c244d3e12ac85b336dfa9819c72df6d5 100644 (file)
 
 #include <deal.II/lac/generic_linear_algebra.h>
 
-#define USE_PETSC_LA
+// uncomment the following #define if you have PETSc and Trilinos installed
+// and you prefer using Trilinos in this example:
+// #define FORCE_USE_OF_TRILINOS
 
+// This will either import PETSc or TrilinosWrappers into the namespace LA:
 namespace LA
 {
-#ifdef USE_PETSC_LA
+#if defined(DEAL_II_WITH_PETSC) && !(defined(DEAL_II_WITH_TRILINOS) && defined(FORCE_USE_OF_TRILINOS))
   using namespace dealii::LinearAlgebraPETSc;
-#else
+#elif defined(DEAL_II_WITH_TRILINOS)
   using namespace dealii::LinearAlgebraTrilinos;
+#else
+#error DEAL_II_WITH_PETSC or DEAL_II_WITH_TRILINOS required
 #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.