5#define BOOST_TEST_DYN_LINK
7#include <boost/test/unit_test.hpp>
8#include "Vector/vector_dist.hpp"
9#include <Space/Shape/Point.hpp>
10#include "DCPSE/SupportBuilder.hpp"
12BOOST_AUTO_TEST_SUITE(Support_tests)
14 BOOST_AUTO_TEST_CASE(SupportBuilder_2D_1_0_2spacing_test)
17 size_t edgeSemiSize = 100;
18 const size_t sz[2] = {2 * edgeSemiSize, 2 * edgeSemiSize};
20 size_t bc[2] = {NON_PERIODIC, NON_PERIODIC};
22 spacing[0] = 1.0 / (sz[0] - 1);
23 spacing[1] = 1.0 / (sz[1] - 1);
27 auto it = domain.getGridIterator(sz);
30 double minNormOne = 999;
35 mem_id k0 = key.get(0) - edgeSemiSize;
36 double x = k0 * spacing[0];
37 domain.getLastPos()[0] = x;
38 mem_id k1 = key.get(1) - edgeSemiSize;
39 double y = k1 * spacing[1];
40 domain.getLastPos()[1] = y;
41 domain.template getLastProp<0>() = 0.0;
47 auto itPoint = domain.getIterator();
48 size_t foo = (sqrt(counter) + counter) / 2;
49 for (
int i = 0; i < foo; ++i)
55 const auto pos = domain.getPos(p.
getKey());
60 auto support = supportBuilder.getSupport(itPoint, 6, support_options::N_PARTICLES);
62 BOOST_REQUIRE_GE(support.size(), 6);
65 BOOST_AUTO_TEST_CASE(SupportBuilder_2D_2_2_2spacing_test)
68 size_t edgeSemiSize = 25;
69 const size_t sz[2] = {2 * edgeSemiSize, 2 * edgeSemiSize};
72 size_t bc[2] = {NON_PERIODIC, NON_PERIODIC};
74 spacing[0] = 1.0 / (sz[0] - 1);
75 spacing[1] = 1.0 / (sz[1] - 1);
79 auto it = domain.getGridIterator(sz);
86 mem_id k0 = key.get(0) - edgeSemiSize;
87 double x = k0 * spacing[0];
88 domain.getLastPos()[0] = x;
89 mem_id k1 = key.get(1) - edgeSemiSize;
90 double y = k1 * spacing[1];
91 domain.getLastPos()[1] = y;
92 domain.template getLastProp<0>() = 0.0;
93 if (abs(domain.getLastPos()[0]) + abs(domain.getLastPos()[1]) < 1e-16)
101 auto itPoint = domain.getDomainIterator();
102 size_t foo = (sqrt(counter) + counter) / 2;
103 for (
int i = 0; i < foo; ++i)
109 const auto pos = domain.getPos(p.
getKey());
114 auto supportPoints = supportBuilder.getSupport(itPoint, 20, support_options::N_PARTICLES);
116 BOOST_REQUIRE_GE(supportPoints.size(), 20);
121BOOST_AUTO_TEST_SUITE_END()
This class represent an N-dimensional box.
Grid key for a distributed grid.
__device__ __host__ size_t getKey() const
Get the key.