OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
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 #include "util/common.hpp"
15 
16 template<typename T, typename Sfinae = void>
17 struct has_grid_type: std::false_type {};
18 
19 
28 template<typename T>
29 struct has_grid_type<T, typename Void<decltype( T::grid_type )>::type> : std::true_type
30 {};
31 
43 template<typename T, bool has_gt = has_grid_type<T>::type::value >
45 {
54  static bool value()
55  {
56  return T::grid_type == STAGGERED_GRID;
57  };
58 };
59 
70 template<typename T>
71 struct is_grid_staggered<T,false>
72 {
73 
82  static bool value()
83  {
84  return false;
85  };
86 };
87 
88 #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:54
is_grid_staggered analyse T if it has a property grid_type defined and indicate that the grid is stag...
Definition: common.hpp:44
Void structure.
Definition: common.hpp:73
static bool value()
Return true if the grid is staggered.
Definition: common.hpp:82