Commit 9165e4f8 authored by incardon's avatar incardon

Release 0.6.0

parent 48464d95
......@@ -14,7 +14,6 @@
*
* This example show multi-phase cell lists for the distributed vector
*
* \warning BETA version
*
*/
......@@ -136,6 +135,8 @@ int main(int argc, char* argv[])
CellListM<3,float,2> NN;
NN.Initialize(box_cl,div);
// for all the phases i
for (size_t i = 0; i < phases.size() ; i++)
{
......
......@@ -359,26 +359,10 @@ public:
{
// Cell list
CellL cell_list;
size_t div[dim];
// Calculate the Cell list division for this CellList
CellDecomposer_sm<dim,St,shift<dim,St>> cd_sm;
for (size_t i = 0 ; i < dim ; i++)
div[i] = (getDecomposition().getDomain().getHigh(i) - getDecomposition().getDomain().getLow(i)) / r_cut;
size_t pad = 0;
Ghost<dim,St> g = getDecomposition().getGhost();
g.magnify(1.013);
// Calculate the maximum padding
for (size_t i = 0 ; i < dim ; i++)
{
size_t tmp = std::ceil(fabs(g.getLow(i)) / r_cut);
pad = (pad > tmp)?pad:tmp;
}
cd_sm.setDimensions(getDecomposition().getDomain(),div,pad);
CellDecomposer_sm<dim,St,shift<dim,St>> cd_sm;
cl_param_calculateSym(getDecomposition().getDomain(),cd_sm,getDecomposition().getGhost(),r_cut,pad);
// Processor bounding box
Box<dim, St> pbox = getDecomposition().getProcessorBounds();
......@@ -568,6 +552,8 @@ public:
*
* \param r_cut cut-off radius
*
* \return the verlet list
*
*/
VerletList<dim,St,FAST,shift<dim,St> > getVerletSym(St r_cut)
{
......@@ -585,6 +571,8 @@ public:
*
* \param r_cut cut-off radius
*
* \return a VerletList object
*
*/
VerletList<dim,St,FAST,shift<dim,St> > getVerlet(St r_cut)
{
......@@ -1137,6 +1125,9 @@ public:
pbox.enlarge(g);
cl_param_calculate(pbox, div,r_cut,enlarge);
// output the fixed domain
box = pbox;
}
/*! \brief It return the id of structure in the allocation list
......
......@@ -248,8 +248,7 @@ class vector_dist_comm
// add this particle shifting its position
v_pos.add(p);
v_prp.add();
v_prp.last() = v_prp.get(key);
v_prp.get(lg_m+i) = v_prp.get(key);
}
}
......@@ -366,7 +365,11 @@ class vector_dist_comm
// Create the shift boxes
createShiftBox();
lg_m = v_prp.size();
if (opt != SKIP_LABELLING)
lg_m = v_prp.size();
// v_pos.resize(lg_m);
// v_prp.resize(lg_m);
if (box_f.size() == 0)
return;
......@@ -818,10 +821,13 @@ public:
// send vector for each processor
typedef openfpm::vector<prp_object> send_vector;
v_pos.resize(g_m);
// reset the ghost part
if (opt != NO_POSITION)
v_pos.resize(g_m);
v_prp.resize(g_m);
if (opt != SKIP_LABELLING)
{
v_prp.resize(g_m);
}
// Label all the particles
if ((opt & SKIP_LABELLING) == false)
......@@ -837,7 +843,15 @@ public:
prc_recv_get.clear();
recv_sz_get.clear();
v_cl.SSendRecvP<send_vector,decltype(v_prp),prp...>(g_send_prp,v_prp,prc_g_opart,prc_recv_get,recv_sz_get);
if (opt == SKIP_LABELLING)
{
op_ssend_gg_recv_merge opm(g_m);
// v_cl.SSendRecvP_op<op_ssend_recv_merge<op>
v_cl.SSendRecvP_op<op_ssend_gg_recv_merge,send_vector,decltype(v_prp),prp...>(g_send_prp,v_prp,prc_g_opart,opm,prc_recv_get,recv_sz_get);
}
else
v_cl.SSendRecvP<send_vector,decltype(v_prp),prp...>(g_send_prp,v_prp,prc_g_opart,prc_recv_get,recv_sz_get);
if (opt != NO_POSITION)
{
......
......@@ -1435,12 +1435,12 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost_with_ghost_buffering )
Box<3,float> box({0.0,0.0,0.0},{1.0,1.0,1.0});
// Boundary conditions
size_t bc[3]={PERIODIC,PERIODIC,PERIODIC};
size_t bc[3]={NON_PERIODIC,NON_PERIODIC,NON_PERIODIC};
// ghost
Ghost<3,float> ghost(0.1);
typedef aggregate<float> part_prop;
typedef aggregate<float,float,float> part_prop;
// Distributed vector
vector_dist<3,float, part_prop > vd(k,box,bc,ghost);
......@@ -1458,6 +1458,8 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost_with_ghost_buffering )
// Fill some properties randomly
vd.getProp<0>(key) = 0.0;
vd.getProp<1>(key) = vd.getPos(key)[0];
vd.getProp<2>(key) = vd.getPos(key)[0]*vd.getPos(key)[0];
++it;
}
......@@ -1465,22 +1467,21 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost_with_ghost_buffering )
vd.map();
// sync the ghost
vd.ghost_get<0>();
openfpm::vector<size_t> list_idx;
openfpm::vector<size_t> list_idx2;
vd.ghost_get<0,1,2>();
auto it3 = vd.getGhostIterator();
while (it3.isNext())
bool ret = true;
auto it2 = vd.getGhostIterator();
while (it2.isNext())
{
auto key = it3.get();
auto key = it2.get();
list_idx.add(key.getKey());
ret &= vd.getProp<1>(key) == vd.getPos(key)[0];
ret &= vd.getProp<2>(key) == vd.getPos(key)[0] * vd.getPos(key)[0];
++it3;
++it2;
}
list_idx.sort();
BOOST_REQUIRE_EQUAL(ret,true);
for (size_t i = 0 ; i < 10 ; i++)
{
......@@ -1490,7 +1491,6 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost_with_ghost_buffering )
{
auto key = it.get();
vd.getPos(key)[0] = ud(eg);
vd.getPos(key)[1] = ud(eg);
vd.getPos(key)[2] = ud(eg);
......@@ -1503,7 +1503,6 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost_with_ghost_buffering )
vd.ghost_get<0>(SKIP_LABELLING);
list_idx2.clear();
auto it2 = vd.getGhostIterator();
bool ret = true;
......@@ -1511,40 +1510,18 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost_with_ghost_buffering )
{
auto key = it2.get();
list_idx2.add(key.getKey());
ret &= vd.getProp<0>(key) == i;
ret &= vd.getProp<1>(key) == vd.getPos(key)[0];
ret &= vd.getProp<2>(key) == vd.getPos(key)[0] * vd.getPos(key)[0];
++it2;
}
BOOST_REQUIRE_EQUAL(ret,true);
BOOST_REQUIRE_EQUAL(list_idx.size(),list_idx2.size());
list_idx2.sort();
ret = true;
for (size_t i = 0 ; i < list_idx.size() ; i++)
ret &= list_idx.get(i) == list_idx2.get(i);
BOOST_REQUIRE_EQUAL(ret,true);
}
vd.map();
vd.ghost_get<0>();
list_idx.clear();
auto it4 = vd.getGhostIterator();
while (it4.isNext())
{
auto key = it4.get();
list_idx.add(key.getKey());
++it4;
}
list_idx.sort();
vd.ghost_get<0,1,2>();
for (size_t i = 0 ; i < 10 ; i++)
{
......@@ -1554,20 +1531,20 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost_with_ghost_buffering )
{
auto key = it.get();
vd.getPos(key)[0] = ud(eg);
vd.getPos(key)[1] = ud(eg);
vd.getPos(key)[2] = ud(eg);
// Fill some properties randomly
vd.getProp<0>(key) = i;
vd.getProp<1>(key) = vd.getPos(key)[0];
vd.getProp<2>(key) = vd.getPos(key)[0]*vd.getPos(key)[0];
++it;
}
vd.ghost_get<0>(SKIP_LABELLING);
list_idx2.clear();
auto it2 = vd.getGhostIterator();
bool ret = true;
......@@ -1575,21 +1552,14 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost_with_ghost_buffering )
{
auto key = it2.get();
list_idx2.add(key.getKey());
ret &= vd.getProp<0>(key) == i;
ret &= vd.getProp<1>(key) == vd.getPos(key)[0];
ret &= vd.getProp<2>(key) == vd.getPos(key)[0] * vd.getPos(key)[0];
++it2;
}
BOOST_REQUIRE_EQUAL(ret,true);
BOOST_REQUIRE_EQUAL(list_idx.size(),list_idx2.size());
list_idx2.sort();
ret = true;
for (size_t i = 0 ; i < list_idx.size() ; i++)
ret &= list_idx.get(i) == list_idx2.get(i);
BOOST_REQUIRE_EQUAL(ret,true);
}
}
......
......@@ -49,4 +49,5 @@ int main(int argc, char* argv[])
#include "Graph/DistGraphFactory.hpp"
#include "Decomposition/nn_processor_unit_test.hpp"
#include "Grid/staggered_grid_dist_unit_test.hpp"
#include "Vector/vector_dist_MP_unit_tests.hpp"
//#include "antoniol_test_isolation.hpp"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment