Commit 0985040d authored by incardon's avatar incardon

Ghost get and put example + small fixes for NO_POSITION

parent d24117db
......@@ -2,6 +2,7 @@
*
* \subpage Vector_0_simple
* \subpage Vector_1_celllist
* \subpage Vector_1_ghost_get
* \subpage Vector_2_expression
* \subpage Vector_3_md
* \subpage Vector_4_reo_root
......@@ -39,7 +40,7 @@
* </div>
* \endhtmlonly
*
* ## inclusion ## {#inclusion}
* ## inclusion ## {#e0_v_inclusion}
*
* In order to use distributed vectors in our code we have to include the file Vector/vector_dist.hpp
*
......@@ -62,7 +63,7 @@ int main(int argc, char* argv[])
* Here we
* * Initialize the library
* * we create a Box that define our domain
* * An array that define out boundary conditions
* * An array that define our boundary conditions
* * A Ghost object that will define the extension of the ghost part in physical units
*
*
......
......@@ -173,6 +173,9 @@ int main(int argc, char* argv[])
* no properties. If we want to synchronize also properties we have to specify which one.
* For example with <0,1,2> here we synchronize the scalar property (0), the vector (1), and the rank 2 tensor (2)
*
* \warning Every ghost_get by default reset the status of the ghost so the information are lost
*
* \see \ref e1_gg_options
*
* \htmlonly
* <a href="#" onclick="hide_show('vector-video-5')" >Video 1</a>
......
......@@ -366,12 +366,9 @@ class vector_dist_comm
// Create the shift boxes
createShiftBox();
if (opt != SKIP_LABELLING)
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;
else
......@@ -822,10 +819,11 @@ public:
// send vector for each processor
typedef openfpm::vector<prp_object> send_vector;
v_pos.resize(g_m);
if (!(opt & NO_POSITION))
v_pos.resize(g_m);
// reset the ghost part
if (opt != SKIP_LABELLING)
if (!(opt & SKIP_LABELLING))
{
v_prp.resize(g_m);
}
......@@ -839,22 +837,21 @@ public:
fill_send_ghost_prp_buf<send_vector, prp_object, prp...>(v_prp,g_send_prp);
// Create and fill the send buffer for the particle position
if (opt != NO_POSITION)
if (!(opt & NO_POSITION))
fill_send_ghost_pos_buf(v_pos,g_pos_send);
prc_recv_get.clear();
recv_sz_get.clear();
if (opt == SKIP_LABELLING)
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)
if (!(opt & NO_POSITION))
{
prc_recv_get.clear();
recv_sz_get.clear();
......@@ -1071,7 +1068,7 @@ public:
if (v_prp.size() - lg_m != o_part_loc.size())
{
std::cerr << "Error: " << __FILE__ << ":" << __LINE__ << " Local ghost particles = " << v_prp.size() - lg_m << " != " << o_part_loc.size() << std::endl;
std::cerr << "Error: " << __FILE__ << ":" << __LINE__ << "Check that you did a ghost_get before a ghost_put" << std::endl;
std::cerr << "Error: " << __FILE__ << ":" << __LINE__ << " Check that you did a ghost_get before a ghost_put" << std::endl;
}
......
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