8#ifndef OPENFPM_NUMERICS_SRC_OPERATORS_VECTOR_VECTOR_DIST_OPERATORS_UNIT_TESTS_HPP_
9#define OPENFPM_NUMERICS_SRC_OPERATORS_VECTOR_VECTOR_DIST_OPERATORS_UNIT_TESTS_HPP_
11#define BOOST_TEST_DYN_LINK
12#include <boost/test/unit_test.hpp>
14#include "tests/vector_dist_operators_tests_util.hpp"
19BOOST_AUTO_TEST_SUITE( vector_dist_operators_test )
21BOOST_AUTO_TEST_CASE( vector_dist_operators_test )
23 if (create_vcluster().getProcessingUnits() > 3)
29 size_t bc[3]={PERIODIC,PERIODIC,PERIODIC};
35 typedef vector_dist<3,float,aggregate<float,float,float,VectorS<3,float>,
VectorS<3,float>,
VectorS<3,float>>> vtype;
37 vector_dist<3,float,aggregate<float,float,float,VectorS<3,float>,
VectorS<3,float>,
VectorS<3,float>>> vd(100,box,bc,ghost);
45 auto it = v1.getDomainIterator();
51 v1.template getProp<0>(p) = -1.0;
52 v1.template getProp<1>(p) = -1.0;
53 v1.template getProp<2>(p) = -1.0;
54 v1.template getProp<3>(p) = -1.0;
55 v1.template getProp<4>(p) = -1.0;
56 v1.template getProp<5>(p) = -1.0;
57 v1.template getProp<6>(p) = -1.0;
58 v1.template getProp<7>(p) = -1.0;
64template<
unsigned int i>
void loop_check(
vector_dist<3,
float,
aggregate<float,float,float,float,float,float,float,float>> & v1,
float check)
66 auto it = v1.getDomainIterator();
73 ret &= v1.template getProp<i>(p) == check;
78 BOOST_REQUIRE_EQUAL(ret,
true);
81void check(
vector_dist<3,
float,
aggregate<float,float,float,float,float,float,float,float>> & v1,
size_t i)
85 if (0 < i) check = 0.0;
87 loop_check<0>(v1,check);
89 if (1 < i) check = 1.0;
91 loop_check<1>(v1,check);
93 if (2 < i) check = 2.0;
95 loop_check<2>(v1,check);
97 if (3 < i) check = 3.0;
99 loop_check<3>(v1,check);
101 if (4 < i) check = 4.0;
103 loop_check<4>(v1,check);
105 if (5 < i) check = 5.0;
107 loop_check<5>(v1,check);
109 if (6 < i) check = 6.0;
111 loop_check<6>(v1,check);
113 if (7 < i) check = 7.0;
115 loop_check<7>(v1,check);
118BOOST_AUTO_TEST_CASE( vector_dist_operators_assign_test )
120 if (create_vcluster().getProcessingUnits() > 3)
126 size_t bc[3]={PERIODIC,PERIODIC,PERIODIC};
131 vector_dist<3,float,aggregate<float,float,float,float,float,float,float,float>> vd(100,box,bc,ghost);
133 auto v1 = getV<0>(vd);
134 auto v2 = getV<1>(vd);
135 auto v3 = getV<2>(vd);
136 auto v4 = getV<3>(vd);
137 auto v5 = getV<4>(vd);
138 auto v6 = getV<5>(vd);
139 auto v7 = getV<6>(vd);
140 auto v8 = getV<7>(vd);
142 auto v_pos = getV<POS_PROP>(vd);
219BOOST_AUTO_TEST_SUITE_END()
This class represent an N-dimensional box.
This class implement the point shape in an N-dimensional space.
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...