From: Timo Heister Date: Tue, 10 Nov 2015 13:42:46 +0000 (-0500) Subject: decide between Trilinos and PETSc in step-40 X-Git-Tag: v8.4.0-rc2~235^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=308329563853f1d9d183d029fc6a27487d3df00c;p=dealii.git decide between Trilinos and PETSc in step-40 based on a patch sent in by Kevin Drzycimski on the mailing list --- 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 }