Reference documentation for deal.II version 8.4.2
petsc_compatibility.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2016 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 /*
17  * Rather than using ifdefs everywhere, try to wrap older versions of PETSc
18  * functions in one place.
19  */
20 #ifndef dealii__petsc_compatibility_h
21 #define dealii__petsc_compatibility_h
22 
23 #include <deal.II/base/config.h>
24 
25 #ifdef DEAL_II_WITH_PETSC
26 
27 #include <petscconf.h>
28 #include <petscpc.h>
29 
30 #include <string>
31 
32 DEAL_II_NAMESPACE_OPEN
33 
34 namespace PETScWrappers
35 {
41  inline void set_option_value (const std::string &name,
42  const std::string &value)
43  {
44 #if DEAL_II_PETSC_VERSION_LT(3, 7, 0)
45  PetscOptionsSetValue (name.c_str (), value.c_str ());
46 #else
47  PetscOptionsSetValue (NULL, name.c_str (), value.c_str ());
48 #endif
49  }
50 }
51 
52 DEAL_II_NAMESPACE_CLOSE
53 
54 #endif // DEAL_II_WITH_PETSC
55 #endif // dealii__petsc_compatibility_h
void set_option_value(const std::string &name, const std::string &value)