OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
interpolation_unit_tests.hpp
1 /*
2  * interpolation_unit_tests.hpp
3  *
4  * Created on: May 5, 2017
5  * Author: i-bird
6  */
7 
8 #ifndef OPENFPM_NUMERICS_SRC_INTERPOLATION_INTERPOLATION_UNIT_TESTS_HPP_
9 #define OPENFPM_NUMERICS_SRC_INTERPOLATION_INTERPOLATION_UNIT_TESTS_HPP_
10 
11 #include "interpolation/mp4_kernel.hpp"
12 #include "interpolation/z_spline.hpp"
13 #include "interpolation.hpp"
14 
15 BOOST_AUTO_TEST_SUITE( interpolation_test )
16 
17 template<typename grid, unsigned int mom_p> void momenta_grid(grid & gd,typename grid::stype (& mom_tot)[grid::dims])
18 {
19  auto it = gd.getDomainGhostIterator();
20 
21  for (size_t i = 0 ; i < grid::dims ; i++)
22  mom_tot[i] = 0.0;
23 
24  while (it.isNext())
25  {
26  auto key = it.get();
27  auto key_g = gd.getGKey(key);
28 
29  for (size_t i = 0 ; i < grid::dims ; i++)
30  {
31  typename grid::stype coord = gd.spacing(i)*key_g.get(i);
32 
33  mom_tot[i] += boost::math::pow<mom_p>(coord)*gd.template getProp<0>(key);
34  }
35 
36  ++it;
37  }
38 }
39 
40 template<typename grid, unsigned int mom_p> void momenta_grid_domain(grid & gd,typename grid::stype (& mom_tot)[grid::dims])
41 {
42  auto it = gd.getDomainIterator();
43 
44  for (size_t i = 0 ; i < grid::dims ; i++)
45  mom_tot[i] = 0.0;
46 
47  while (it.isNext())
48  {
49  auto key = it.get();
50  auto key_g = gd.getGKey(key);
51 
52  for (size_t i = 0 ; i < grid::dims ; i++)
53  {
54  typename grid::stype coord = gd.spacing(i)*key_g.get(i);
55 
56  mom_tot[i] += boost::math::pow<mom_p>(coord)*gd.template getProp<0>(key);
57  }
58 
59  ++it;
60  }
61 }
62 
63 template<typename vector, unsigned int mom_p> void momenta_vector(vector & vd,typename vector::stype (& mom_tot)[vector::dims])
64 {
65  auto it = vd.getDomainIterator();
66 
67  for (size_t i = 0 ; i < vector::dims ; i++)
68  mom_tot[i] = 0.0;
69 
70  while (it.isNext())
71  {
72  auto key = it.get();
73 
74  for (size_t i = 0 ; i < vector::dims ; i++)
75  {
76  typename vector::stype coord = vd.getPos(key)[i];
77 
78  mom_tot[i] += boost::math::pow<mom_p>(coord)*vd.template getProp<0>(key);
79  }
80 
81  ++it;
82  }
83 }
84 
85 template<unsigned int dim, typename T, typename grid, typename vector>
86 void interp_test(grid & gd, vector & vd, bool single_particle)
87 {
88  // Reset the grid
89 
90  auto it2 = gd.getDomainGhostIterator();
91 
92  while (it2.isNext())
93  {
94  auto key = it2.get();
95 
96  gd.template get<0>(key) = 0.0;
97 
98  ++it2;
99  }
100 
102 
103  if (single_particle == false)
104  {inte.template p2m<0,0>(vd,gd);}
105  else
106  {
107  auto it = vd.getDomainIterator();
108 
109  while (it.isNext())
110  {
111  auto p = it.get();
112 
113  inte.template p2m<0,0>(vd,gd,p);
114 
115  ++it;
116  }
117  }
118 
119  T mg[dim];
120  T mv[dim];
121 
122  momenta_grid<grid,0>(gd,mg);
123  momenta_vector<vector,0>(vd,mv);
124 
125  for (size_t i = 0 ; i < dim ; i++)
126  {BOOST_REQUIRE_CLOSE(mg[i],mv[i],0.001);}
127 
128  momenta_grid<grid,1>(gd,mg);
129  momenta_vector<vector,1>(vd,mv);
130 
131  for (size_t i = 0 ; i < dim ; i++)
132  {BOOST_REQUIRE_CLOSE(mg[i],mv[i],0.001);}
133 
134  momenta_grid<grid,2>(gd,mg);
135  momenta_vector<vector,2>(vd,mv);
136 
137  for (size_t i = 0 ; i < dim ; i++)
138  {BOOST_REQUIRE_CLOSE(mg[i],mv[i],0.001);}
139 }
140 
141 BOOST_AUTO_TEST_CASE( interpolation_full_single_test_2D )
142 {
143  Box<2,float> domain({0.0,0.0},{1.0,1.0});
144  size_t sz[2] = {64,64};
145 
146  Ghost<2,long int> gg(2);
147  Ghost<2,float> gv(0.01);
148 
149  size_t bc_v[2] = {PERIODIC,PERIODIC};
150 
151  vector_dist<2,float,aggregate<float>> vd(65536,domain,bc_v,gv);
152  grid_dist_id<2,float,aggregate<float>> gd(vd.getDecomposition(),sz,gg);
153 
154  // set one particle on vd
155 
156  auto it = vd.getDomainIterator();
157 
158  while (it.isNext())
159  {
160  auto p = it.get();
161 
162  vd.getPos(p)[0] = (double)rand()/RAND_MAX;
163  vd.getPos(p)[1] = (double)rand()/RAND_MAX;
164 
165  vd.getProp<0>(p) = 5.0;
166 
167  ++it;
168  }
169 
170  vd.map();
171 
172  interp_test<2,float>(gd,vd,true);
173 }
174 
175 
176 BOOST_AUTO_TEST_CASE( interpolation_full_test_2D )
177 {
178  Box<2,float> domain({0.0,0.0},{1.0,1.0});
179  size_t sz[2] = {64,64};
180 
181  Ghost<2,long int> gg(2);
182  Ghost<2,float> gv(0.01);
183 
184  size_t bc_v[2] = {PERIODIC,PERIODIC};
185 
186  {
187  vector_dist<2,float,aggregate<float>> vd(4096,domain,bc_v,gv);
188  grid_dist_id<2,float,aggregate<float>> gd(vd.getDecomposition(),sz,gg);
189 
190  // set one particle on vd
191 
192  auto it = vd.getDomainIterator();
193 
194  while (it.isNext())
195  {
196  auto p = it.get();
197 
198  vd.getPos(p)[0] = (double)rand()/RAND_MAX;
199  vd.getPos(p)[1] = (double)rand()/RAND_MAX;
200 
201  vd.getProp<0>(p) = 5.0;
202 
203  ++it;
204  }
205 
206  vd.map();
207 
208  // Reset the grid
209  interp_test<2,float>(gd,vd,false);
210 
211  float mg[2];
212  float mv[2];
213 
214  auto & v_cl = create_vcluster();
215 
217 
218  // We have to do a ghost get before interpolating m2p
219  // Before doing mesh to particle particle must be arranged
220  // into a grid like
221 
222  vd.clear();
223 
224  auto it4 = vd.getGridIterator(sz);
225 
226  while(it4.isNext())
227  {
228  auto key = it4.get();
229 
230  vd.add();
231 
232  vd.getLastPos()[0] = key.get(0) * it4.getSpacing(0) + domain.getLow(0) + 0.1*it4.getSpacing(0);
233  vd.getLastPos()[1] = key.get(1) * it4.getSpacing(1) + domain.getLow(1) + 0.1*it4.getSpacing(1);
234 
235  vd.getLastProp<0>() = 0.0;
236 
237  ++it4;
238  }
239 
240  // Reset also the grid
241 
242  auto it5 = gd.getDomainGhostIterator();
243 
244  while(it5.isNext())
245  {
246  auto key = it5.get();
247 
248  gd.get<0>(key) = 0.0;
249 
250  ++it5;
251  }
252  gd.ghost_get<0>();
253 
254  grid_key_dx<2> start({3,3});
255  grid_key_dx<2> stop({(long int)gd.size(0) - 4,(long int)gd.size(1) - 4});
256 
257  auto it6 = gd.getSubDomainIterator(start,stop);
258  while(it6.isNext())
259  {
260  auto key = it6.get();
261 
262  gd.get<0>(key) = 5.0/*(double)rand()/RAND_MAX;*/;
263 
264  ++it6;
265  }
266  gd.ghost_get<0>();
267 
268  vd.map();
269  gd.ghost_get<0>();
270  inte.m2p<0,0>(gd,vd);
271 
272  momenta_grid_domain<decltype(gd),0>(gd,mg);
273  momenta_vector<decltype(vd),0>(vd,mv);
274 
275  v_cl.sum(mg[0]);
276  v_cl.sum(mg[1]);
277  v_cl.sum(mv[0]);
278  v_cl.sum(mv[1]);
279  v_cl.execute();
280 
281  BOOST_REQUIRE_CLOSE(mg[0],mv[0],0.001);
282  BOOST_REQUIRE_CLOSE(mg[1],mv[1],0.001);
283 
284  momenta_grid_domain<decltype(gd),1>(gd,mg);
285  momenta_vector<decltype(vd),1>(vd,mv);
286 
287  v_cl.sum(mg[0]);
288  v_cl.sum(mg[1]);
289  v_cl.sum(mv[0]);
290  v_cl.sum(mv[1]);
291  v_cl.execute();
292 
293  BOOST_REQUIRE_CLOSE(mg[0],mv[0],0.001);
294  BOOST_REQUIRE_CLOSE(mg[1],mv[1],0.001);
295 
296  momenta_grid_domain<decltype(gd),2>(gd,mg);
297  momenta_vector<decltype(vd),2>(vd,mv);
298 
299  v_cl.sum(mg[0]);
300  v_cl.sum(mg[1]);
301  v_cl.sum(mv[0]);
302  v_cl.sum(mv[1]);
303  v_cl.execute();
304 
305  BOOST_REQUIRE_CLOSE(mg[0],mv[0],0.001);
306  BOOST_REQUIRE_CLOSE(mg[1],mv[1],0.001);
307 
308  }
309 }
310 
311 BOOST_AUTO_TEST_CASE( interpolation_full_single_test_3D )
312 {
313  Box<3,double> domain({0.0,0.0,0.0},{1.0,1.0,1.0});
314  size_t sz[3] = {64,64,64};
315 
316  Ghost<3,long int> gg(2);
317  Ghost<3,double> gv(0.01);
318 
319  size_t bc_v[3] = {PERIODIC,PERIODIC,PERIODIC};
320 
321  vector_dist<3,double,aggregate<double>> vd(65536,domain,bc_v,gv);
322  grid_dist_id<3,double,aggregate<double>> gd(vd.getDecomposition(),sz,gg);
323 
324  // set one particle on vd
325 
326  auto it = vd.getDomainIterator();
327 
328  while (it.isNext())
329  {
330  auto p = it.get();
331 
332  vd.getPos(p)[0] = (double)rand()/RAND_MAX;
333  vd.getPos(p)[1] = (double)rand()/RAND_MAX;
334  vd.getPos(p)[2] = (double)rand()/RAND_MAX;
335 
336  vd.getProp<0>(p) = 5.0;
337 
338  ++it;
339  }
340 
341  vd.map();
342 
343  // Reset the grid
344  interp_test<3,double>(gd,vd,true);
345 }
346 
347 BOOST_AUTO_TEST_CASE( interpolation_full_test_3D )
348 {
349  Box<3,double> domain({0.0,0.0,0.0},{1.0,1.0,1.0});
350  size_t sz[3] = {64,64,64};
351 
352  Ghost<3,long int> gg(2);
353  Ghost<3,double> gv(0.01);
354 
355  size_t bc_v[3] = {PERIODIC,PERIODIC,PERIODIC};
356 
357  {
358  vector_dist<3,double,aggregate<double>> vd(65536,domain,bc_v,gv);
359  grid_dist_id<3,double,aggregate<double>> gd(vd.getDecomposition(),sz,gg);
360 
361  // set one particle on vd
362 
363  auto it = vd.getDomainIterator();
364 
365  while (it.isNext())
366  {
367  auto p = it.get();
368 
369  vd.getPos(p)[0] = (double)rand()/RAND_MAX;
370  vd.getPos(p)[1] = (double)rand()/RAND_MAX;
371  vd.getPos(p)[2] = (double)rand()/RAND_MAX;
372 
373  vd.getProp<0>(p) = 5.0;
374 
375  ++it;
376  }
377 
378  vd.map();
379 
380  // Reset the grid
381 
382  // Reset the grid
383  interp_test<3,double>(gd,vd,false);
384 
385  auto & v_cl = create_vcluster();
386  double mg[3];
387  double mv[3];
389 
390  // We have to do a ghost get before interpolating m2p
391  // Before doing mesh to particle particle must be arranged
392  // into a grid like
393 
394  vd.clear();
395 
396  auto it4 = vd.getGridIterator(sz);
397 
398  while(it4.isNext())
399  {
400  auto key = it4.get();
401 
402  vd.add();
403 
404  vd.getLastPos()[0] = key.get(0) * it4.getSpacing(0) + domain.getLow(0) + 0.1*it4.getSpacing(0);
405  vd.getLastPos()[1] = key.get(1) * it4.getSpacing(1) + domain.getLow(1) + 0.1*it4.getSpacing(1);
406  vd.getLastPos()[2] = key.get(2) * it4.getSpacing(2) + domain.getLow(2) + 0.1*it4.getSpacing(2);
407 
408  vd.getLastProp<0>() = 0.0;
409 
410  ++it4;
411  }
412 
413  // Reset also the grid
414 
415  auto it5 = gd.getDomainGhostIterator();
416 
417  while(it5.isNext())
418  {
419  auto key = it5.get();
420 
421  gd.get<0>(key) = 0.0;
422 
423  ++it5;
424  }
425  gd.ghost_get<0>();
426 
427  grid_key_dx<3> start({3,3,3});
428  grid_key_dx<3> stop({(long int)gd.size(0) - 4,(long int)gd.size(1) - 4,(long int)gd.size(2) - 4});
429 
430  auto it6 = gd.getSubDomainIterator(start,stop);
431  while(it6.isNext())
432  {
433  auto key = it6.get();
434 
435  gd.get<0>(key) = 5.0;
436 
437  ++it6;
438  }
439  gd.ghost_get<0>();
440 
441  vd.map();
442  gd.ghost_get<0>();
443  inte.m2p<0,0>(gd,vd);
444 
445  momenta_grid_domain<decltype(gd),0>(gd,mg);
446  momenta_vector<decltype(vd),0>(vd,mv);
447 
448  v_cl.sum(mg[0]);
449  v_cl.sum(mg[1]);
450  v_cl.sum(mg[2]);
451  v_cl.sum(mv[0]);
452  v_cl.sum(mv[1]);
453  v_cl.sum(mv[2]);
454  v_cl.execute();
455 
456  BOOST_REQUIRE_CLOSE(mg[0],mv[0],0.001);
457  BOOST_REQUIRE_CLOSE(mg[1],mv[1],0.001);
458  BOOST_REQUIRE_CLOSE(mg[2],mv[2],0.001);
459 
460  momenta_grid_domain<decltype(gd),1>(gd,mg);
461  momenta_vector<decltype(vd),1>(vd,mv);
462 
463  v_cl.sum(mg[0]);
464  v_cl.sum(mg[1]);
465  v_cl.sum(mg[2]);
466  v_cl.sum(mv[0]);
467  v_cl.sum(mv[1]);
468  v_cl.sum(mv[2]);
469  v_cl.execute();
470 
471  BOOST_REQUIRE_CLOSE(mg[0],mv[0],0.001);
472  BOOST_REQUIRE_CLOSE(mg[1],mv[1],0.001);
473  BOOST_REQUIRE_CLOSE(mg[2],mv[2],0.001);
474 
475  momenta_grid_domain<decltype(gd),2>(gd,mg);
476  momenta_vector<decltype(vd),2>(vd,mv);
477 
478  v_cl.sum(mg[0]);
479  v_cl.sum(mg[1]);
480  v_cl.sum(mg[2]);
481  v_cl.sum(mv[0]);
482  v_cl.sum(mv[1]);
483  v_cl.sum(mv[2]);
484  v_cl.execute();
485 
486  BOOST_REQUIRE_CLOSE(mg[0],mv[0],0.001);
487  BOOST_REQUIRE_CLOSE(mg[1],mv[1],0.001);
488  BOOST_REQUIRE_CLOSE(mg[2],mv[2],0.001);
489 
490  }
491 }
492 
493 BOOST_AUTO_TEST_CASE( int_kernel_test )
494 {
495  mp4_kernel<float> mp4;
496 
497  float tot = 0.0;
498 
499  // Check momenta 0
500 
501  tot += mp4.value(-1.3f,0);
502  tot += mp4.value(-0.3f,1);
503  tot += mp4.value(0.7f,2);
504  tot += mp4.value(1.7f,3);
505 
506  BOOST_REQUIRE_CLOSE(tot,1.0f,0.001);
507 
508  // Check momenta 1
509 
510  tot = 0.0;
511 
512  tot += -1.3f*mp4.value(-1.3f,0);
513  tot += -0.3f*mp4.value(-0.3f,1);
514  tot += 0.7f*mp4.value(0.7f,2);
515  tot += 1.7f*mp4.value(1.7f,3);
516 
517  BOOST_REQUIRE_SMALL(tot,0.001f);
518 
519  // Check momenta 2
520 
521  tot = 0.0;
522 
523  tot += (1.3f)*(1.3f)*mp4.value(-1.3f,0);
524  tot += (0.3f)*(0.3f)*mp4.value(-0.3f,1);
525  tot += (0.7f)*(0.7f)*mp4.value(0.7f,2);
526  tot += (1.7f)*(1.7f)*mp4.value(1.7f,3);
527 
528  BOOST_REQUIRE_SMALL(tot,0.001f);
529 
530 
532 
533  tot = 0.0;
534 
535  z_kernel<float,1> zk1;
536 
537  tot += zk1.value(-0.3f,0);
538  tot += zk1.value(0.7f,1);
539 
540  BOOST_REQUIRE_CLOSE(tot,1.0f,0.001);
541 
543 
545 
546  z_kernel<float,3> zk3;
547 
548  tot = 0.0;
549 
550  // Check momenta 0
551 
552  tot += zk3.value(-2.3f,0);
553  tot += zk3.value(-1.3f,1);
554  tot += zk3.value(-0.3f,2);
555  tot += zk3.value(0.7f,3);
556  tot += zk3.value(1.7f,4);
557  tot += zk3.value(2.7f,5);
558 
559  BOOST_REQUIRE_CLOSE(tot,1.0f,0.001);
560 
561  // Check momenta 1
562 
563  tot = 0.0;
564 
565  tot += -2.3*zk3.value(-2.3f,0);
566  tot += -1.3*zk3.value(-1.3f,1);
567  tot += -0.3*zk3.value(-0.3f,2);
568  tot += 0.7*zk3.value(0.7f,3);
569  tot += 1.7*zk3.value(1.7f,4);
570  tot += 2.7*zk3.value(2.7f,5);
571 
572  BOOST_REQUIRE_SMALL(tot,0.001f);
573 
574  // Check momenta 2
575 
576  tot = 0.0;
577 
578  tot += 2.3*2.3*zk3.value(-2.3f,0);
579  tot += 1.3*1.3*zk3.value(-1.3f,1);
580  tot += 0.3*0.3*zk3.value(-0.3f,2);
581  tot += 0.7*0.7*zk3.value(0.7f,3);
582  tot += 1.7*1.7*zk3.value(1.7f,4);
583  tot += 2.7*2.7*zk3.value(2.7f,5);
584 
585  BOOST_REQUIRE_SMALL(tot,0.001f);
586 
587  // Check momenta 3
588 
589  tot = 0.0;
590 
591  tot += -2.3*-2.3*-2.3*zk3.value(-2.3f,0);
592  tot += -1.3*-1.3*-1.3*zk3.value(-1.3f,1);
593  tot += -0.3*-0.3*-0.3*zk3.value(-0.3f,2);
594  tot += 0.7*0.7*0.7*zk3.value(0.7f,3);
595  tot += 1.7*1.7*1.7*zk3.value(1.7f,4);
596  tot += 2.7*2.7*2.7*zk3.value(2.7f,5);
597 
598  BOOST_REQUIRE_SMALL(tot,0.001f);
599 
600 
601  // z4
602 
603  z_kernel<float,4> zk4;
604 
605  // Check momenta 0
606 
607  tot = 0.0;
608 
609  tot += zk4.value(-3.3f,0);
610  tot += zk4.value(-2.3f,1);
611  tot += zk4.value(-1.3f,2);
612  tot += zk4.value(-0.3f,3);
613  tot += zk4.value(0.7f,4);
614  tot += zk4.value(1.7f,5);
615  tot += zk4.value(2.7f,6);
616  tot += zk4.value(3.7f,7);
617 
618  BOOST_REQUIRE_CLOSE(tot,1.0f,0.001);
619 
620  // Check momenta 1
621 
622  tot = 0.0;
623 
624  tot += -3.3*zk4.value(-3.3f,0);
625  tot += -2.3*zk4.value(-2.3f,1);
626  tot += -1.3*zk4.value(-1.3f,2);
627  tot += -0.3*zk4.value(-0.3f,3);
628  tot += 0.7*zk4.value(0.7f,4);
629  tot += 1.7*zk4.value(1.7f,5);
630  tot += 2.7*zk4.value(2.7f,6);
631  tot += 3.7*zk4.value(3.7f,7);
632 
633  BOOST_REQUIRE_SMALL(tot,0.001f);
634 
635  // Check momenta 2
636 
637  tot = 0.0;
638 
639  tot += 3.3*3.3*zk4.value(-3.3f,0);
640  tot += 2.3*2.3*zk4.value(-2.3f,1);
641  tot += 1.3*1.3*zk4.value(-1.3f,2);
642  tot += 0.3*0.3*zk4.value(-0.3f,3);
643  tot += 0.7*0.7*zk4.value(0.7f,4);
644  tot += 1.7*1.7*zk4.value(1.7f,5);
645  tot += 2.7*2.7*zk4.value(2.7f,6);
646  tot += 3.7*3.7*zk4.value(3.7f,7);
647 
648  BOOST_REQUIRE_SMALL(tot,0.001f);
649 
650  // Check momenta 3
651 
652  tot = 0.0;
653 
654  tot += -3.3*-3.3*-3.3*zk4.value(-3.3f,0);
655  tot += -2.3*-2.3*-2.3*zk4.value(-2.3f,1);
656  tot += -1.3*-1.3*-1.3*zk4.value(-1.3f,2);
657  tot += -0.3*-0.3*-0.3*zk4.value(-0.3f,3);
658  tot += 0.7*0.7*0.7*zk4.value(0.7f,4);
659  tot += 1.7*1.7*1.7*zk4.value(1.7f,5);
660  tot += 2.7*2.7*2.7*zk4.value(2.7f,6);
661  tot += 3.7*3.7*3.7*zk4.value(3.7f,7);
662 
663  BOOST_REQUIRE_SMALL(tot,0.001f);
664 
665  // Check momenta 4
666 
667  tot = 0.0;
668 
669  tot += -3.3*-3.3*-3.3*-3.3*zk4.value(-3.3f,0);
670  tot += -2.3*-2.3*-2.3*-2.3*zk4.value(-2.3f,1);
671  tot += -1.3*-1.3*-1.3*-1.3*zk4.value(-1.3f,2);
672  tot += -0.3*-0.3*-0.3*-0.3*zk4.value(-0.3f,3);
673  tot += 0.7*0.7*0.7*0.7*zk4.value(0.7f,4);
674  tot += 1.7*1.7*1.7*1.7*zk4.value(1.7f,5);
675  tot += 2.7*2.7*2.7*2.7*zk4.value(2.7f,6);
676  tot += 3.7*3.7*3.7*3.7*zk4.value(3.7f,7);
677 
678  BOOST_REQUIRE_SMALL(tot,0.001f);
679 }
680 
681 BOOST_AUTO_TEST_SUITE_END()
682 
683 
684 #endif /* OPENFPM_NUMERICS_SRC_INTERPOLATION_INTERPOLATION_UNIT_TESTS_HPP_ */
auto get(const grid_dist_key_dx< dim > &v1) const -> typename std::add_lvalue_reference< decltype(loc_grid.get(v1.getSub()).template get< p >(v1.getKey()))>::type
Get the reference of the selected element.
grid_dist_iterator< dim, device_grid, FREE > getDomainIterator() const
It return an iterator that span the full grid domain (each processor span its local domain) ...
grid_key_dx is the key to access any element in the grid
Definition: grid_key.hpp:18
Definition: Ghost.hpp:39
mem_id get(size_t i) const
Get the i index.
Definition: grid_key.hpp:394
void map()
It move all the grid parts that do not belong to the local processor to the respective processor...
This is a distributed grid.
This class represent an N-dimensional box.
Definition: Box.hpp:56
This class is a trick to indicate the compiler a specific specialization pattern. ...
Definition: memory_c.hpp:201
Distributed vector.
Main class for interpolation Particle to mest p2m and Mesh to particle m2p.