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/DCPSE_op/DCPSE_op.hpp"
20 BOOST_AUTO_TEST_SUITE(temporal_test_suite)
22 BOOST_AUTO_TEST_CASE(temporal_test)
26 const size_t sz[3] = {grd_sz, grd_sz, grd_sz};
28 size_t bc[3] = {NON_PERIODIC, NON_PERIODIC, NON_PERIODIC};
29 double Lx = box.getHigh(0);
30 double Ly = box.getHigh(1);
31 double Lz = box.getHigh(2);
32 double spacing = box.getHigh(0) / (sz[0] - 1);
33 double rCut = 3.9 * spacing;
34 double rCut2 = 3.9 * spacing;
37 double sampling_factor = 4.0;
38 double sampling_factor2 = 2.4;
40 auto &v_cl = create_vcluster();
42 vector_dist<3, double, aggregate<double,VectorS<3, double>,
double[3][3],double,
VectorS<3,double>,
double[3][3]> > Particles(0, box, bc, ghost);
44 auto it = Particles.getGridIterator(sz);
49 double x = key.get(0) * it.getSpacing(0);
50 Particles.getLastPos()[0] = x;
51 double y = key.get(1) * it.getSpacing(1);
52 Particles.getLastPos()[1] = y;
53 double z = key.get(2) * it.getSpacing(1);
54 Particles.getLastPos()[2] = z;
59 Particles.ghost_get<0>();
66 constexpr
int sScalar = 0;
67 constexpr
int sVector = 1;
68 constexpr
int sTensor = 2;
69 constexpr
int dScalar = 3;
70 constexpr
int dVector = 4;
71 constexpr
int dTensor = 5;
72 auto Pos = getV<POS_PROP>(Particles);
73 auto sS = getV<sScalar>(Particles);
74 auto sV = getV<sVector>(Particles);
75 auto sT = getV<sTensor>(Particles);
76 auto dS = getV<dScalar>(Particles);
77 auto dV = getV<dVector>(Particles);
78 auto dT = getV<dTensor>(Particles);
81 auto verletList = Particles.template getVerlet<VL_NON_SYMMETRIC|VL_SKIP_REF_PART>(rCut);
83 Derivative_x<decltype(verletList)> Dx(Particles, verletList, ord, rCut, support_options::RADIUS);
84 Derivative_x<decltype(verletList)> Bulk_Dx(Particles, verletList, ord, rCut, support_options::RADIUS);
90 auto it3 = Particles.getDomainIterator();
109 auto it3 = Particles.getDomainIterator();
114 auto key = it3.get();
116 match &= Particles.template getProp<sScalar>(key) == Particles.template getProp<dScalar>(key);
121 BOOST_REQUIRE_EQUAL(match,
true);
129 auto it3 = Particles.getDomainIterator();
134 auto key = it3.get();
136 match &= Particles.template getProp<sScalar>(key)*Particles.template getProp<sScalar>(key) == Particles.template getProp<dScalar>(key);
141 BOOST_REQUIRE_EQUAL(match,
true);
148 auto it3 = Particles.getDomainIterator();
153 auto key = it3.get();
155 match &= Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dScalar>(key);
159 BOOST_REQUIRE_EQUAL(match,
true);
165 auto it3 = Particles.getDomainIterator();
170 auto key = it3.get();
172 match &= Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dScalar>(key);
176 BOOST_REQUIRE_EQUAL(match,
true);
183 auto it3 = Particles.getDomainIterator();
188 auto key = it3.get();
190 match &= Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dVector>(key)[0];
191 match &= Particles.template getProp<sVector>(key)[1] == Particles.template getProp<dVector>(key)[1];
192 match &= Particles.template getProp<sVector>(key)[2] == Particles.template getProp<dVector>(key)[2];
196 BOOST_REQUIRE_EQUAL(match,
true);
203 auto it3 = Particles.getDomainIterator();
208 auto key = it3.get();
209 double x1=Particles.template getProp<sVector>(key)[0];
210 double y1=Particles.template getProp<dVector>(key)[0];
211 double x2=Particles.template getProp<sVector>(key)[1];
212 double y2=Particles.template getProp<dVector>(key)[1];
213 double x3=Particles.template getProp<sVector>(key)[2];
214 double y3=Particles.template getProp<dVector>(key)[2];
216 match &= 1.5*Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dVector>(key)[0];
217 match &= 1.5*Particles.template getProp<sVector>(key)[1] == Particles.template getProp<dVector>(key)[1];
218 match &= 1.5*Particles.template getProp<sVector>(key)[2] == Particles.template getProp<dVector>(key)[2];
222 BOOST_REQUIRE_EQUAL(match,
true);
229 auto it3 = Particles.getDomainIterator();
234 auto key = it3.get();
235 double x1=Particles.template getProp<sVector>(key)[0];
236 double y1=Particles.template getProp<dVector>(key)[0];
237 double x2=Particles.template getProp<sVector>(key)[1];
238 double y2=Particles.template getProp<dVector>(key)[1];
239 double x3=Particles.template getProp<sVector>(key)[2];
240 double y3=Particles.template getProp<dVector>(key)[2];
242 match &= Particles.template getProp<sVector>(key)[0]*Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dVector>(key)[0];
243 match &= Particles.template getProp<sVector>(key)[1]*Particles.template getProp<sVector>(key)[1] == Particles.template getProp<dVector>(key)[1];
244 match &= Particles.template getProp<sVector>(key)[2]*Particles.template getProp<sVector>(key)[2] == Particles.template getProp<dVector>(key)[2];
249 BOOST_REQUIRE_EQUAL(match,
true);
258 BOOST_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.