Commit db2c2ecc authored by incardon's avatar incardon

Working with 4 processors

parent d1b11807
......@@ -74,9 +74,10 @@ pdata-HeapMemory.o: ../../OpenFPM_devices/src/memory/HeapMemory.cpp \
/usr/include/sys/types.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/include/bits/stdlib-float.h /usr/include/c++/4.9.2/cstdio \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdlib-bsearch.h /usr/include/bits/stdlib-float.h \
/usr/include/c++/4.9.2/cstdio /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \
/usr/include/c++/4.9.2/cerrno /usr/include/errno.h \
/usr/include/bits/errno.h /usr/include/linux/errno.h \
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
......@@ -301,6 +302,8 @@ pdata-HeapMemory.o: ../../OpenFPM_devices/src/memory/HeapMemory.cpp \
/usr/include/alloca.h:
/usr/include/bits/stdlib-bsearch.h:
/usr/include/bits/stdlib-float.h:
/usr/include/c++/4.9.2/cstdio:
......@@ -313,6 +316,8 @@ pdata-HeapMemory.o: ../../OpenFPM_devices/src/memory/HeapMemory.cpp \
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/c++/4.9.2/cerrno:
/usr/include/errno.h:
......
......@@ -71,9 +71,10 @@ pdata-Memleak_check.o: ../../OpenFPM_data/src/Memleak_check.cpp \
/usr/include/sys/types.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/include/bits/stdlib-float.h /usr/include/c++/4.9.2/cstdio \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdlib-bsearch.h /usr/include/bits/stdlib-float.h \
/usr/include/c++/4.9.2/cstdio /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \
/usr/include/c++/4.9.2/cerrno /usr/include/errno.h \
/usr/include/bits/errno.h /usr/include/linux/errno.h \
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
......@@ -302,6 +303,8 @@ pdata-Memleak_check.o: ../../OpenFPM_data/src/Memleak_check.cpp \
/usr/include/alloca.h:
/usr/include/bits/stdlib-bsearch.h:
/usr/include/bits/stdlib-float.h:
/usr/include/c++/4.9.2/cstdio:
......@@ -314,6 +317,8 @@ pdata-Memleak_check.o: ../../OpenFPM_data/src/Memleak_check.cpp \
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/c++/4.9.2/cerrno:
/usr/include/errno.h:
......
......@@ -78,9 +78,10 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
/usr/include/sys/types.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/include/bits/stdlib-float.h /usr/include/c++/4.9.2/cstdio \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdlib-bsearch.h /usr/include/bits/stdlib-float.h \
/usr/include/c++/4.9.2/cstdio /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \
/usr/include/c++/4.9.2/cerrno /usr/include/errno.h \
/usr/include/bits/errno.h /usr/include/linux/errno.h \
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
......@@ -789,7 +790,8 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
/usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \
/usr/include/bits/inf.h /usr/include/bits/nan.h \
/usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
/usr/include/c++/4.9.2/sstream /usr/include/c++/4.9.2/bits/sstream.tcc \
/usr/include/bits/mathinline.h /usr/include/c++/4.9.2/sstream \
/usr/include/c++/4.9.2/bits/sstream.tcc \
/usr/include/boost/type_traits/is_compound.hpp \
/usr/include/boost/type_traits/is_copy_constructible.hpp \
/usr/include/boost/noncopyable.hpp \
......@@ -998,11 +1000,6 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
../../OpenFPM_vcluster/src/MPI_wrapper/MPI_IallreduceW.hpp \
../../OpenFPM_vcluster/src/MPI_wrapper/MPI_IrecvW.hpp \
../../OpenFPM_vcluster/src/MPI_wrapper/MPI_IsendW.hpp \
../../OpenFPM_data/src/util/check_no_pointers.hpp \
../../OpenFPM_data/src/util/common.hpp \
../../OpenFPM_data/src/util/util_debug.hpp \
/usr/include/c++/4.9.2/cxxabi.h \
/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/cxxabi_tweaks.h \
../../OpenFPM_vcluster/src/util/Vcluster_log.hpp \
/usr/include/c++/4.9.2/fstream /usr/include/c++/4.9.2/bits/codecvt.h \
/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/basic_file.h \
......@@ -1226,6 +1223,8 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
/usr/include/alloca.h:
/usr/include/bits/stdlib-bsearch.h:
/usr/include/bits/stdlib-float.h:
/usr/include/c++/4.9.2/cstdio:
......@@ -1238,6 +1237,8 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/c++/4.9.2/cerrno:
/usr/include/errno.h:
......@@ -2738,6 +2739,8 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
/usr/include/bits/mathcalls.h:
/usr/include/bits/mathinline.h:
/usr/include/c++/4.9.2/sstream:
/usr/include/c++/4.9.2/bits/sstream.tcc:
......@@ -3184,16 +3187,6 @@ pdata-VCluster.o: ../../OpenFPM_vcluster/src/VCluster.cpp \
../../OpenFPM_vcluster/src/MPI_wrapper/MPI_IsendW.hpp:
../../OpenFPM_data/src/util/check_no_pointers.hpp:
../../OpenFPM_data/src/util/common.hpp:
../../OpenFPM_data/src/util/util_debug.hpp:
/usr/include/c++/4.9.2/cxxabi.h:
/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/cxxabi_tweaks.h:
../../OpenFPM_vcluster/src/util/Vcluster_log.hpp:
/usr/include/c++/4.9.2/fstream:
......
......@@ -70,9 +70,10 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
/usr/include/sys/types.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
/usr/include/bits/stdlib-float.h /usr/include/c++/4.9.2/cstdio \
/usr/include/libio.h /usr/include/_G_config.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdlib-bsearch.h /usr/include/bits/stdlib-float.h \
/usr/include/c++/4.9.2/cstdio /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/bits/sys_errlist.h /usr/include/bits/stdio.h \
/usr/include/c++/4.9.2/cerrno /usr/include/errno.h \
/usr/include/bits/errno.h /usr/include/linux/errno.h \
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
......@@ -737,7 +738,8 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
/usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \
/usr/include/bits/inf.h /usr/include/bits/nan.h \
/usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
/usr/include/c++/4.9.2/sstream /usr/include/c++/4.9.2/bits/sstream.tcc \
/usr/include/bits/mathinline.h /usr/include/c++/4.9.2/sstream \
/usr/include/c++/4.9.2/bits/sstream.tcc \
/usr/include/boost/type_traits/is_compound.hpp \
/usr/include/boost/type_traits/is_copy_constructible.hpp \
/usr/include/boost/noncopyable.hpp \
......@@ -1111,6 +1113,7 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
/usr/include/boost/math/tools/user.hpp \
/usr/include/boost/detail/fenv.hpp /usr/include/c++/4.9.2/fenv.h \
/usr/include/fenv.h /usr/include/bits/fenv.h \
/usr/include/bits/fenvinline.h \
/usr/include/boost/math/special_functions/math_fwd.hpp \
/usr/include/boost/math/special_functions/detail/round_fwd.hpp \
/usr/include/boost/math/tools/promotion.hpp \
......@@ -1306,11 +1309,6 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
../../OpenFPM_vcluster/src/MPI_wrapper/MPI_IallreduceW.hpp \
../../OpenFPM_vcluster/src/MPI_wrapper/MPI_IrecvW.hpp \
../../OpenFPM_vcluster/src/MPI_wrapper/MPI_IsendW.hpp \
../../OpenFPM_data/src/util/check_no_pointers.hpp \
../../OpenFPM_data/src/util/common.hpp \
../../OpenFPM_data/src/util/util_debug.hpp \
/usr/include/c++/4.9.2/cxxabi.h \
/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/cxxabi_tweaks.h \
../../OpenFPM_vcluster/src/util/Vcluster_log.hpp \
../../OpenFPM_data/src/timer.hpp \
../../OpenFPM_data/src/Space/SpaceBox.hpp \
......@@ -1324,7 +1322,10 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
../../OpenFPM_data/src/util/object_util.hpp \
../../OpenFPM_data/src/util/object_creator.hpp \
../../OpenFPM_data/src/util/util_debug.hpp \
/usr/include/c++/4.9.2/cxxabi.h \
/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/cxxabi_tweaks.h \
../../OpenFPM_data/src/util/check_no_pointers.hpp \
../../OpenFPM_data/src/util/common.hpp \
../../OpenFPM_data/src/util/object_s_di.hpp \
../../OpenFPM_data/src/util/object_si_d.hpp \
../../OpenFPM_devices/src/memory/ExtPreAlloc.hpp \
......@@ -1399,6 +1400,7 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
../../OpenFPM_vcluster/src/Packer.hpp \
../../OpenFPM_data/src/Grid/util.hpp \
../../OpenFPM_data/src/Vector/util.hpp \
../../OpenFPM_data/src/util/util_debug.hpp \
../../OpenFPM_vcluster/src/Pack_stat.hpp \
../../OpenFPM_vcluster/src/Pack_selector.hpp \
../../OpenFPM_vcluster/src/Unpacker.hpp \
......@@ -1418,7 +1420,8 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
../../OpenFPM_data/src/NN/CellList/CellListBal.hpp \
../../OpenFPM_data/src/NN/CellList/CellListMem.hpp \
../../OpenFPM_data/src/Space/Ghost.hpp ../../OpenFPM_IO/src/util.hpp \
unit_test_init_cleanup.hpp Decomposition/ORB_unit_test.hpp \
unit_test_init_cleanup.hpp Decomposition/CartDecomposition_unit_test.hpp \
Decomposition/CartDecomposition.hpp Decomposition/ORB_unit_test.hpp \
Decomposition/ORB.hpp ../../OpenFPM_data/src/data_type/scalar.hpp \
Graph/CartesianGraphFactory_unit_test.hpp \
Graph/CartesianGraphFactory.hpp metis_util_unit_test.hpp metis_util.hpp \
......@@ -1430,9 +1433,7 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
../../OpenFPM_devices/src/memory/PreAllocHeapMemory.hpp \
../../OpenFPM_devices/src/memory/HeapMemory.hpp \
../../OpenFPM_IO/src/CSVWriter.hpp \
../../OpenFPM_IO/src/csv_multiarray.hpp \
Decomposition/CartDecomposition_unit_test.hpp \
Decomposition/CartDecomposition.hpp
../../OpenFPM_IO/src/csv_multiarray.hpp
/usr/include/stdc-predef.h:
......@@ -1628,6 +1629,8 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
/usr/include/alloca.h:
/usr/include/bits/stdlib-bsearch.h:
/usr/include/bits/stdlib-float.h:
/usr/include/c++/4.9.2/cstdio:
......@@ -1640,6 +1643,8 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/c++/4.9.2/cerrno:
/usr/include/errno.h:
......@@ -3052,6 +3057,8 @@ Graph/CartesianGraphFactory.hpp:
/usr/include/bits/mathcalls.h:
/usr/include/bits/mathinline.h:
/usr/include/c++/4.9.2/sstream:
/usr/include/c++/4.9.2/bits/sstream.tcc:
......@@ -3884,6 +3891,8 @@ Graph/CartesianGraphFactory.hpp:
/usr/include/bits/fenv.h:
/usr/include/bits/fenvinline.h:
/usr/include/boost/math/special_functions/math_fwd.hpp:
/usr/include/boost/math/special_functions/detail/round_fwd.hpp:
......@@ -4314,16 +4323,6 @@ Grid/grid_dist_id.hpp:
../../OpenFPM_vcluster/src/MPI_wrapper/MPI_IsendW.hpp:
../../OpenFPM_data/src/util/check_no_pointers.hpp:
../../OpenFPM_data/src/util/common.hpp:
../../OpenFPM_data/src/util/util_debug.hpp:
/usr/include/c++/4.9.2/cxxabi.h:
/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/cxxabi_tweaks.h:
../../OpenFPM_vcluster/src/util/Vcluster_log.hpp:
../../OpenFPM_data/src/timer.hpp:
......@@ -4352,8 +4351,14 @@ Grid/grid_dist_key.hpp:
../../OpenFPM_data/src/util/util_debug.hpp:
/usr/include/c++/4.9.2/cxxabi.h:
/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/cxxabi_tweaks.h:
../../OpenFPM_data/src/util/check_no_pointers.hpp:
../../OpenFPM_data/src/util/common.hpp:
../../OpenFPM_data/src/util/object_s_di.hpp:
../../OpenFPM_data/src/util/object_si_d.hpp:
......@@ -4502,6 +4507,8 @@ Grid/grid_dist_key.hpp:
../../OpenFPM_data/src/Vector/util.hpp:
../../OpenFPM_data/src/util/util_debug.hpp:
../../OpenFPM_vcluster/src/Pack_stat.hpp:
../../OpenFPM_vcluster/src/Pack_selector.hpp:
......@@ -4552,6 +4559,10 @@ dec_optimizer.hpp:
unit_test_init_cleanup.hpp:
Decomposition/CartDecomposition_unit_test.hpp:
Decomposition/CartDecomposition.hpp:
Decomposition/ORB_unit_test.hpp:
Decomposition/ORB.hpp:
......@@ -4591,7 +4602,3 @@ Vector/vector_dist_key.hpp:
../../OpenFPM_IO/src/CSVWriter.hpp:
../../OpenFPM_IO/src/csv_multiarray.hpp:
Decomposition/CartDecomposition_unit_test.hpp:
Decomposition/CartDecomposition.hpp:
......@@ -104,6 +104,23 @@ class CartDecomposition
}
};
//! Particular case for internal ghost boxes, in contain the internal local ghost box
struct Box_sub_k : Box<dim,T>
{
// Domain id
size_t sub;
//! k \see getLocalGhostIBoxE
long int k;
Box_sub_k operator=(const Box<dim,T> & box)
{
::Box<dim,T>::operator=(box);
return *this;
}
};
struct Box_dom
{
// Intersection between the local sub-domain enlarged by the ghost and the contiguous processor
......@@ -115,6 +132,18 @@ class CartDecomposition
openfpm::vector_std< Box_sub> ibx;
};
//! Case for local ghost box
struct lBox_dom
{
// Intersection between the local sub-domain enlarged by the ghost and the contiguous processor
// sub-domains (External ghost)
openfpm::vector_std< Box_sub > ebx;
// Intersection between the contiguous processor sub-domain enlarged by the ghost with the
// local sub-domain (Internal ghost)
openfpm::vector_std< Box_sub_k> ibx;
};
public:
//! Type of the domain we are going to decompose
......@@ -154,7 +183,7 @@ private:
std::unordered_map<size_t, N_box> nn_processor_subdomains;
//! it contain the internal ghosts of the local processor
openfpm::vector<Box_dom> loc_ghost_box;
openfpm::vector<lBox_dom> loc_ghost_box;
//! Structure that contain for each sub-domain box the processor id
//! exist for efficient global communication
......@@ -176,10 +205,12 @@ private:
//! Runtime virtual cluster machine
Vcluster & v_cl;
//! Cell-list that store the geometrical information about the intersection between the local sub-domain
//! and the near processor sub-domains
//! Cell-list that store the geometrical information of the internal ghost boxes
CellList<dim,T,FAST> geo_cell;
//! Cell-list that store the geometrical information of the local internal ghost boxes
CellList<dim,T,FAST> lgeo_cell;
/*! \brief Create internally the decomposition
*
......@@ -332,8 +363,12 @@ private:
// Initialize the geo_cell structure
geo_cell.Initialize(domain,div,orig);
lgeo_cell.Initialize(domain,div,orig);
}
// Save the ghost boundaries
Ghost<dim,T> ghost;
/*! \brief Create the external local ghost boxes
*
* \param ghost margin to enlarge
......@@ -341,13 +376,18 @@ private:
*/
void create_loc_ghost_ebox(Ghost<dim,T> & ghost)
{
// Save the ghost
this->ghost = ghost;
loc_ghost_box.resize(sub_domains.size());
// For each sub-domain
for (size_t i = 0 ; i < sub_domains.size() ; i++)
{
// add a local ghost box
loc_ghost_box.add();
SpaceBox<dim,T> sub_with_ghost = sub_domains.get(i);
// enlarge the sub-domain with the ghost
sub_with_ghost.enlarge(ghost);
// intersect with the other local sub-domains
for (size_t j = 0 ; j < sub_domains.size() ; j++)
......@@ -355,10 +395,6 @@ private:
if (i == j)
continue;
SpaceBox<dim,T> sub_with_ghost = sub_domains.get(j);
// enlarge the sub-domain with the ghost
sub_with_ghost.enlarge(ghost);
::Box<dim,T> bi;
bool intersect = sub_with_ghost.Intersect(::SpaceBox<dim,T>(sub_domains.get(j)),bi);
......@@ -369,7 +405,18 @@ private:
b.sub = j;
b = bi;
loc_ghost_box.get(i).ibx.add(b);
// local external ghost box
loc_ghost_box.get(i).ebx.add(b);
// search this box in the internal box of the sub-domain j
for (size_t k = 0; k < loc_ghost_box.get(j).ibx.size() ; k++)
{
if (loc_ghost_box.get(j).ibx.get(k).sub == i)
{
loc_ghost_box.get(j).ibx.get(k).k = loc_ghost_box.get(i).ebx.size()-1;
break;
}
}
}
}
}
......@@ -387,29 +434,26 @@ private:
// For each sub-domain
for (size_t i = 0 ; i < sub_domains.size() ; i++)
{
SpaceBox<dim,T> sub_with_ghost = sub_domains.get(i);
// enlarge the sub-domain with the ghost
sub_with_ghost.enlarge(ghost);
// add a local ghost box
loc_ghost_box.add();
// intersect with the others local sub-domains
for (size_t j = 0 ; j < sub_domains.size() ; j++)
{
if (i == j)
continue;
SpaceBox<dim,T> sub_with_ghost = sub_domains.get(j);
// enlarge the sub-domain with the ghost
sub_with_ghost.enlarge(ghost);
::Box<dim,T> bi;
bool intersect = sub_with_ghost.Intersect(::SpaceBox<dim,T>(sub_domains.get(j)),bi);
bool intersect = sub_with_ghost.Intersect(::SpaceBox<dim,T>(sub_domains.get(i)),bi);
if (intersect == true)
{
Box_sub b;
Box_sub_k b;
b.sub = j;
b = bi;
b.k = -1;
loc_ghost_box.get(i).ibx.add(b);
}
......@@ -612,11 +656,12 @@ private:
Box_sub sb;
sb = b_int.box;
sb.sub = i;
pr_box_int.ibx.add(sb);
// update the geo_cell list
// get the boxes this box span
// get the cells this box span
const grid_key_dx<dim> p1 = geo_cell.getCellGrid(b_int.box.getP1());
const grid_key_dx<dim> p2 = geo_cell.getCellGrid(b_int.box.getP2());
......@@ -706,23 +751,6 @@ public:
bbox.zero();
}
/*! \brief Cartesian decomposition constructor, it divide the space in boxes
*
* \param dec is a vector that store how to divide on each dimension
* \param domain is the domain to divide
* \param v_cl are information of the cluster runtime machine
*
*/
CartDecomposition(std::vector<size_t> dec, Domain<dim,T> domain, Vcluster & v_cl)
:gr(dec),cd(domain,dec,0),domain(domain),v_cl(v_cl)
{
// Reset the box to zero
bbox.zero();
// Create the decomposition
CreateDecomposition(v_cl);
}
//! Cartesian decomposition destructor
~CartDecomposition()
{}
......@@ -993,7 +1021,7 @@ p1[0]<-----+ +----> p2[0]
*
*
*/
void calculateGhostBoxes(Ghost<dim,T> & ghost)
void calculateGhostBoxes()
{
#ifdef DEBUG
// the ghost margins are assumed to be smaller
......@@ -1036,8 +1064,9 @@ p1[0]<-----+ +----> p2[0]
// create the internal structures that store ghost information
create_box_nn_processor_ext(ghost);
create_box_nn_processor_int(ghost);
create_loc_ghost_ebox(ghost);
// ebox must come after ibox (in this case)
create_loc_ghost_ibox(ghost);
create_loc_ghost_ebox(ghost);
}
/*! \brief processorID return in which processor the particle should go
......@@ -1077,30 +1106,14 @@ p1[0]<-----+ +----> p2[0]
/*! \brief Set the parameter of the decomposition
*
* \param div_ std::vector storing into how many domain to decompose on each dimension
* \param domain_ domain to decompose
*
*/
void setParameters(std::vector<size_t> div_, Domain<dim,T> domain_)
{
// Set the decomposition parameters
div = div_;
domain = domain_;
//! Create the decomposition
CreateDecomposition(v_cl);
}
/*! \brief Set the parameter of the decomposition
*
* \param div_ std::vector storing into how many domain to decompose on each dimension
* \param div_ storing into how many domain to decompose on each dimension
* \param domain_ domain to decompose
*
*/
void setParameters(const size_t (& div_)[dim], Domain<dim,T> domain_)
void setParameters(const size_t (& div_)[dim], Domain<dim,T> domain_, Ghost<dim,T> ghost = Ghost<dim,T>())
{
// set the ghost
this->ghost = ghost;
// Set the decomposition parameters
gr.setDimensions(div_);
......@@ -1166,11 +1179,9 @@ p1[0]<-----+ +----> p2[0]
return sub_domains.get<Object>(id);
}
/*! \brief Get the total number of Hyper-cube
/*! \brief Get the total number of sub-domain for the local processor
*
* Get the total number of Hyper-cube
*
* \return The total number of hyper-cube
* \return The total number of sub-domains
*
*/
......@@ -1179,37 +1190,12 @@ p1[0]<-----+ +----> p2[0]
return gr.size();
}
/*! \brief produce an hyper-cube approximation of the space decomposition
*
*/
void hyperCube()
{
}
/*! \brief Get the local grids
*
* Get the local grids
/*! \brief Get the local sub-domain
*
* \return the local grids
* \param i (each local processor can have more than one sub-domain)
* \return the sub-domain
*
*/
auto getLocalHyperCubes() -> decltype(sub_domains) &
{
return sub_domains;
}
/*! \brief Get the local hyper-cubes
*
* Get the local hyper-cubes
*
* \param lc is the id of the space
* \return the local hyper-cube
*
*/
SpaceBox<dim,T> getLocalHyperCube(size_t lc)
{
// Create a space box
......@@ -1227,6 +1213,24 @@ p1[0]<-----+ +----> p2[0]
return sp;
}
/*! \brief Get the local sub-domain with ghost extension
*
* \param i (each local processor can have more than one sub-domain)
* \return the sub-domain
*
*/
SpaceBox<dim,T> getSubDomainWithGhost(size_t lc)
{
// Create a space box
SpaceBox<dim,T> sp = sub_domains.get(lc);
// enlarge with ghost
sp.enlarge(ghost);