diff --git a/src/Decomposition/CartDecomposition.hpp b/src/Decomposition/CartDecomposition.hpp index 78a60eac6345b6d8bd3444d24dc61c431f5f0487..cdad424afb30143c5b8d47352556ccbf40a007f4 100644 --- a/src/Decomposition/CartDecomposition.hpp +++ b/src/Decomposition/CartDecomposition.hpp @@ -32,8 +32,6 @@ * \tparam layout to use * \tparam Memory Memory factory used to allocate memory * \tparam Domain Structure that contain the information of your physical domain - * \tparam data type of structure that store the sub-domain decomposition can be an openfpm structure like - * vector, ... * * Given an N-dimensional space, this class decompose the space into a Cartesian grid of small * sub-sub-domain. At each sub-sub-domain is assigned an id that identify which processor is @@ -63,7 +61,7 @@ * */ -template<unsigned int dim, typename T, template<typename> class device_l=openfpm::device_cpu, typename Memory=HeapMemory, template<unsigned int, typename> class Domain=Box, template<typename, typename, typename, typename, unsigned int> class data_s = openfpm::vector> +template<unsigned int dim, typename T, template<typename> class device_l=openfpm::device_cpu, typename Memory=HeapMemory, template<unsigned int, typename> class Domain=Box> class CartDecomposition { struct N_box @@ -151,7 +149,7 @@ class CartDecomposition } // encap interface to make compatible with OpenFPM_IO - template <int i> auto get() -> decltype( static_cast<Box<dim,T> *>(this)->template get<i>()) + template <int i> auto get() -> decltype( std::declval<Box<dim,T> *>()->template get<i>()) { return ::Box<dim,T>::template get<i>(); } @@ -192,7 +190,7 @@ private: //! This is the key type to access data_s, for example in the case of vector //! acc_key is size_t - typedef typename data_s<SpaceBox<dim,T>,device_l<SpaceBox<dim,T>>,Memory,openfpm::vector_grow_policy_default,openfpm::vect_isel<SpaceBox<dim,T>>::value >::access_key acc_key; + typedef typename openfpm::vector<SpaceBox<dim,T>,device_l<SpaceBox<dim,T>>,Memory,openfpm::vector_grow_policy_default,openfpm::vect_isel<SpaceBox<dim,T>>::value >::access_key acc_key; //! the margin of the sub-domain selected SpaceBox<dim,T> sub_domain; @@ -772,7 +770,7 @@ private: static void * message_alloc(size_t msg_i ,size_t total_msg, size_t total_p, size_t i, size_t ri, void * ptr) { // cast the pointer - CartDecomposition<dim,T,device_l,Memory,Domain,data_s> * cd = static_cast< CartDecomposition<dim,T,device_l,Memory,Domain,data_s> *>(ptr); + CartDecomposition<dim,T,device_l,Memory,Domain> * cd = static_cast< CartDecomposition<dim,T,device_l,Memory,Domain> *>(ptr); // Resize the memory cd->nn_processor_subdomains[i].bx.resize(msg_i / sizeof(::Box<dim,T>) ); @@ -788,7 +786,7 @@ public: * \param v_cl Virtual cluster, used internally to handle or pipeline communication * */ - CartDecomposition(CartDecomposition<dim,T,device_l,Memory,Domain,data_s> && cd) + CartDecomposition(CartDecomposition<dim,T,device_l,Memory,Domain> && cd) :sub_domain(cd.sub_domain),gr(cd.gr),cd(cd.cd),domain(cd.domain),v_cl(cd.v_cl) { // Reset the box to zero @@ -1126,7 +1124,7 @@ p1[0]<-----+ +----> p2[0] // Intersect all the local sub-domains with the sub-domains of the contiguous processors // Get the sub-domains of the near processors - v_cl.sendrecvMultipleMessagesNBX(nn_processors,boxes,CartDecomposition<dim,T,device_l,Memory,Domain,data_s>::message_alloc, this ,NEED_ALL_SIZE); + v_cl.sendrecvMultipleMessagesNBX(nn_processors,boxes,CartDecomposition<dim,T,device_l,Memory,Domain>::message_alloc, this ,NEED_ALL_SIZE); // create the internal structures that store ghost information create_box_nn_processor_ext(ghost);