GeneralDefine.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
5 #ifndef GENERALDEFINE_H
6 #define GENERALDEFINE_H
7 
8 #include <limits>
9 
10 #ifdef HIGH_PRECISION
11 typedef long double Mdouble;
12 #else
13 typedef double Mdouble;
14 #endif
15 
16 #define MERCURYDPM_DEPRECATED [[deprecated]]
17 
18 #define UNUSED __attribute__ ((__unused__))
19 
20 namespace constants
21 {
22  const Mdouble NaN = std::numeric_limits<Mdouble>::quiet_NaN();
23  const Mdouble inf = std::numeric_limits<Mdouble>::infinity();
26 }
27 
28 //The number of digits are important for MAX_PROC, not the actual number. It is used to determine unique communication tags
29 //IMPORTANT: Always take a value 10^a where a is a natural number above 0
30 #define MAX_PROC 1000
31 
37 #ifdef MERCURYDPM_USE_MPI
38 #define NUMBER_OF_PROCESSORS static_cast<unsigned>(MPIContainer::Instance().getNumberOfProcessors())
39 #define PROCESSOR_ID MPIContainer::Instance().getProcessorID()
40 #else
41 #define NUMBER_OF_PROCESSORS 1
42 #define PROCESSOR_ID 0
43 #endif
44 
45 #ifdef MERCURYDPM_USE_OMP
46 #define OMP_THREAD_NUM omp_get_thread_num()
47 #else
48 #define OMP_THREAD_NUM 0
49 #endif
50 
56 {
57  XAXIS = 0, YAXIS = 1, ZAXIS = 2
58 };
59 
60 
61 #endif
Direction
An enum that indicates the direction in Cartesian coordinates.
Definition: GeneralDefine.h:56
@ YAXIS
Definition: GeneralDefine.h:57
@ XAXIS
Definition: GeneralDefine.h:57
@ ZAXIS
Definition: GeneralDefine.h:57
double Mdouble
Definition: GeneralDefine.h:13
#define max(a, b)
Definition: datatypes.h:23
Definition: GeneralDefine.h:21
const Mdouble NaN
Definition: GeneralDefine.h:22
const unsigned unsignedMax
Definition: GeneralDefine.h:25
const Mdouble inf
Definition: GeneralDefine.h:23
const int intMax
Definition: GeneralDefine.h:24