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)
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<PROP_POS>(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 Derivative_x Dx(Particles, ord, rCut, sampling_factor, support_options::RADIUS), Bulk_Dx(Particles, ord,
82 rCut, sampling_factor,
83 support_options::RADIUS);
89 auto it3 = Particles.getDomainIterator();
108 auto it3 = Particles.getDomainIterator();
113 auto key = it3.get();
115 match &= Particles.template getProp<sScalar>(key) == Particles.template getProp<dScalar>(key);
120 BOOST_REQUIRE_EQUAL(match,
true);
128 auto it3 = Particles.getDomainIterator();
133 auto key = it3.get();
135 match &= Particles.template getProp<sScalar>(key)*Particles.template getProp<sScalar>(key) == Particles.template getProp<dScalar>(key);
140 BOOST_REQUIRE_EQUAL(match,
true);
147 auto it3 = Particles.getDomainIterator();
152 auto key = it3.get();
154 match &= Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dScalar>(key);
158 BOOST_REQUIRE_EQUAL(match,
true);
164 auto it3 = Particles.getDomainIterator();
169 auto key = it3.get();
171 match &= Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dScalar>(key);
175 BOOST_REQUIRE_EQUAL(match,
true);
182 auto it3 = Particles.getDomainIterator();
187 auto key = it3.get();
189 match &= Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dVector>(key)[0];
190 match &= Particles.template getProp<sVector>(key)[1] == Particles.template getProp<dVector>(key)[1];
191 match &= Particles.template getProp<sVector>(key)[2] == Particles.template getProp<dVector>(key)[2];
195 BOOST_REQUIRE_EQUAL(match,
true);
202 auto it3 = Particles.getDomainIterator();
207 auto key = it3.get();
208 double x1=Particles.template getProp<sVector>(key)[0];
209 double y1=Particles.template getProp<dVector>(key)[0];
210 double x2=Particles.template getProp<sVector>(key)[1];
211 double y2=Particles.template getProp<dVector>(key)[1];
212 double x3=Particles.template getProp<sVector>(key)[2];
213 double y3=Particles.template getProp<dVector>(key)[2];
215 match &= 1.5*Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dVector>(key)[0];
216 match &= 1.5*Particles.template getProp<sVector>(key)[1] == Particles.template getProp<dVector>(key)[1];
217 match &= 1.5*Particles.template getProp<sVector>(key)[2] == Particles.template getProp<dVector>(key)[2];
221 BOOST_REQUIRE_EQUAL(match,
true);
228 auto it3 = Particles.getDomainIterator();
233 auto key = it3.get();
234 double x1=Particles.template getProp<sVector>(key)[0];
235 double y1=Particles.template getProp<dVector>(key)[0];
236 double x2=Particles.template getProp<sVector>(key)[1];
237 double y2=Particles.template getProp<dVector>(key)[1];
238 double x3=Particles.template getProp<sVector>(key)[2];
239 double y3=Particles.template getProp<dVector>(key)[2];
241 match &= Particles.template getProp<sVector>(key)[0]*Particles.template getProp<sVector>(key)[0] == Particles.template getProp<dVector>(key)[0];
242 match &= Particles.template getProp<sVector>(key)[1]*Particles.template getProp<sVector>(key)[1] == Particles.template getProp<dVector>(key)[1];
243 match &= Particles.template getProp<sVector>(key)[2]*Particles.template getProp<sVector>(key)[2] == Particles.template getProp<dVector>(key)[2];
248 BOOST_REQUIRE_EQUAL(match,
true);
257BOOST_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.