slepc_macro.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_SLEPC_MACRO_H
21 #define LIBMESH_SLEPC_MACRO_H
22 
23 // C++ includes
24 
25 // Local includes
26 
31 #ifdef LIBMESH_HAVE_SLEPC
32 
33 # include <slepcversion.h>
34 
35 // A convenient macro for comparing SLEPc versions.
36 // Returns 1 if the current SLEPc version is < major.minor.subminor
37 // and zero otherwise.
38 #define SLEPC_VERSION_LESS_THAN(major,minor,subminor) \
39  ((SLEPC_VERSION_MAJOR < (major) || \
40  (SLEPC_VERSION_MAJOR == (major) && (SLEPC_VERSION_MINOR < (minor) || \
41  (SLEPC_VERSION_MINOR == (minor) && \
42  SLEPC_VERSION_SUBMINOR < (subminor))))) ? 1 : 0)
43 
44 // Make up for missing extern "C" in old SLEPc versions
45 #if !defined(LIBMESH_USE_COMPLEX_NUMBERS) && SLEPC_VERSION_LESS_THAN(3,0,0)
46 # define EXTERN_C_FOR_SLEPC_BEGIN extern "C" {
47 # define EXTERN_C_FOR_SLEPC_END }
48 #else
49 # define EXTERN_C_FOR_SLEPC_BEGIN
50 # define EXTERN_C_FOR_SLEPC_END
51 #endif
52 
53 #if SLEPC_VERSION_RELEASE && SLEPC_VERSION_LESS_THAN(3,1,1)
54 # define LibMeshEPSDestroy(x) EPSDestroy(*(x))
55 #else
56 # define LibMeshEPSDestroy(x) EPSDestroy(x)
57 #endif
58 
59 #endif // #if LIBMESH_HAVE_SLEPC
60 #endif // LIBMESH_SLEPC_MACRO_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:07 UTC

Hosted By:
SourceForge.net Logo