Commit 2922681f authored by incardon's avatar incardon
Browse files

Fixing sparse data-structure

parent 22569eff
openfpm_data @ 4094c5a1
Subproject commit a32cad15bdbec8bc50bef3d61301d2e9936a9e54
Subproject commit 4094c5a176424df253513deb41021061cdafe9ac
......@@ -72,7 +72,7 @@ class grid_dist_amr<dim,St,T,AMR_IMPL_TRIVIAL,Decomposition,Memory,device_grid>
/*! \brief Initialize the others levels
*
* \param n_lvl number of levels
* \param n_grid_dist_id<dim,St,T,Decomposition,Memory,device_grid>lvl number of levels
* \param g_sz_lvl grid size on each level
*
*/
......@@ -453,8 +453,19 @@ public:
//////////////////////////////////////
//////////////////// Remove functions
/*! \brief Get the internal distributed grid
*
* \param lvl level
*
* \return the internal distributed grid
*
*/
grid_dist_id<dim,St,T,Decomposition,Memory,device_grid> & getDistGrid(size_t lvl)
{
return gd_array.get(lvl);
}
//////////////////// Remove functions
/*! \brief Remove a grid point (this function make sense only in case of
* sparse grid)
......
......@@ -535,6 +535,16 @@ BOOST_AUTO_TEST_CASE( grid_dist_amr_test_background_value )
bck2 = amr_g2.get<2>(2,key2);
BOOST_REQUIRE_EQUAL(bck2,-123);
auto & g_dist_lvl2 = amr_g2.getDistGrid(2);
g_dist_lvl2.get_loc_grid(0).internal_clear_cache();
bck0 = amr_g2.get<0>(2,key2);
BOOST_REQUIRE_EQUAL(bck0,-57);
bck1 = amr_g2.get<1>(2,key2);
BOOST_REQUIRE_EQUAL(bck1,-90);
bck2 = amr_g2.get<2>(2,key2);
BOOST_REQUIRE_EQUAL(bck2,-123);
}
BOOST_AUTO_TEST_SUITE_END()
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