diff --git a/src/Grid/grid_dist_id_unit_test.hpp b/src/Grid/grid_dist_id_unit_test.hpp index 49780864915c9eb2a23d9301c1bcc4c4c461c6ae..61a3e4b361a6ae1464c65563a9dd4f632371c21d 100644 --- a/src/Grid/grid_dist_id_unit_test.hpp +++ b/src/Grid/grid_dist_id_unit_test.hpp @@ -117,6 +117,42 @@ void Test2D(const Box<2,float> & domain, long int k) bool val = g_dist.getDecomposition().check_consistency(); BOOST_REQUIRE_EQUAL(val,true); + /////////////// DEBUG ///////////////////// + + // get the decomposition + auto & dec = g_dist.getDecomposition(); + + Vcluster & v_cl = *global_v_cluster; + + // check the consistency of the decomposition + val = dec.check_consistency(); + BOOST_REQUIRE_EQUAL(val,true); + + // for each local volume + // Get the number of local grid needed + size_t n_grid = dec.getNLocalHyperCube(); + + size_t vol = 0; + + // Allocate the grids + for (size_t i = 0 ; i < n_grid ; i++) + { + // Get the local hyper-cube + SpaceBox<2,float> sub = dec.getLocalHyperCube(i); + + Box<2,size_t> g_box = g_dist.getCellDecomposer().convertDomainSpaceIntoGridUnits(sub); + + vol += g_box.getVolumeKey(); + } + + v_cl.reduce(vol); + v_cl.execute(); + + BOOST_REQUIRE_EQUAL(vol,k*k); + + ///////////////////////////////////// + + // Grid sm grid_sm<2,void> info(sz);