OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
OdeIntegrators.hpp
1 //
2 // Created by Abhinav Singh on 01.12.20.
3 // in Development
4 
5 #ifndef OPENFPM_NUMERICS_ODEINTEGRATORS_HPP
6 #define OPENFPM_NUMERICS_ODEINTEGRATORS_HPP
7 
8 
9 //namespace std{
10 // double abs(pair_ref<double,double> tmp);
11 // double abs(const_pair_ref<double,double> tmp);
12 //}
13 
14 template<typename T, typename Sfinae = void>
15 struct has_state_vector: std::false_type {};
16 template<typename T>
17 struct has_state_vector<T, typename Void< typename T::is_state_vector>::type> : std::true_type
18 {};
19 namespace boost{
20  template<class T,class Enabler=typename std::enable_if<has_state_vector<T>::value>::type>
21  inline size_t
22  size(const T& rng)
23  {
24  return rng.size();
25  }
26 }
27 
28 #include <boost/numeric/odeint.hpp>
29 #include "Operators/Vector/vector_dist_operators.hpp"
30 #include "OdeIntegrators/boost_vector_algebra_ofp.hpp"
31 
32 namespace boost { namespace numeric { namespace odeint {
33 
34  template<typename T>
35  struct is_resizeable< vector_dist_expression<0,openfpm::vector<aggregate<T>> > >
36  {
37  typedef boost::true_type type;
38  static const bool value = type::value;
39  };
40 
41  } } }
42 
52  }
53  typedef size_t size_type;
54  typedef int is_state_vector;
56 
57  size_t size() const
58  { return data.get<0>().size(); }
59 
60  void resize(size_t n)
61  {
62  data.get<0>().resize(n);
63  }
64 };
65 
75  }
76  typedef size_t size_type;
77  typedef int is_state_vector;
79 
80  size_t size() const
81  { return data.get<0>().size(); }
82 
83  void resize(size_t n)
84  {
85  data.get<0>().resize(n);
86  data.get<1>().resize(n);
87  }
88 };
89 
99  }
100  typedef size_t size_type;
101  typedef int is_state_vector;
103 
104  size_t size() const
105  { return data.get<0>().size(); }
106 
107  void resize(size_t n)
108  {
109  data.get<0>().resize(n);
110  data.get<1>().resize(n);
111  data.get<2>().resize(n);
112  }
113 };
114 
124  }
125  typedef size_t size_type;
126  typedef int is_state_vector;
128 
129  size_t size() const
130  { return data.get<0>().size(); }
131 
132  void resize(size_t n)
133  {
134  data.get<0>().resize(n);
135  data.get<1>().resize(n);
136  data.get<2>().resize(n);
137  data.get<3>().resize(n);
138  }
139 };
140 
150  }
151  typedef size_t size_type;
152  typedef int is_state_vector;
154 
155  size_t size() const
156  { return data.get<0>().size(); }
157 
158  void resize(size_t n)
159  {
160  data.get<0>().resize(n);
161  data.get<1>().resize(n);
162  data.get<2>().resize(n);
163  data.get<3>().resize(n);
164  data.get<4>().resize(n);
165 
166  }
167 };
168 
169 namespace boost {
170  namespace numeric {
171  namespace odeint {
172  template<>
173  struct is_resizeable<state_type_1d_ofp> {
174  typedef boost::true_type type;
175  static const bool value = type::value;
176  };
177 
178  template<>
179  struct is_resizeable<state_type_2d_ofp> {
180  typedef boost::true_type type;
181  static const bool value = type::value;
182  };
183 
184  template<>
185  struct is_resizeable<state_type_3d_ofp> {
186  typedef boost::true_type type;
187  static const bool value = type::value;
188  };
189  template<>
190  struct is_resizeable<state_type_4d_ofp> {
191  typedef boost::true_type type;
192  static const bool value = type::value;
193  };
194  template<>
195  struct is_resizeable<state_type_5d_ofp> {
196  typedef boost::true_type type;
197  static const bool value = type::value;
198  };
199 
200 
201 
202  template<>
203  struct vector_space_norm_inf<state_type_1d_ofp>
204  {
205  typedef double result_type;
206  };
207 
208  template<>
209  struct vector_space_norm_inf<state_type_2d_ofp>
210  {
211  typedef double result_type;
212  };
213 
214  template<>
215  struct vector_space_norm_inf<state_type_3d_ofp>
216  {
217  typedef double result_type;
218  };
219 
220  template<>
221  struct vector_space_norm_inf<state_type_4d_ofp>
222  {
223  typedef double result_type;
224  };
225 
226  template<>
227  struct vector_space_norm_inf<state_type_5d_ofp>
228  {
229  typedef double result_type;
230  };
231 
232  }
233  }
234 }
235 
236 
237 
238 #endif //OPENFPM_NUMERICS_ODEINTEGRATORS_HPP
convert a type into constant type
Definition: aggregate.hpp:292
__device__ __host__ boost::mpl::at< type, boost::mpl::int_< i > >::type & get()
get the properties i
Definition: aggregate.hpp:240
A 3d Odeint and Openfpm compatible structure.
A 2d Odeint and Openfpm compatible structure.
Main class that encapsulate a vector properties operand to be used for expressions construction.
Void structure.
Definition: common.hpp:73
A 5d Odeint and Openfpm compatible structure.
Main class that encapsulate a vector properties operand to be used for expressions construction Tempo...
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...
Definition: aggregate.hpp:214
A 1d Odeint and Openfpm compatible structure.
A 4d Odeint and Openfpm compatible structure.