From 308329563853f1d9d183d029fc6a27487d3df00c Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 10 Nov 2015 08:42:46 -0500 Subject: [PATCH] decide between Trilinos and PETSc in step-40 based on a patch sent in by Kevin Drzycimski on the mailing list --- examples/step-40/CMakeLists.txt | 7 +++++-- examples/step-40/step-40.cc | 11 ++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/examples/step-40/CMakeLists.txt b/examples/step-40/CMakeLists.txt index 7130ef2874..d04cc77bac 100644 --- a/examples/step-40/CMakeLists.txt +++ b/examples/step-40/CMakeLists.txt @@ -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() diff --git a/examples/step-40/step-40.cc b/examples/step-40/step-40.cc index d92c47423a..36f39ba0c2 100644 --- a/examples/step-40/step-40.cc +++ b/examples/step-40/step-40.cc @@ -30,14 +30,19 @@ #include -#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 } -- 2.39.5