]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix crash in petsc step-40 2111/head
authorTimo Heister <timo.heister@gmail.com>
Sun, 24 Jan 2016 17:05:13 +0000 (18:05 +0100)
committerTimo Heister <timo.heister@gmail.com>
Sun, 24 Jan 2016 19:06:15 +0000 (20:06 +0100)
fix:

An error occurred in line <96> of file </ssd/deal-
git/source/lac/petsc_solver.cc> in function
    void dealii::PETScWrappers::SolverBase::solve(const
dealii::PETScWrappers::MatrixBase&, dealii::PETScWrappers::VectorBase&,
const dealii::PETScWrappers::VectorBase&, const
dealii::PETScWrappers::PreconditionerBase&)
The violated condition was:
    ierr == 0
The name and call sequence of the exception was:
    ExcPETScError(ierr)
Additional Information:
An error with error number 80 occurred while calling a PETSc function

examples/step-40/step-40.cc

index 52b02b2bd48026a133a13c4d53c0be21c805f1b9..3181164a2a5a097685225baf269ee38d37c9e3b4 100644 (file)
 // and you prefer using Trilinos in this example:
 // #define FORCE_USE_OF_TRILINOS
 
-// This will either import PETSc or TrilinosWrappers into the namespace LA:
+// This will either import PETSc or TrilinosWrappers into the namespace
+// LA. Note that we are defining the macro USE_PETSC_LA so that we can detect
+// if we are using PETSc (see solve() for an example where this is necessary)
 namespace LA
 {
 #if defined(DEAL_II_WITH_PETSC) && !(defined(DEAL_II_WITH_TRILINOS) && defined(FORCE_USE_OF_TRILINOS))
   using namespace dealii::LinearAlgebraPETSc;
+#  define USE_PETSC_LA
 #elif defined(DEAL_II_WITH_TRILINOS)
   using namespace dealii::LinearAlgebraTrilinos;
 #else
-#error DEAL_II_WITH_PETSC or DEAL_II_WITH_TRILINOS required
+#  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.