24#include "Vector/vector_dist.hpp"
27int main(
int argc,
char* argv[])
51 openfpm_init(&argc,&argv);
57 size_t bc[2]={PERIODIC,PERIODIC};
107 auto it = vd.getDomainIterator();
115 vd.getPos(p)[0] = (float)rand() / RAND_MAX;
118 vd.getPos(p)[1] = (float)rand() / RAND_MAX;
121 vd.template getProp<scalar>(p) = vd.getPos(p)[0];
124 vd.template getProp<vector>(p)[0] = 1.0;
125 vd.template getProp<vector>(p)[1] = 2.0;
126 vd.template getProp<vector>(p)[2] = 3.0;
129 vd.template getProp<tensor>(p)[0][0] = 1.0;
130 vd.template getProp<tensor>(p)[0][1] = 2.0;
131 vd.template getProp<tensor>(p)[0][2] = 3.0;
132 vd.template getProp<tensor>(p)[1][0] = 4.0;
133 vd.template getProp<tensor>(p)[1][1] = 5.0;
134 vd.template getProp<tensor>(p)[1][2] = 6.0;
135 vd.template getProp<tensor>(p)[2][0] = 7.0;
136 vd.template getProp<tensor>(p)[2][1] = 8.0;
137 vd.template getProp<tensor>(p)[2][2] = 9.0;
223 vd.write(
"before_ghost_get");
226 vd.ghost_get<scalar,
tensor>();
229 vd.write(
"after_ghost_get");
280 vd.ghost_get<vector>(KEEP_PROPERTIES);
283 vd.write(
"after_ghost_get_kp");
323 it = vd.getGhostIterator();
331 vd.getPos(p)[0] -= 1.0;
334 vd.getPos(p)[1] -= 1.0;
337 vd.template getProp<vector>(p)[0] = -1.0;
338 vd.template getProp<vector>(p)[1] = -2.0;
339 vd.template getProp<vector>(p)[2] = -3.0;
345 vd.ghost_get<vector>(KEEP_PROPERTIES | NO_POSITION);
348 vd.write(
"after_ghost_get_kp_no_pos");
350 vd.ghost_get<vector>(KEEP_PROPERTIES);
352 vd.write(
"after_ghost_get_kp_no_pos_restore");
392 vd.ghost_put<
add_,vector>();
395 vd.write(
"after_ghost_put");
This class represent an N-dimensional box.
This structure define the operation add to use with copy general.