11#ifndef DCPSE_OP_TEST_TEMPORAL_CPP_
12#define DCPSE_OP_TEST_TEMPORAL_CPP_
14#define BOOST_TEST_DYN_LINK
16#include <boost/test/unit_test.hpp>
17#include "Operators/Vector/vector_dist_operators.hpp"
18#include "../DCPSE_op.hpp"
20BOOST_AUTO_TEST_SUITE(temporal_test_suite_cu)
21 BOOST_AUTO_TEST_CASE(temporal_test)
25 const size_t sz[3] = {grd_sz, grd_sz, grd_sz};
27 size_t bc[3] = {NON_PERIODIC, NON_PERIODIC, NON_PERIODIC};
28 double Lx = box.getHigh(0);
29 double Ly = box.getHigh(1);
30 double Lz = box.getHigh(2);
31 double spacing = box.getHigh(0) / (sz[0] - 1);
32 double rCut = 3.9 * spacing;
33 double rCut2 = 3.9 * spacing;
36 double sampling_factor = 4.0;
37 double sampling_factor2 = 2.4;
39 auto &v_cl = create_vcluster();
41 vector_dist_gpu<3, double, aggregate<double,VectorS<3, double>,
double[3][3],double,
VectorS<3,double>,
double[3][3]> > Particles(0, box, bc, ghost);
43 auto it = Particles.getGridIterator(sz);
48 double x = key.get(0) * it.getSpacing(0);
49 Particles.getLastPos()[0] = x;
50 double y = key.get(1) * it.getSpacing(1);
51 Particles.getLastPos()[1] = y;
52 double z = key.get(2) * it.getSpacing(1);
53 Particles.getLastPos()[2] = z;
58 Particles.ghost_get<0>();
65 constexpr int sScalar = 0;
66 constexpr int sVector = 1;
67 constexpr int sTensor = 2;
68 constexpr int dScalar = 3;
69 constexpr int dVector = 4;
70 constexpr int dTensor = 5;
71 auto Pos = getV<PROP_POS>(Particles);
72 auto sS = getV<sScalar>(Particles);
73 auto sV = getV<sVector>(Particles);
74 auto sT = getV<sTensor>(Particles);
75 auto dS = getV<dScalar>(Particles);
76 auto dV = getV<dVector>(Particles);
77 auto dT = getV<dTensor>(Particles);
80 Derivative_x_gpu Dx(Particles, ord, rCut, sampling_factor, support_options::RADIUS), Bulk_Dx(Particles, ord,
81 rCut, sampling_factor,
82 support_options::RADIUS);
88 auto it3 = Particles.getDomainIterator();
107 auto it3 = Particles.getDomainIterator();
112 auto key = it3.get();
114 match &= Particles.template getProp<sScalar>(key) == Particles.template getProp<dScalar>(key);
119 BOOST_REQUIRE_EQUAL(match,
true);
127 auto it3 = Particles.getDomainIterator();
132 auto key = it3.get();
134 match &= Particles.template getProp<sScalar>(key)*Particles.template getProp<sScalar>(key) == Particles.template getProp<dScalar>(key);
139 BOOST_REQUIRE_EQUAL(match,
true);
146 auto it3 = Particles.getDomainIterator();
151 auto key = it3.get();
153 match &= Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dScalar>(key);
157 BOOST_REQUIRE_EQUAL(match,
true);
163 auto it3 = Particles.getDomainIterator();
168 auto key = it3.get();
170 match &= Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dScalar>(key);
174 BOOST_REQUIRE_EQUAL(match,
true);
181 auto it3 = Particles.getDomainIterator();
186 auto key = it3.get();
188 match &= Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dVector>(key)[0];
189 match &= Particles.template getProp<sVector>(key)[1] == Particles.template getProp<dVector>(key)[1];
190 match &= Particles.template getProp<sVector>(key)[2] == Particles.template getProp<dVector>(key)[2];
194 BOOST_REQUIRE_EQUAL(match,
true);
201 auto it3 = Particles.getDomainIterator();
206 auto key = it3.get();
207 double x1=Particles.template getProp<sVector>(key)[0];
208 double y1=Particles.template getProp<dVector>(key)[0];
209 double x2=Particles.template getProp<sVector>(key)[1];
210 double y2=Particles.template getProp<dVector>(key)[1];
211 double x3=Particles.template getProp<sVector>(key)[2];
212 double y3=Particles.template getProp<dVector>(key)[2];
214 match &= 1.5*Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dVector>(key)[0];
215 match &= 1.5*Particles.template getProp<sVector>(key)[1] == Particles.template getProp<dVector>(key)[1];
216 match &= 1.5*Particles.template getProp<sVector>(key)[2] == Particles.template getProp<dVector>(key)[2];
220 BOOST_REQUIRE_EQUAL(match,
true);
227 auto it3 = Particles.getDomainIterator();
232 auto key = it3.get();
233 double x1=Particles.template getProp<sVector>(key)[0];
234 double y1=Particles.template getProp<dVector>(key)[0];
235 double x2=Particles.template getProp<sVector>(key)[1];
236 double y2=Particles.template getProp<dVector>(key)[1];
237 double x3=Particles.template getProp<sVector>(key)[2];
238 double y3=Particles.template getProp<dVector>(key)[2];
240 match &= Particles.template getProp<sVector>(key)[0]*Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dVector>(key)[0];
241 match &= Particles.template getProp<sVector>(key)[1]*Particles.template getProp<sVector>(key)[1] == Particles.template getProp<dVector>(key)[1];
242 match &= Particles.template getProp<sVector>(key)[2]*Particles.template getProp<sVector>(key)[2] == Particles.template getProp<dVector>(key)[2];
247 BOOST_REQUIRE_EQUAL(match,
true);
256BOOST_AUTO_TEST_SUITE_END()
This class represent an N-dimensional box.
This class implement the point shape in an N-dimensional space.
Main class that encapsulate a vector properties operand to be used for expressions construction.