dune-common  2.11
metis.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 // SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4 // SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5 #ifndef DUNE_METIS_HH
6 #define DUNE_METIS_HH
7 
17 #if HAVE_METIS
18 
19 #if HAVE_SCOTCH_METIS
20 extern "C" {
21  #include <scotch.h>
22 }
23 #endif
24 
25 extern "C" {
26  #include <metis.h>
27 }
28 
29 #if HAVE_SCOTCH_METIS && !defined(SCOTCH_METIS_RETURN) && !defined(METIS_OK)
30  // NOTE: scotchmetis does not define a return type for METIS functions
31  #define METIS_OK 1
32 #endif
33 
34 namespace Dune::Metis {
35 
36 #if defined(REALTYPEWIDTH) || defined(SCOTCH_METIS_DATATYPES)
37  using real_t = ::real_t;
38 #else
39  using real_t = double;
40 #endif
41 
42 #if defined(IDXTYPEWIDTH) || defined(SCOTCH_METIS_DATATYPES)
43  using idx_t = ::idx_t;
44 #elif HAVE_SCOTCH_METIS
45  using idx_t = SCOTCH_Num;
46 #else
47  using idx_t = int;
48 #endif
49 
50 } // end namespace Dune::Metis
51 
52 #endif // HAVE_METIS
53 #endif // DUNE_METIS_HH
typename FieldTraits< Type >::real_type real_t
Convenient access to FieldTraits<Type>::real_type.
Definition: typetraits.hh:301