8#ifndef SRC_VECTOR_SE_CLASS3_VECTOR_UNIT_TESTS_HPP_
9#define SRC_VECTOR_SE_CLASS3_VECTOR_UNIT_TESTS_HPP_
13BOOST_AUTO_TEST_SUITE( vector_dist_class3 )
15BOOST_AUTO_TEST_CASE( vector_dist_class3_check )
20 size_t bc[2]={PERIODIC,PERIODIC};
30 auto it = vd.getDomainIterator();
46 catch (std::exception & e)
52 BOOST_REQUIRE_EQUAL(error,
true);
58 auto it = vd.getDomainIterator();
65 vd.getPosWrite(p)[0] = (double)rand()/RAND_MAX;
66 vd.getPosWrite(p)[1] = (double)rand()/RAND_MAX;
74 auto it = vd.getDomainIterator();
90 catch (std::exception & e)
96 BOOST_REQUIRE_EQUAL(error,
false);
106 vd.getCellList(0.05);
108 catch (std::exception & e)
113 BOOST_REQUIRE_EQUAL(error,
true);
121 catch (std::exception & e)
126 BOOST_REQUIRE_EQUAL(error,
true);
132 vd.getCellListSym(0.05);
134 catch (std::exception & e)
139 BOOST_REQUIRE_EQUAL(error,
true);
147 vd.getCellList(0.05);
149 catch (std::exception & e)
154 BOOST_REQUIRE_EQUAL(error,
false);
158 vd.template getPropWrite<0>(vd.size_local()) = 0.5;
165 catch (std::exception & e)
170 BOOST_REQUIRE_EQUAL(error,
true);
174 vd.template getPropWrite<0>(vd.size_local()) = 0.5;
181 catch (std::exception & e)
186 BOOST_REQUIRE_EQUAL(error,
true);
190 vd.template getPropWrite<0>(vd.size_local()) = 0.5;
195 vd.ghost_get<1>(KEEP_PROPERTIES);
197 catch (std::exception & e)
202 BOOST_REQUIRE_EQUAL(error,
false);
206 vd.template getPropWrite<0>(vd.size_local()) = 0.5;
211 vd.ghost_get<0>(KEEP_PROPERTIES);
213 catch (std::exception & e)
218 BOOST_REQUIRE_EQUAL(error,
true);
224 vd.ghost_put<
add_,0>();
226 catch (std::exception & e)
231 BOOST_REQUIRE_EQUAL(error,
true);
235 auto it = vd.getDomainIterator();
242 vd.getPropWrite<0>(p) = 2.0;
248 vd.ghost_put<
add_,0>();
250 catch (std::exception & e)
256 BOOST_REQUIRE_EQUAL(error,
false);
264 catch (std::exception & e)
269 BOOST_REQUIRE_EQUAL(error,
false);
275 vd.getCellList(0.05);
277 catch (std::exception & e)
282 BOOST_REQUIRE_EQUAL(error,
false);
285 BOOST_REQUIRE_EQUAL(vd.get_se_class3().isGhostSync<1>(),NOTSYNC);
287 vd.ghost_put<
add_,0>();
290 auto NN = vd.getCellList(0.05);
292 BOOST_REQUIRE_EQUAL(vd.get_se_class3().isGhostSync<1>(),SYNC);
295 auto it = vd.getDomainIterator();
302 vd.getPropWrite<1>(p)[0] = 1.0;
303 vd.getPropWrite<1>(p)[1] = 1.0;
304 vd.getPropWrite<1>(p)[2] = 1.0;
309 BOOST_REQUIRE_EQUAL(vd.get_se_class3().isGhostSync<1>(),NOTSYNC);
312 auto it = vd.getDomainIterator();
321 auto NNp = NN.template getNNIterator<NO_CHECK>(NN.getCell(xp));
338 catch (std::exception & e)
344 BOOST_REQUIRE_EQUAL(error,
true);
350 auto it = vd.getDomainIterator();
357 vd.getPropWrite<1>(p)[0] = 1.0;
358 vd.getPropWrite<1>(p)[1] = 1.0;
359 vd.getPropWrite<1>(p)[2] = 1.0;
365 BOOST_REQUIRE_EQUAL(vd.get_se_class3().isGhostSync<1>(),NOTSYNC);
368 auto it = vd.getDomainIterator();
377 auto NNp = NN.template getNNIterator<NO_CHECK>(NN.getCell(xp));
394 catch (std::exception & e)
400 BOOST_REQUIRE_EQUAL(error,
true);
406 auto it = vd.getDomainIterator();
415 auto NNp = NN.template getNNIterator<NO_CHECK>(NN.getCell(xp));
432 catch (std::exception & e)
438 BOOST_REQUIRE_EQUAL(error,
false);
446BOOST_AUTO_TEST_CASE( vector_dist_class3_check_add )
451 size_t bc[2]={PERIODIC,PERIODIC};
463 for (
size_t i = 0 ; i < 1200 ; i++)
468 vd.getLastPos()[0] = (double)rand()/RAND_MAX;
469 vd.getLastPos()[1] = (double)rand()/RAND_MAX;
474 auto it = vd.getDomainIterator();
490 catch (std::exception & e)
496 BOOST_REQUIRE_EQUAL(error,
true);
502 auto it = vd.getDomainIterator();
510 float a = vd.getPropRead<0>(p);
519 catch (std::exception & e)
525 BOOST_REQUIRE_EQUAL(error,
true);
528#if defined(CHECKFOR_POSNAN) && defined(CHECKFOR_PROPNAN) && defined(CHECKFOR_POSINF) && defined(CHECKFOR_PROPINF)
531BOOST_AUTO_TEST_CASE( vector_dist_class3_check_nan_inf )
536 size_t bc[2]={PERIODIC,PERIODIC};
548 for (
size_t i = 0 ; i < 1200 ; i++)
553 vd.getLastPos()[0] = 0.0/0.0;
554 vd.getLastPos()[1] = 0.0/0.0;
563 catch (std::exception & e)
569 BOOST_REQUIRE_EQUAL(error,
true);
575 for (
size_t i = 0 ; i < 1200 ; i++)
580 vd2.getLastPos()[0] = 5.0/0.0;
581 vd2.getLastPos()[1] = 5.0/0.0;
588 vd2.getLastPosRead();
590 catch (std::exception & e)
596 BOOST_REQUIRE_EQUAL(error,
true);
601BOOST_AUTO_TEST_SUITE_END()
This class represent an N-dimensional box.
This class implement the point shape in an N-dimensional space.
__device__ __host__ const T & get(unsigned int i) const
Get coordinate.
This structure define the operation add to use with copy general.