Commit 83b29794 authored by incardon's avatar incardon
Browse files

MultiLevel branch

parent 2cbbc468
......@@ -718,6 +718,21 @@ public:
return gd_array.get(lvl).remove(v1);
}
/*! \brief construct level connections for padding particles
*
*
*
*
*/
void construct_level_connections()
{
for (int lvl = 0 ; lvl < gd_array.size() ; lvl++)
{
gd_array.get(lvl).construct_link(gd_array.get(lvl-1),gd_array.get(lvl+1));
}
}
//////////////////////////////////////
/*! \brief It synchronize the ghost parts
......
......@@ -191,4 +191,43 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_amr_gpu )
BOOST_REQUIRE_EQUAL(count_c,correct_result_cell);*/
}
BOOST_AUTO_TEST_CASE( grid_dist_id_amr_gpu_link_test )
{
auto & v_cl = create_vcluster();
// Domain
Box<2,float> domain({0.0,0.0},{1.0,1.0});
Ghost<2,long int> g(1);
sgrid_dist_amr_gpu<2,float,aggregate<float>> amr_g(domain,g);
size_t g_sz[2] = {17,17};
size_t n_lvl = 2;
amr_g.initLevels(n_lvl,g_sz);
// auto it = amr_g.getGridIteratorGPU(i);
// it.setGPUInsertBuffer(4);
/////////////////////////////////////////////////////////////
auto & lvl_zero = amr_g.getDistGrid(0).get_loc_grid(0);
auto & lvl_one = amr_g.getDistGrid(1).get_loc_grid(0);
grid_key_dx<2> k({8,8});
grid_key_dx<2> k2({16,16});
lvl_zero.insertFlush<0>(k) = 1.0;
lvl_one.insertFlush<0>(k2) = 5.0;
lvl_one.template hostToDevice<0>();
lvl_one.tagBoundaries(v_cl.getmgpuContext());
/////////////////////////////////////////////////////////////
}
BOOST_AUTO_TEST_SUITE_END()
......@@ -80,6 +80,8 @@ template<unsigned int dim,
typename device_grid=grid_cpu<dim,T> >
class grid_dist_id : public grid_dist_id_comm<dim,St,T,Decomposition,Memory,device_grid>
{
typedef grid_dist_id<dim,St,T,Decomposition,Memory,device_grid> self;
//! Domain
Box<dim,St> domain;
......@@ -2587,6 +2589,20 @@ public:
{loc_grid.get(i).clear();}
}
/*! \brief construct link between levels
*
* \praram grid_up grid level up
* \param grid_dw grid level down
*
*/
void construct_link(self & grid_up, self & grid_dw)
{
for (int i = 0 ; i < loc_grid.size() ; i++)
{
loc_grid.get(i).construct_link(grid_up.get(i).grid_dw.get(i));
}
}
/*! \brief It move all the grid parts that do not belong to the local processor to the respective processor
*
*/
......
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