Commit 62d76cb0 authored by incardon's avatar incardon

amr_struct

parent 265d602f
openfpm_data @ 1b796172
Subproject commit d125ec9a7a9de358e2fe74e0df55495fd476646e
Subproject commit 1b796172ff8fa0a7a4842ce04d12e4d399a58728
......@@ -15,6 +15,8 @@
#define AMR_IMPL_PATCHES 2
#define AMR_IMPL_OPENVDB 3
template<unsigned int dim, typename St, typename T, unsigned int impl=AMR_IMPL_TRIVIAL ,typename Decomposition = CartDecomposition<dim,St>,typename Memory=HeapMemory , typename device_grid=grid_cpu<dim,T> >
class grid_dist_amr
{
......@@ -54,8 +56,10 @@ class grid_dist_amr<dim,St,T,AMR_IMPL_TRIVIAL,Decomposition,Memory,device_grid>
//! array of grids
openfpm::vector<grid_dist_id<dim,St,T,Decomposition,Memory,device_grid>> gd_array;
typedef decltype(device_grid::type_of_subiterator()) device_sub_it;
//! Iterator for each distributed grid
openfpm::vector<grid_dist_iterator<dim,device_grid,FREE>> git;
openfpm::vector<grid_dist_iterator<dim,device_grid,device_sub_it,FREE>> git;
//! Iterator for each distributed grid
openfpm::vector<grid_dist_iterator_sub<dim,device_grid>> git_sub;
......@@ -156,7 +160,10 @@ public:
}
grid_dist_amr_key_iterator<dim,device_grid,grid_dist_iterator_sub<dim,device_grid>> getDomainIteratorCells()
grid_dist_amr_key_iterator<dim,device_grid,
decltype(grid_dist_id<dim,St,T,Decomposition,Memory,device_grid>::type_of_subiterator()),
decltype(grid_dist_id<dim,St,T,Decomposition,Memory,device_grid>::type_of_subiterator()) >
getDomainIteratorCells()
{
git_sub.clear();
......@@ -174,7 +181,9 @@ public:
git_sub.add(gd_array.get(i).getSubDomainIterator(start,stop));
}
return grid_dist_amr_key_iterator<dim,device_grid,grid_dist_iterator_sub<dim,device_grid>>(git_sub);
return grid_dist_amr_key_iterator<dim,device_grid,
decltype(grid_dist_id<dim,St,T,Decomposition,Memory,device_grid>::type_of_subiterator()),
decltype(grid_dist_id<dim,St,T,Decomposition,Memory,device_grid>::type_of_subiterator())>(git_sub);
}
grid_dist_iterator_sub<dim,device_grid> getDomainIteratorCells(size_t lvl)
......@@ -191,12 +200,23 @@ public:
return gd_array.get(lvl).getSubDomainIterator(start,stop);
}
/*! \brief Get an iterator to the grid
*
* \return an iterator to the grid
*
*/
auto getGridIterator(size_t lvl) -> decltype(gd_array.get(lvl).getGridIterator())
{
return gd_array.get(lvl).getGridIterator();
}
/*! \brief Get domain iterator
*
* \return an iterator over all the grid levels
*
*/
grid_dist_amr_key_iterator<dim,device_grid> getDomainIterator()
grid_dist_amr_key_iterator<dim,device_grid, decltype(device_grid::type_of_subiterator())>
getDomainIterator()
{
git.clear();
......@@ -205,7 +225,7 @@ public:
git.add(gd_array.get(i).getDomainIterator());
}
return grid_dist_amr_key_iterator<dim,device_grid>(git);
return grid_dist_amr_key_iterator<dim,device_grid,decltype(device_grid::type_of_subiterator())>(git);
}
/*! \brief return an iterator over the level lvl
......@@ -215,7 +235,8 @@ public:
* \return an iterator over the level lvl selected
*
*/
grid_dist_iterator<dim,device_grid,FREE> getDomainIterator(size_t lvl) const
grid_dist_iterator<dim,device_grid,decltype(device_grid::type_of_subiterator()),FREE>
getDomainIterator(size_t lvl) const
{
return gd_array.get(lvl).getDomainIterator();
}
......@@ -285,6 +306,80 @@ public:
return gd_array.get(lvl).template get<p>(v1);
}
//////////////////// Insert functions
/*! \brief Get the reference of the selected element
*
* \tparam p property to get (is an integer)
* \param v1 grid_key that identify the element in the grid
*
* \return the selected element
*
*/
template <unsigned int p>
inline auto insert(const grid_dist_amr_key<dim> & v1)
-> typename std::add_lvalue_reference<decltype(gd_array.get(v1.getLvl()).template insert<p>(v1.getKey()))>::type
{
#ifdef SE_CLASS2
check_valid(this,8);
#endif
return gd_array.get(v1.getLvl()).template insert<p>(v1.getKey());
}
/*! \brief Get the reference of the selected element
*
* \tparam p property to get (is an integer)
* \param v1 grid_key that identify the element in the grid
*
* \return the selected element
*
*/
template <unsigned int p>inline auto insert(size_t lvl, const grid_dist_key_dx<dim> & v1) -> typename std::add_lvalue_reference<decltype(gd_array.get(lvl).template get<p>(v1))>::type
{
#ifdef SE_CLASS2
check_valid(this,8);
#endif
return gd_array.get(lvl).template insert<p>(v1);
}
//////////////////////////////////////
//////////////////// Remove functions
/*! \brief Remove a grid point (this function make sense only in case of
* sparse grid)
*
* \param v1 grid_key that identify the element in the AMR grid to eleminate
*
*/
inline void remove(const grid_dist_amr_key<dim> & v1)
{
#ifdef SE_CLASS2
check_valid(this,8);
#endif
return gd_array.get(v1.getLvl()).remove(v1.getKey());
}
/*! \brief Remove a grid point (this function make sense only in case of
* sparse grid)
*
* \param v1 grid_key that identify the element in the AMR grid to eleminate
*
*/
void remove(size_t lvl, const grid_dist_key_dx<dim> & v1)
{
#ifdef SE_CLASS2
check_valid(this,8);
#endif
return gd_array.get(lvl).remove(v1);
}
//////////////////////////////////////
/*! \brief It synchronize the ghost parts
*
* \tparam prp... Properties to synchronize
......@@ -358,6 +453,17 @@ public:
key.setLvl(lvl+1);
}
/*! \brief From a distributed key it return a AMR key that contain also the grid level
*
* \param lvl level
* \param key distributed key
*
*/
inline grid_dist_amr_key<dim> getAMRKey(size_t lvl, grid_dist_key_dx<dim> key)
{
return grid_dist_amr_key<dim>(lvl,key);
}
/*! \brief Move up (to coarser level) the key
*
* \param key multi-resolution AMR key
......@@ -425,5 +531,7 @@ public:
}
};
template<unsigned int dim, typename St, typename T>
using sgrid_dist_amr = grid_dist_amr<dim,St,T,AMR_IMPL_TRIVIAL,CartDecomposition<dim,St>,HeapMemory,sgrid_cpu<dim,T,HeapMemory>>;
#endif /* AMR_GRID_AMR_DIST_HPP_ */
......@@ -12,7 +12,7 @@
#include "Grid/Iterators/grid_dist_id_iterator.hpp"
#include "grid_dist_amr_key.hpp"
template<unsigned int dim, typename device_grid,typename it_type = grid_dist_iterator<dim,device_grid,FREE>>
template<unsigned int dim, typename device_grid, typename device_sub_it, typename it_type = grid_dist_iterator<dim,device_grid,device_sub_it,FREE>>
class grid_dist_amr_key_iterator
{
//! Array of grid iterators
......@@ -58,6 +58,8 @@ public:
:git(git),g_c(0)
{
a_it = &git.get(0);
selectValidGrid();
}
......@@ -72,14 +74,14 @@ public:
* \return the next grid_key
*
*/
inline grid_dist_amr_key_iterator<dim,device_grid,it_type> & operator++()
inline grid_dist_amr_key_iterator<dim,device_grid,device_sub_it,it_type> & operator++()
{
++(*a_it);
// check if a_it is at the end
if (a_it->isNext() == true)
return *this;
{return *this;}
else
{
// switch to the new iterator
......
......@@ -20,10 +20,9 @@ BOOST_AUTO_TEST_SUITE( grid_dist_amr_test )
* \param n_lvl number of levels
*
*/
void Test3D_amr_create_levels(Box<3,float> & domain, size_t coars_g, size_t n_lvl)
template<typename grid_amr>
void Test3D_amr_create_levels(grid_amr & amr_g, Box<3,float> & domain, size_t coars_g, size_t n_lvl)
{
Ghost<3,float> g(0.05);
size_t g_sz[3] = {coars_g,coars_g,coars_g};
size_t tot_c = (coars_g - 1)*(coars_g - 1)*(coars_g - 1);
......@@ -39,10 +38,29 @@ void Test3D_amr_create_levels(Box<3,float> & domain, size_t coars_g, size_t n_lv
fact *= 8;
}
amr_g.initLevels(n_lvl,g_sz);
grid_dist_amr<3,float,aggregate<float>> amr_g(domain,g);
for (size_t i = 0 ; i < amr_g.getNLvl() ; i++)
{
// Fill the AMR with something
amr_g.initLevels(n_lvl,g_sz);
size_t count = 0;
auto it = amr_g.getGridIterator(i);
while (it.isNext())
{
auto key = it.get_dist();
auto akey = amr_g.getAMRKey(i,key);
amr_g.template insert<0>(akey) = 3.0;
count++;
++it;
}
}
// Iterate across all the levels initialized
auto it = amr_g.getDomainIterator();
......@@ -91,6 +109,8 @@ void Test3D_amr_create_levels(Box<3,float> & domain, size_t coars_g, size_t n_lv
BOOST_REQUIRE_EQUAL(count_c,correct_result_cell);
}
template<unsigned int dim>
inline bool gr_is_inside(const grid_key_dx<dim> & key, const size_t (& sz)[dim])
{
......@@ -105,14 +125,13 @@ inline bool gr_is_inside(const grid_key_dx<dim> & key, const size_t (& sz)[dim])
return true;
}
void Test3D_amr_child_parent_get(Box<3,float> & domain, size_t coars_g, size_t n_lvl)
template <typename grid>
void Test3D_amr_child_parent_get(grid & amr_g, Box<3,float> & domain, size_t coars_g, size_t n_lvl)
{
const int x = 0;
const int y = 1;
const int z = 2;
Ghost<3,long int> g(1);
size_t g_sz[3] = {coars_g,coars_g,coars_g};
size_t tot = coars_g*coars_g*coars_g;
......@@ -125,10 +144,32 @@ void Test3D_amr_child_parent_get(Box<3,float> & domain, size_t coars_g, size_t n
fact *= 8;
}
amr_g.initLevels(n_lvl,g_sz);
grid_dist_amr<3,float,aggregate<long int,long int,long int>> amr_g(domain,g);
//////// Add something /////
amr_g.initLevels(n_lvl,g_sz);
for (size_t i = 0 ; i < amr_g.getNLvl() ; i++)
{
// Fill the AMR with something
size_t count = 0;
auto it = amr_g.getGridIterator(i);
while (it.isNext())
{
auto key = it.get_dist();
auto akey = amr_g.getAMRKey(i,key);
amr_g.template insert<0>(akey) = 3.0;
count++;
++it;
}
}
////////////////////////////
std::string test = amr_g.getSpacing(0).toString();
......@@ -140,14 +181,14 @@ void Test3D_amr_child_parent_get(Box<3,float> & domain, size_t coars_g, size_t n
auto key = it.get();
auto gkey = it.getGKey();
amr_g.get<0>(key) = gkey.get(0);
amr_g.get<1>(key) = gkey.get(1);
amr_g.get<2>(key) = gkey.get(2);
amr_g.template insert<0>(key) = gkey.get(0);
amr_g.template insert<1>(key) = gkey.get(1);
amr_g.template insert<2>(key) = gkey.get(2);
++it;
}
amr_g.ghost_get<0,1,2>();
amr_g.template ghost_get<0,1,2>();
amr_g.write("amr_write_test");
// now we check that move space work
......@@ -180,44 +221,44 @@ void Test3D_amr_child_parent_get(Box<3,float> & domain, size_t coars_g, size_t n
if (gr_is_inside(key_gpx,amr_g.getGridInfoVoid(it2.getLvl()).getSize()) == true)
{
match &= amr_g.get<0>(key_px) == gkey.get(0) + 1;
match &= amr_g.get<1>(key_px) == gkey.get(1);
match &= amr_g.get<2>(key_px) == gkey.get(2);
match &= amr_g.template get<0>(key_px) == gkey.get(0) + 1;
match &= amr_g.template get<1>(key_px) == gkey.get(1);
match &= amr_g.template get<2>(key_px) == gkey.get(2);
}
if (gr_is_inside(key_gmx,amr_g.getGridInfoVoid(it2.getLvl()).getSize()) == true)
{
match &= amr_g.get<0>(key_mx) == gkey.get(0) - 1;
match &= amr_g.get<1>(key_mx) == gkey.get(1);
match &= amr_g.get<2>(key_mx) == gkey.get(2);
match &= amr_g.template get<0>(key_mx) == gkey.get(0) - 1;
match &= amr_g.template get<1>(key_mx) == gkey.get(1);
match &= amr_g.template get<2>(key_mx) == gkey.get(2);
}
if (gr_is_inside(key_gpy,amr_g.getGridInfoVoid(it2.getLvl()).getSize()) == true)
{
match &= amr_g.get<0>(key_py) == gkey.get(0);
match &= amr_g.get<1>(key_py) == gkey.get(1) + 1;
match &= amr_g.get<2>(key_py) == gkey.get(2);
match &= amr_g.template get<0>(key_py) == gkey.get(0);
match &= amr_g.template get<1>(key_py) == gkey.get(1) + 1;
match &= amr_g.template get<2>(key_py) == gkey.get(2);
}
if (gr_is_inside(key_gmy,amr_g.getGridInfoVoid(it2.getLvl()).getSize()) == true)
{
match &= amr_g.get<0>(key_my) == gkey.get(0);
match &= amr_g.get<1>(key_my) == gkey.get(1) - 1;
match &= amr_g.get<2>(key_my) == gkey.get(2);
match &= amr_g.template get<0>(key_my) == gkey.get(0);
match &= amr_g.template get<1>(key_my) == gkey.get(1) - 1;
match &= amr_g.template get<2>(key_my) == gkey.get(2);
}
if (gr_is_inside(key_gpz,amr_g.getGridInfoVoid(it2.getLvl()).getSize()) == true)
{
match &= amr_g.get<0>(key_pz) == gkey.get(0);
match &= amr_g.get<1>(key_pz) == gkey.get(1);
match &= amr_g.get<2>(key_pz) == gkey.get(2) + 1;
match &= amr_g.template get<0>(key_pz) == gkey.get(0);
match &= amr_g.template get<1>(key_pz) == gkey.get(1);
match &= amr_g.template get<2>(key_pz) == gkey.get(2) + 1;
}
if (gr_is_inside(key_gmz,amr_g.getGridInfoVoid(it2.getLvl()).getSize()) == true)
{
match &= amr_g.get<0>(key_mz) == gkey.get(0);
match &= amr_g.get<1>(key_mz) == gkey.get(1);
match &= amr_g.get<2>(key_mz) == gkey.get(2) - 1;
match &= amr_g.template get<0>(key_mz) == gkey.get(0);
match &= amr_g.template get<1>(key_mz) == gkey.get(1);
match &= amr_g.template get<2>(key_mz) == gkey.get(2) - 1;
}
// Test to go to all the levels down
......@@ -261,6 +302,8 @@ void Test3D_amr_child_parent_get(Box<3,float> & domain, size_t coars_g, size_t n
BOOST_REQUIRE_EQUAL(match,true);
}
template <typename> struct Debug;
BOOST_AUTO_TEST_CASE( grid_dist_amr_get_child_test )
{
// Domain
......@@ -269,7 +312,10 @@ BOOST_AUTO_TEST_CASE( grid_dist_amr_get_child_test )
long int k = 16*16*16*create_vcluster().getProcessingUnits();
k = std::pow(k, 1/3.);
Test3D_amr_child_parent_get(domain3,k,4);
Ghost<3,long int> g(1);
grid_dist_amr<3,float,aggregate<long int,long int,long int>> amr_g(domain3,g);
Test3D_amr_child_parent_get(amr_g,domain3,k,4);
}
BOOST_AUTO_TEST_CASE( grid_dist_amr_test )
......@@ -280,9 +326,17 @@ BOOST_AUTO_TEST_CASE( grid_dist_amr_test )
long int k = 16*16*16*create_vcluster().getProcessingUnits();
k = std::pow(k, 1/3.);
Test3D_amr_create_levels(domain3,k,4);
Ghost<3,float> g(0.05);
grid_dist_amr<3,float,aggregate<float>> amr_g(domain3,g);
Test3D_amr_create_levels(amr_g,domain3,k,4);
sgrid_dist_amr<3,float,aggregate<float>> amr_g2(domain3,g);
Test3D_amr_create_levels(amr_g2,domain3,k,4);
}
BOOST_AUTO_TEST_CASE( grid_dist_amr_get_child_test_low_res )
{
// Domain
......@@ -290,7 +344,14 @@ BOOST_AUTO_TEST_CASE( grid_dist_amr_get_child_test_low_res )
long int k = 2;
Test3D_amr_child_parent_get(domain3,k,4);
Ghost<3,long int> g(1);
grid_dist_amr<3,float,aggregate<long int,long int,long int>> amr_g(domain3,g);
Test3D_amr_child_parent_get(amr_g,domain3,k,4);
sgrid_dist_amr<3,float,aggregate<long int,long int,long int>> amr_g2(domain3,g);
Test3D_amr_child_parent_get(amr_g2,domain3,k,4);
}
BOOST_AUTO_TEST_SUITE_END()
......@@ -22,10 +22,11 @@
*
* \tparam dim dimensionality of the grid
* \tparam device_grid type of basic grid
* \tparam device_sub_it device grid sib-iterator type
* \tparam impl implementation
*
*/
template<unsigned int dim, typename device_grid, int impl,typename stencil = no_stencil >
template<unsigned int dim, typename device_grid, typename device_sub_it, int impl,typename stencil = no_stencil >
class grid_dist_iterator
{
......@@ -38,11 +39,12 @@ class grid_dist_iterator
*
* \tparam dim dimensionality of the grid
* \tparam device_grid type of basic grid
* \tparam impl implementation
* \tparam stencil it inject the code to calculate stencil offset
* \tparam sub_iterator it indicate the sub-iterator type of the device_grid
*
*/
template<unsigned int dim, typename device_grid, typename stencil>
class grid_dist_iterator<dim,device_grid,FREE,stencil>
template<unsigned int dim, typename device_grid, typename device_sub_it, typename stencil>
class grid_dist_iterator<dim,device_grid,device_sub_it,FREE,stencil>
{
//! grid list counter
size_t g_c;
......@@ -54,7 +56,7 @@ class grid_dist_iterator<dim,device_grid,FREE,stencil>
const openfpm::vector<GBoxes<device_grid::dims>> & gdb_ext;
//! Actual iterator
grid_key_dx_iterator_sub<dim,stencil> a_it;
device_sub_it a_it;
//! stop point (is the grid size)
grid_key_dx<dim> stop;
......@@ -83,7 +85,9 @@ class grid_dist_iterator<dim,device_grid,FREE,stencil>
* \param stop end point
*
*/
grid_dist_iterator(const openfpm::vector<device_grid> & gk, const openfpm::vector<GBoxes<device_grid::dims>> & gdb_ext, const grid_key_dx<dim> & stop)
grid_dist_iterator(const openfpm::vector<device_grid> & gk,
const openfpm::vector<GBoxes<device_grid::dims>> & gdb_ext,
const grid_key_dx<dim> & stop)
:g_c(0),gList(gk),gdb_ext(gdb_ext),stop(stop)
{
// Initialize the current iterator
......@@ -112,12 +116,12 @@ class grid_dist_iterator<dim,device_grid,FREE,stencil>
}
//! Copy constructor
grid_dist_iterator(const grid_dist_iterator<dim,device_grid,FREE,stencil> & g)
grid_dist_iterator(const grid_dist_iterator<dim,device_grid,device_sub_it,FREE,stencil> & g)
:g_c(g.g_c),gList(g.gList),gdb_ext(g.gdb_ext),a_it(g.a_it),stop(g.stop)
{}
//! Copy constructor
grid_dist_iterator(grid_dist_iterator<dim,device_grid,FREE,stencil> && g)
grid_dist_iterator(grid_dist_iterator<dim,device_grid,device_sub_it,FREE,stencil> && g)
:g_c(g.g_c),gList(g.gList),gdb_ext(g.gdb_ext),a_it(g.a_it),stop(g.stop)
{}
......@@ -131,7 +135,7 @@ class grid_dist_iterator<dim,device_grid,FREE,stencil>
* \return the next grid_key
*
*/
inline grid_dist_iterator<dim,device_grid,FREE,stencil> & operator++()
inline grid_dist_iterator<dim,device_grid,device_sub_it,FREE,stencil> & operator++()
{
++a_it;
......@@ -170,9 +174,9 @@ class grid_dist_iterator<dim,device_grid,FREE,stencil>
* \return the actual key
*
*/
inline grid_dist_key_dx<dim> get() const
inline grid_dist_key_dx<dim, typename device_grid::base_key> get() const
{
return grid_dist_key_dx<dim>(g_c,a_it.get());
return grid_dist_key_dx<dim,typename device_grid::base_key>(g_c,a_it.get());
}
/*! \brief it return the stop point of the iterator
......@@ -225,12 +229,13 @@ class grid_dist_iterator<dim,device_grid,FREE,stencil>
* \return the global position in the grid
*
*/
inline grid_key_dx<dim> getGKey(const grid_dist_key_dx<dim> & k)
inline grid_key_dx<dim> getGKey(const grid_dist_key_dx<dim,typename device_grid::base_key> & k)
{
// Get the sub-domain id
size_t sub_id = k.getSub();
grid_key_dx<dim> k_glob = k.getKey();
// gList.get(sub_id).convert_key(k_glob,k.getKey());
// shift
k_glob = k_glob + gdb_ext.get(sub_id).origin;
......@@ -261,8 +266,8 @@ class grid_dist_iterator<dim,device_grid,FREE,stencil>
* \tparam impl implementation
*
*/
template<unsigned int dim, typename device_grid,typename stencil>
class grid_dist_iterator<dim,device_grid,FIXED,stencil>
template<unsigned int dim, typename device_grid, typename device_sub_it,typename stencil>
class grid_dist_iterator<dim,device_grid,device_sub_it,FIXED,stencil>
{
//! grid list counter
size_t g_c;
......@@ -274,7 +279,7 @@ class grid_dist_iterator<dim,device_grid,FIXED,stencil>
const openfpm::vector<GBoxes<device_grid::dims>> & gdb_ext;
//! Actual iterator
grid_key_dx_iterator<dim,stencil> a_it;
device_sub_it a_it;
/*! \brief from g_c increment g_c until you find a valid grid
*
......@@ -300,7 +305,7 @@ class grid_dist_iterator<dim,device_grid,FIXED,stencil>
* \return itself
*
*/
grid_dist_iterator<dim,device_grid,FIXED> & operator=(const grid_dist_iterator<dim,device_grid,FIXED> & tmp)
grid_dist_iterator<dim,device_grid,device_sub_it,FIXED> & operator=(const grid_dist_iterator<dim,device_grid,device_sub_it,FIXED> & tmp)
{
g_c = tmp.g_c;
gList = tmp.gList;
......@@ -335,7 +340,7 @@ class grid_dist_iterator<dim,device_grid,FIXED,stencil>
*
*/
grid_dist_iterator<dim,device_grid,FIXED> & operator++()
grid_dist_iterator<dim,device_grid,device_sub_it,FIXED> & operator++()
{
++a_it;
......@@ -405,7 +410,8 @@ class grid_dist_iterator<dim,device_grid,FIXED,stencil>
// Get the sub-domain id
size_t sub_id = k.getSub();
grid_key_dx<dim> k_glob = k.getKey();
grid_key_dx<dim> k_glob;
gList.get(sub_id).convert_key(k_glob,k.getKey());
// shift
k_glob = k_glob + gdb_ext.get(sub_id).origin;
......
......@@ -40,7 +40,7 @@ class grid_dist_iterator_sub
const openfpm::vector<GBoxes<device_grid::dims>> & gdb_ext;
//! Actual iterator
grid_key_dx_iterator_sub<dim> a_it;
decltype(device_grid::type_of_subiterator()) a_it;
//! start key
grid_key_dx<dim> start;
......@@ -111,7 +111,8 @@ class grid_dist_iterator_sub
* \param tmp iterator to copy
*
*/
grid_dist_iterator_sub<dim,device_grid> & operator=(const grid_dist_iterator_sub<dim,device_grid> & tmp)
grid_dist_iterator_sub<dim,device_grid> &
operator=(const grid_dist_iterator_sub<dim,device_grid> & tmp)
{
g_c = tmp.g_c;
gList = tmp.gList;
......
......@@ -24,6 +24,8 @@
#include "HDF5_wr/HDF5_wr.hpp"
#include "SparseGrid/SparseGrid.hpp"
template <typename> struct Debug;
//! Internal ghost box sent to construct external ghost box into the other processors
template<unsigned int dim>
struct Box_fix
......@@ -1563,7 +1565,10 @@ public:
* \return the iterator
*
*/
grid_dist_iterator<dim,device_grid,FREE> getOldDomainIterator() const
grid_dist_iterator<dim,device_grid,
decltype(device_grid::type_of_subiterator()),
FREE>
getOldDomainIterator() const
{
#ifdef SE_CLASS2
check_valid(this,8);
......@@ -1574,7 +1579,9 @@ public:
one.one();
stop = stop - one;
grid_dist_iterator<dim,device_grid,FREE> it(loc_grid_old,gdb_ext_old,stop);
grid_dist_iterator<dim,device_grid,
decltype(device_grid::type_of_subiterator()),
FREE> it(loc_grid_old,gdb_ext_old,stop);
return it;
}
......@@ -1608,7 +1615,9 @@ public:
* \return the iterator
*
*/
grid_dist_iterator<dim,device_grid,FREE> getDomainIterator() const
grid_dist_iterator<dim,device_grid,
decltype(device_grid::type_of_subiterator()),FREE>
getDomainIterator() const
{
#ifdef SE_CLASS2
check_valid(this,8);
......@@ -1619,7 +1628,9 @@ public:
one.one();
stop = stop - one;
grid_dist_iterator<dim,device_grid,FREE> it(loc_grid,gdb_ext,stop);
grid_dist_iterator<dim,device_grid,
decltype(device_grid::type_of_subiterator()),
FREE> it(loc_grid,gdb_ext,stop);
return it;
}
......@@ -1632,7 +1643,10 @@ public:
*
*/
template<unsigned int Np>
grid_dist_iterator<dim,device_grid,FREE,stencil_offset_compute<dim,Np>>
grid_dist_iterator<dim,device_grid,
decltype(device_grid::template type_of_subiterator<stencil_offset_compute<dim,Np>>()),
FREE,
stencil_offset_compute<dim,Np> >
getDomainIteratorStencil(const grid_key_dx<dim> (& stencil_pnt)[Np]) const
{
#ifdef SE_CLASS2
......@@ -1644,7 +1658,10 @@ public:
one.one();
stop = stop - one;
grid_dist_iterator<dim,device_grid,FREE,stencil_offset_compute<dim,Np>> it(loc_grid,gdb_ext,stop,stencil_pnt);
grid_dist_iterator<dim,device_grid,
decltype(device_grid::template type_of_subiterator<stencil_offset_compute<dim,Np>>()),
FREE,
stencil_offset_compute<dim,Np>> it(loc_grid,gdb_ext,stop,stencil_pnt);
return it;
}
......@@ -1654,12 +1671,17 @@ public:
* \return the iterator
*
*/
grid_dist_iterator<dim,device_grid,FIXED> getDomainGhostIterator() const
grid_dist_iterator<dim,device_grid,
decltype(device_grid::type_of_subiterator()),
FIXED>
getDomainGhostIterator() const
{