OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
common.hpp
1 /*
2  * common.hpp
3  *
4  * Created on: Oct 11, 2015
5  * Author: i-bird
6  */
7 
8 #ifndef OPENFPM_NUMERICS_SRC_UTIL_COMMON_HPP_
9 #define OPENFPM_NUMERICS_SRC_UTIL_COMMON_HPP_
10 
11 #define STAGGERED_GRID 1
12 #define NORMAL_GRID 0
13 
14 template<typename T, typename Sfinae = void>
15 struct has_grid_type: std::false_type {};
16 
17 
26 template<typename T>
27 struct has_grid_type<T, typename Void<decltype( T::grid_type )>::type> : std::true_type
28 {};
29 
41 template<typename T, bool has_gt = has_grid_type<T>::type::value >
43 {
52  static bool value()
53  {
54  return T::grid_type == STAGGERED_GRID;
55  };
56 };
57 
68 template<typename T>
69 struct is_grid_staggered<T,false>
70 {
71 
80  static bool value()
81  {
82  return false;
83  };
84 };
85 
86 #endif /* OPENFPM_NUMERICS_SRC_UTIL_COMMON_HPP_ */
This is a distributed grid.
static bool value()
Return true if the grid is staggered.
Definition: common.hpp:52
is_grid_staggered analyse T if it has a property grid_type defined and indicate that the grid is stag...
Definition: common.hpp:42
Void structure.
Definition: common.hpp:63
static bool value()
Return true if the grid is staggered.
Definition: common.hpp:80